Options
All
  • Public
  • Public/Protected
  • All
Menu

nstg

Index

Functions

evaluateAction

  • evaluateAction(action: Action, nations: string[], newNations: string[]): string[]
  • Evaluates the specified action with a list of the current nations in the group and a list of the nations associated with the most recently processed command.

    Parameters

    • action: Action

      The specified action.

    • nations: string[]

      The current nations in the group.

    • newNations: string[]

      The nations associated with the current command.

    Returns string[]

    The new list of nations for the current group.

evaluateCommand

  • Evaluates the specified recipient command using the specified API.

    Parameters

    • api: NsApi

      The specified API.

    • command: RecipientCommand

      The specified recipient command.

    • nations: string[]

      The list of nations in the current group.

    • refreshOverrideCache: RefreshOverrideCache

      Rules for when to override API caching when re-evaluating a TRL string in continuous mode.

    Returns Promise<string[]>

    A promise returning a new list of nations for the current group.

evaluateGroup

  • Evaluates the specified group recipient commands using the specified API.

    Parameters

    • api: NsApi

      The specified API.

    • commands: RecipientCommand[]

      The specified recipient commands.

    • refreshOverrideCache: RefreshOverrideCache

      Rules for when to override API caching when re-evaluating a TRL string in continuous mode.

    Returns Promise<string[]>

    A promise returning the list of nations that the specified commands evaluate to.

evaluatePrimitive

  • Evaluates the specified primitive with the specified action using the specified API.

    Parameters

    • api: NsApi

      The specified API.

    • primitive: RecipientPrimitive

      The specified primitive.

    • action: Action

      The specified action.

    • nations: string[]

      The nations associated with the current group.

    • refreshOverrideCache: RefreshOverrideCache

      Rules for when to override API caching when re-evaluating a TRL string in continuous mode.

    Returns Promise<string[]>

    A promise returning a new list of nations for the current group.

evaluateTrl

  • Evaluates the specified recipient commands using the specified API.

    Parameters

    • api: NsApi

      The specified API.

    • commands: RecipientCommand[]

      The specified recipient commands.

    • refreshOverrideCache: RefreshOverrideCache

      Rules for when to override API caching when re-evaluating a TRL string in continuous mode.

    Returns Promise<string[]>

    A promise returning the list of nations that the specified TRL string evaluates to.

getCategory

  • getCategory(api: NsApi, nation: string, overrideCache?: boolean): Promise<string>
  • Gets the category of the specified nation using the specified API.

    Parameters

    • api: NsApi

      The specified API.

    • nation: string

      The specified nation.

    • Default value overrideCache: boolean = false

      Whether or not to override the cache for this request.

    Returns Promise<string>

    A promise returning the list of nations.

getCensusScore

  • getCensusScore(api: NsApi, nation: string, censusId: string, overrideCache?: boolean): Promise<number>
  • Gets the score for the specified census ID for the specified nation using the specified API.

    Parameters

    • api: NsApi

      The specified API.

    • nation: string

      The specified nation.

    • censusId: string

      The specified census ID.

    • Default value overrideCache: boolean = false

      Whether or not to override the cache for this request.

    Returns Promise<number>

    A promise returning the list of nations.

getNations

  • getNations(args: string[]): Promise<string[]>
  • Gets a list of nations.

    Parameters

    • args: string[]

      The list of nations in raw form.

    Returns Promise<string[]>

    A promise returning the list of nations.

getNewNations

  • getNewNations(api: NsApi, count: number, overrideCache?: boolean): Promise<string[]>
  • Gets the specified number of new nations using the specified API.

    Parameters

    • api: NsApi

      The specified API.

    • count: number

      The number of new nations to retrieve.

    • Default value overrideCache: boolean = false

      Whether or not to override the cache for this request.

    Returns Promise<string[]>

    A promise returning the list of nations.

getRecipients

  • getRecipients(api: NsApi, trl: string, refreshOverrideCache?: RefreshOverrideCache): Promise<string[]>
  • Parses and evaluates a TRL string using the specified API.

    Parameters

    • api: NsApi

      The specified API.

    • trl: string

      The specified TRL string.

    • Default value refreshOverrideCache: RefreshOverrideCache = {}

      Rules for when to override API caching when re-evaluating a TRL string in continuous mode.

    Returns Promise<string[]>

    A promise returning the nations represented by the specified TRL string.

getRefoundedNations

  • getRefoundedNations(api: NsApi, count: number, overrideCache?: boolean): Promise<string[]>
  • Gets the specified number of refounded nations using the specified API.

    Parameters

    • api: NsApi

      The specified API.

    • count: number

      The number of refounded nations to retrieve.

    • Default value overrideCache: boolean = false

      Whether or not to override the cache for this request.

    Returns Promise<string[]>

    A promise returning the list of nations.

getRegions

  • getRegions(api: NsApi, regions: string[], overrideCache?: boolean): Promise<string[]>
  • Gets the nations in a list of regions using the specified API.

    Parameters

    • api: NsApi

      The specified API.

    • regions: string[]

      The list of regions.

    • Default value overrideCache: boolean = false

      Whether or not to override the cache for this request.

    Returns Promise<string[]>

    A promise returning the list of nations.

getTags

  • getTags(api: NsApi, args: string[], overrideCache?: boolean): Promise<string[]>
  • Gets the nations in all regions with the specified tags using the specified API.

    Parameters

    • api: NsApi

      The specified API.

    • args: string[]

      The list of tags.

    • Default value overrideCache: boolean = false

      Whether or not to override the cache for this request.

    Returns Promise<string[]>

    A promise returning the list of nations.

getWorldAssemblyDelegates

  • getWorldAssemblyDelegates(api: NsApi, overrideCache?: boolean): Promise<string[]>
  • Gets all World Assembly delegates using the specified API.

    Parameters

    • api: NsApi

      The specified API.

    • Default value overrideCache: boolean = false

      Whether or not to override the cache for this request.

    Returns Promise<string[]>

    A promise returning the list of nations.

getWorldAssemblyMembers

  • getWorldAssemblyMembers(api: NsApi, overrideCache?: boolean): Promise<string[]>
  • Gets all World Assembly member states using the specified API.

    Parameters

    • api: NsApi

      The specified API.

    • Default value overrideCache: boolean = false

      Whether or not to override the cache for this request.

    Returns Promise<string[]>

    A promise returning the list of nations.

parseCommand

  • Parses the specified command string into a recipient command.

    Parameters

    • cxt: ParseContext

      The current parse context.

    • position: number[]

      The position of the specified group.

    Returns RecipientCommand

    A recipient command.

parseGroup

  • Parses the specified group string into a list of recipient commands.

    Parameters

    • cxt: ParseContext

      The current parse context.

    • position: number[]

      The position of the specified group.

    Returns RecipientCommand[]

    A list of recipient commands.

parsePrimitive

  • Parses the specified primitive string into a recipient primitive.

    Parameters

    • cxt: ParseContext

      The current parse context.

    • position: number[]

      The position of the specified group.

    Returns RecipientPrimitive

    A recipient primitive.

parseTrl

  • Parses the specified TRL string into a list of recipient commands.

    Parameters

    • trl: string

    Returns RecipientCommand[]

toId

  • toId(nation: string): string
  • Converts nation names to a fixed form: all lowercase, with spaces replaced with underscores.

    Parameters

    • nation: string

      The nation name to convert.

    Returns string

    The converted nation name.

validateTrl

  • validateTrl(trl: string): void
  • Throws an error if the specified TRL string is not valid.

    Parameters

    • trl: string

    Returns void

Generated using TypeDoc