Package VASSAL.build

Class GameModule

All Implemented Interfaces:
AutoConfigurable, Buildable, Configurable, GpIdSupport, MutablePropertiesContainer, PropertyNameSource, PropertySource, TranslatableStringContainer, CommandEncoder, ValidityChecker, Translatable, ImageSearchTarget, SearchTarget, ToolBarComponent
Direct Known Subclasses:
BasicModule

The GameModule class is the base class for a VASSAL module. It is the root of the Buildable containment hierarchy, and thus also the root of the Editor's ConfigureTree. GameModule's implementation of CommandEncoder is slightly different, serving as a central dispatch point for all other CommandEncoders, which register themselves with GameModule. Components which are intended to be added directly to the GameModule are contained in the VASSAL.build.module package.

GameModule is a singleton, and contains access points for many other classes, such as DataArchive, ServerConnection, Logger, Chatter, and Prefs.

  • Field Details

  • Constructor Details

    • GameModule

      public GameModule(DataArchive archive)
      Constructor for a GameModule.
      Parameters:
      archive - The .vmod (or .tmp) archive to associate
  • Method Details

    • setLoadOverSemaphore

      public void setLoadOverSemaphore(boolean state)
      Parameters:
      state - - true if we're loading-over-top of an existing game (so don't disturb UI elements if possible, will receive a setup(true) soon enough)
    • isLoadOverSemaphore

      public boolean isLoadOverSemaphore()
      Returns:
      true if we're loading-over-top of an existing game (so don't disturb UI elements if possible, will receive a setup(true) soon enough)
    • setRefreshingSemaphore

      public void setRefreshingSemaphore(boolean state)
      Parameters:
      state - - true if refreshing (suppresses GameState.setup method)
    • isRefreshingSemaphore

      public boolean isRefreshingSemaphore()
      Returns:
      true if refreshing (suppresses GameState.setup method)
    • setLoadingContinuationSemaphore

      public void setLoadingContinuationSemaphore(boolean state)
      Parameters:
      state - - true if loading game as continuation (don't thrash listeners)
    • isLoadingContinuationSemaphore

      public boolean isLoadingContinuationSemaphore()
      Returns:
      true if loading game as continuation (don't thrash listeners)
    • getFrame

      @Deprecated(since="2020-08-06", forRemoval=true) public JFrame getFrame()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      the top-level frame of the controls window
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
      String identifier for module
    • getPlayerWindow

      public PlayerWindow getPlayerWindow()
      "Player" in this context meaning the VASSAL Player, i.e. the main module window, as opposed to any individual player meaning participant-in-a-boardgame.
      Returns:
      The main window for the module
    • initFrameTitle

      public void initFrameTitle()
      Sets the proper name for module window's title bar
    • getWizardSupport

      public WizardSupport getWizardSupport()
      Returns:
      Our wizard
    • getServerControls

      public ChatServerControls getServerControls()
      Returns:
      our ChatServerControls.
    • getConsole

      public Console getConsole()
      Returns:
      our Console
    • isErrorLogToChat

      public static boolean isErrorLogToChat()
      Returns:
      True if errorLog should also be sent to chat log.
    • setErrorLogToChat

      public static void setErrorLogToChat(boolean errorLogToChat)
      Parameters:
      errorLogToChat - true if errorLog should also be sent to chat log
    • getI18nPrefix

      public String getI18nPrefix()
      Overrides:
      getI18nPrefix in class AbstractConfigurable
      Returns:
      Generate a standard prefix for i18n keys for attributes of this component - Classname.attributeName
    • setDirty

      public void setDirty(boolean touchThis)
    • build

      public void build(Element e)
      Builds the module's component hierarchy from a given XML element, or a null one is given initializes a brand new default "new module" hierarchy.
      Specified by:
      build in interface Buildable
      Overrides:
      build in class AbstractBuildable
      Parameters:
      e - XML element to build from, or null to build the default hierarchy
    • setAttribute

      public void setAttribute(String name, Object value)
      Sets a buildFile (XML) attribute value for this component.
      Specified by:
      setAttribute in interface AutoConfigurable
      Specified by:
      setAttribute in interface Translatable
      Specified by:
      setAttribute in class AbstractBuildable
      Parameters:
      name - the name of the attribute. Will be one of those listed in getAttributeNames()
      value - If the value parameter is a String, it will be the value returned by getAttributeValueString(java.lang.String) for the same key. If the implementing class extends AbstractConfigurable, then value can also be an instance of
    • getAttributeValueString

      public String getAttributeValueString(String name)
      Description copied from interface: AutoConfigurable
      Called by the Buildable.getBuildElement(org.w3c.dom.Document) method to write the attributes into an XML element
      Specified by:
      getAttributeValueString in interface AutoConfigurable
      Specified by:
      getAttributeValueString in interface Translatable
      Specified by:
      getAttributeValueString in class AbstractBuildable
      Parameters:
      name - the name of the attribute. Will be one of those listed in getAttributeNames()
      Returns:
      a String representation of the attribute with the given name. When initializing a module, this String value will be passed to setAttribute(java.lang.String, java.lang.Object)
    • compareVersions

      @Deprecated(since="2020-08-06", forRemoval=true) public static int compareVersions(String v1, String v2)
      Deprecated, for removal: This API element is subject to removal in a future version.
      A valid version format is "w.x.y[bz]", where 'w','x','y', and 'z' are integers.
      Returns:
      a negative number if v2 is a later version the v1, a positive number if an earlier version, or zero if the versions are the same.
    • addTo

      public void addTo(Buildable b)
      Game Module is normally at the root of the hierarchy, so it doesn't expect to get added to anything.
      Specified by:
      addTo in interface Buildable
      Parameters:
      b - Notional "parent" of this GameModule
    • getConfigureTypeName

      public static String getConfigureTypeName()
      Gets the generic name for this type of class across all instances of it. Appears in the Editor window in [..] as e.g. [Map], [Prototype], etc.
      Returns:
      The generic name for this kind of component, i.e. the part appearing [In Brackets] in the Editor's ConfigureTree.
    • removeFrom

      public void removeFrom(Buildable parent)
      Since we aren't expecting to be addTo(VASSAL.build.Buildable)'ed to a parent, we likewise don't need to do much about being "removeFrom'ed" one.
      Specified by:
      removeFrom in interface Configurable
      Parameters:
      parent - Notional "parent" of this GameModule
    • getHelpFile

      public HelpFile getHelpFile()
      Specified by:
      getHelpFile in interface Configurable
      Returns:
      a HelpFile describing how to use and configure this component
    • getAttributeNames

      public String[] getAttributeNames()
      Lists all the buildFile (XML) attribute names for this component. If this component is ALSO an AbstractConfigurable, then this list of attributes determines the appropriate attribute order for AbstractConfigurable.getAttributeDescriptions() and AbstractConfigurable.getAttributeTypes().
      Specified by:
      getAttributeNames in interface AutoConfigurable
      Specified by:
      getAttributeNames in class AbstractBuildable
      Returns:
      a list of all buildFile (XML) attribute names for this component
      See Also:
      AbstractBuildable
    • getAttributeDescriptions

      public String[] getAttributeDescriptions()
      Description copied from interface: AutoConfigurable
      Return an array of Strings describing the attributes of this object. These strings are used as prompts in the Properties window for this object.
      Specified by:
      getAttributeDescriptions in interface AutoConfigurable
      Specified by:
      getAttributeDescriptions in class AbstractConfigurable
      Returns:
      an array of Strings describing the buildFile (XML) attributes of this component. These strings are used as prompts in the Properties window for this object, when the component is configured in the Editor. The order of descriptions should be the same as the order of names in AbstractBuildable.getAttributeNames()
      See Also:
      AbstractConfigurable
    • getAttributeTypes

      public Class<?>[] getAttributeTypes()
      Description copied from interface: AutoConfigurable
      Return the Class for the attributes of this object. Valid classes are: String, Integer, Double, Boolean, Image, File, Color, and KeyStroke
      Specified by:
      getAttributeTypes in interface AutoConfigurable
      Specified by:
      getAttributeTypes in class AbstractConfigurable
      Returns:
      the Class for the buildFile (XML) attributes of this component. Valid classes include: String, Integer, Double, Boolean, Image, Color, and KeyStroke, along with any class for which a Configurer exists in VASSAL.configure. The class determines, among other things, which type of AutoConfigurer will be used to configure the attribute when the object is configured in the Editor. The order of classes should be the same as the order of names in AbstractBuildable.getAttributeNames()
      See Also:
      AbstractConfigurable
    • getAllowableConfigureComponents

      public Class<?>[] getAllowableConfigureComponents()
      List of subcomponents which can be added to a GameModule.
      Specified by:
      getAllowableConfigureComponents in interface Configurable
      Returns:
      a list of valid sub-component Classes. If a Class appears in this list, then instances of that class may be added to this component from the Editor's ConfigureTree window by right-clicking on the component and selecting the appropriate "Add" option.
      See Also:
      Configurable
    • addKeyStrokeSource

      public void addKeyStrokeSource(KeyStrokeSource src)
      The GameModule acts as the mediator for hotkey events. Components that wish to fire hotkey events when they have the focus should register themselves using this method. These events will be forwarded to all listeners that have registered themselves with addKeyStrokeListener(VASSAL.tools.KeyStrokeListener)
      Parameters:
      src - KeyStrokeSource Component that wants to register as a source for hotkey events
    • removeKeyStrokeListener

      public void removeKeyStrokeListener(KeyStrokeListener l)
    • addKeyStrokeListener

      public void addKeyStrokeListener(KeyStrokeListener l)
      The GameModule acts as the mediator for hotkey events. Objects that react to hotkey events should register themselves using this method. Any component that has been registered with addKeyStrokeSource(VASSAL.tools.KeyStrokeSource) will forward hotkey events to listeners registered with this method.
      Parameters:
      l - KeystrokeListener to add
    • resetSourcesAndListeners

      public void resetSourcesAndListeners()
    • refreshKeyStrokeListeners

      public void refreshKeyStrokeListeners()
      If our keyboard mapping paradigm changes (example: Mac Legacy preference checked/unchecked), we need to reregister all of our KeyStrokeListeners
    • fireKeyStroke

      @Deprecated(since="2020-08-06", forRemoval=true) public void fireKeyStroke(KeyStroke stroke)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • fireKeyStroke

      public void fireKeyStroke(NamedKeyStroke stroke)
      Invokes a NamedKeyStroke to all of our listeners.
      Parameters:
      stroke - NamedKeyStroke to invoke
    • getGameName

      public String getGameName()
      Returns:
      the name of the game for this module
    • getLocalizedGameName

      public String getLocalizedGameName()
      Returns:
      the localized/translated game name for this module
    • getGameVersion

      public String getGameVersion()
      Returns:
      the version number for this module
    • addIdChangeListener

      public void addIdChangeListener(PropertyChangeListener l)
      Currently used to listen for changes to player names
      Parameters:
      l - propertyChangeListener to add
    • removeIdChangeListener

      public void removeIdChangeListener(PropertyChangeListener l)
      Currently used to listen for changes to player names
      Parameters:
      l - propertyChangeListener to remove
    • getPrefs

      public Prefs getPrefs()
      Returns:
      the preferences for this module
    • getGlobalPrefs

      @Deprecated(since="2020-08-06", forRemoval=true) public Prefs getGlobalPrefs()
      Deprecated, for removal: This API element is subject to removal in a future version.
      A set of preferences that applies to all modules
    • isTranslatableSupport

      public boolean isTranslatableSupport()
    • addCommandEncoder

      public void addCommandEncoder(CommandEncoder ce)
      GameModule holds the master list of CommandEncoders, and invokes them as appropriate when commands are sent and received. This method adds a CommandEncoder to the list of objects that will attempt to decode/encode a command.
      See Also:
      decode(java.lang.String), encode(VASSAL.command.Command)
    • removeCommandEncoder

      public void removeCommandEncoder(CommandEncoder ce)
      This method removes a CommandEncoder from the list of objects that will attempt to decode/encode a command
      See Also:
      addCommandEncoder(VASSAL.command.CommandEncoder), decode(java.lang.String), encode(VASSAL.command.Command)
    • createPiece

      public GamePiece createPiece(String type)
      Central location to create any type of GamePiece from within VASSAL
      Parameters:
      type - String definition of the piece
      Returns:
      Created Piece
    • createPiece

      public GamePiece createPiece(String type, GamePiece inner)
      Central location to create any type of GamePiece Trait (Decorator) from within VASSAL
      Parameters:
      type - String definition of the Trait (Decorator)
      Returns:
      Created Piece
    • warn

      public void warn(String s)
      Display the given text in the control window's status line. Save the messages for later if the Chatter has not been initialised yet
      Parameters:
      s - message to display in Chat Log
    • getRNG

      public Random getRNG()
      Returns:
      a single Random number generator that all objects may share
    • getLogger

      public Logger getLogger()
      Returns:
      the object responsible for logging commands to a .vlog logfile to support PBEM play
    • setChatter

      public void setChatter(Chatter c)
      Allows the Chat Log window to register itself to the Module. When a Chat Log is first registered, display any warning messages deferred during earlier initialisation
      Parameters:
      c - The Chat Log window we want to use
    • getControlPanel

      public JComponent getControlPanel()
    • getChatter

      public Chatter getChatter()
      Returns:
      the registered Chat Log for the Module Window (window that displays chat text)
    • getPieceWindow

      public PieceWindow getPieceWindow()
      Returns:
      the registered docked PieceWindow (game piece palette) for the module
    • setPieceWindow

      public void setPieceWindow(PieceWindow pieceWindow)
      Allows a PieceWindow that wants to be our docked PieceWindow to register itself.
      Parameters:
      pieceWindow - PieceWindow to be our docked one
    • setPrefs

      public void setPrefs(Prefs p)
    • setGlobalPrefs

      @Deprecated(since="2020-08-06", forRemoval=true) public void setGlobalPrefs(Prefs p)
      Deprecated, for removal: This API element is subject to removal in a future version.
      no replacement
    • decode

      public Command decode(String command)
      Decodes our inbound Command traffic -- incoming player commands ready to be executed. Unlike everybody else's decode method, the GameModule's method first pulls apart strings of multiple commands into singles. It then invokes each of its registered CommandEncoders in turn until one of them is able to deserialize the command from a String into a Command object ready to be executed.
      Specified by:
      decode in interface CommandEncoder
    • encode

      public String encode(Command c)
      Encodes our outbound Command traffic -- outgoing player commands to be sent to other players' clients via either online (server) or logfile (PBEM). Unlike everybody else's encode method, the GameModule's method accepts Command trees containing multiple appended commands. It goes through them in order and for each command invokes each of its registered CommandEncoders in turn until one of them is able to serialize the Command object into an ascii-compatible String ready to be sent to other players' clients. It does this for each of the subcommands in the list, and the results for all are returned as a single String.
      Specified by:
      encode in interface CommandEncoder
    • getFileChooser

      public FileChooser getFileChooser()
      Returns:
      a common FileChooser so that recent file locations can be remembered
    • getFileDialog

      @Deprecated(since="2020-08-06", forRemoval=true) public FileDialog getFileDialog()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use getFileChooser() instead.
    • getToolBar

      public JToolBar getToolBar()
      Provides access to the Game Module's toolbar.
      Specified by:
      getToolBar in interface ToolBarComponent
      Returns:
      the JToolBar of the command window
    • getWindowTitleString

      public String getWindowTitleString(String key, String name)
      Returns an appropriate Title Bar string for a window, based on the module name, the last read/written game file, and the manner of interaction with it.
      Parameters:
      key - Localization key to be used to generate string
      name - Name of the object whose title bar is to be generated
      Returns:
      appropriate title bar string for a window.
    • getTitleString

      public String getTitleString()
      Returns an appropriate Title Bar string for the main module window, based on the module name, the last read/written game file, and the manner of interaction with it.
      Returns:
      appropriate title bar string for main module window.
    • updateTitleBar

      public void updateTitleBar()
      Updates the title bar of the main module window, and all map windows
    • appendToTitle

      @Deprecated(since="2020-09-16", forRemoval=true) public void appendToTitle(String s)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Parameters:
      s - String to append to title
    • setGameFile

      public void setGameFile(String gameFile, GameModule.GameFileMode mode)
      Sets the most recent .VSAV / .VLOG file saved, loaded, or logged to, along with the type of action taken with that file.
      Parameters:
      gameFile - Most recent VSAV/VLOG if any
      mode - mode of access
    • getGameFile

      public String getGameFile()
      Returns:
      Most recent .VSAV/.VLOG that we've read or written.
    • setGameFileMode

      public void setGameFileMode(GameModule.GameFileMode mode)
      Sets the type of interaction we most recently had with saving/loading/replaying/logging, for managing title bars of windows.
      Parameters:
      mode - mode of access
    • getGameFileMode

      public GameModule.GameFileMode getGameFileMode()
      Returns:
      Returns the most recent type of interaction we've had for saving/loading/replaying/logging the game, for managing title bars of windows.
    • isReplayingOrLogging

      public boolean isReplayingOrLogging()
      Returns:
      true if we are currently logging or replaying a game.
    • quit

      public void quit()
      Exit the application, prompting user to save if necessary
    • shutDown

      public boolean shutDown()
      Prompt user to save open game and modules/extensions being edited
      Returns:
      true if shutDown should proceed, i.e. user did not cancel
    • sendAndLog

      public void sendAndLog(Command c)
      When the local player has taken any action that would change the game state (or otherwise needs to be sent to any other players' clients), the action should be encapsulated into a Command and sent here. This method encodes the Command, sends it to the server (if we're online) and write it to a .vlog PBEM logfile (if any is open). It thus drives both formats of multiplayer game through a common interface.
      Parameters:
      c - The Command to be sent and logged.
      See Also:
      encode(VASSAL.command.Command)
    • pauseLogging

      public boolean pauseLogging()
      Pause logging and return true if successful. Return false if logging already paused While Paused, commands are accumulated into pausedCommands so that they can all be logged at the same time, and generate a single UNDO command.
      Returns:
      Current logging pause status, false if logging currently paused
    • resumeLogging

      public Command resumeLogging()
      Restart logging and return any outstanding commands
      Returns:
      any outstanding Command (can contain multiple chained commands)
    • clearPausedCommands

      public void clearPausedCommands()
      Clear outstanding Commands Use where the calling level handles the sending of outstanding commands
    • getActiveUserId

      public static String getActiveUserId()
      Returns:
      the userId/password we're currently using, in case we're using one of our alternate defaults. Or if none explicitly picked, the actual contents of our password field.
    • getTempUserId

      public static String getTempUserId()
    • setTempUserId

      public static void setTempUserId(String id)
    • clearTempUserId

      public static void clearTempUserId()
    • getUserId

      public static String getUserId()
      Returns:
      a String that uniquely identifies the user
    • setUserId

      public static void setUserId(String newId)
      Set the identifier for the user
    • getServer

      public ServerConnection getServer()
      Returns:
      the object responsible for sending messages to the server
    • isMultiPlayer

      public boolean isMultiPlayer()
      Returns:
      true if the game is online or has ever had more than one player.
    • init

      public static void init(GameModule module) throws IOException
      Loads a module object into the player window. Registers a singleton GameModule and invokes Buildable.build(org.w3c.dom.Element) on it to build it from the XML buildFile. This will have the effect of invoking Buildable.build(org.w3c.dom.Element) on all of the module's subcomponents as well, effectively building our whole component hierarchy from the XML.
      Throws:
      IOException
    • updateLastSave

      public void updateLastSave()
      Save the current buildString for comparison when we try and quit.
    • generateGpId

      public String generateGpId()
      Allocates the next available GamePiece ID and returns it.
      Specified by:
      generateGpId in interface GpIdSupport
      Returns:
      an available GpID
      See Also:
      GpIdSupport
    • getNextGpId

      public int getNextGpId()
      Description copied from interface: GpIdSupport
      Accessors to check and update the next GpId if necessary.
      Specified by:
      getNextGpId in interface GpIdSupport
      Returns:
      the next available GpId (GamePiece ID) (but doesn't allocate it -- for that see generateGpId())
      See Also:
      GpIdSupport
    • setNextGpId

      public void setNextGpId(int id)
      Sets the next available GamePiece ID
      Specified by:
      setNextGpId in interface GpIdSupport
      Parameters:
      id - new value for nextGpId.
      See Also:
      GpIdSupport
    • setGpIdSupport

      public void setGpIdSupport(GpIdSupport s)
      Registers a GamePiece ID support object for us to manage a namespace for unique GamePiece objects.
      Parameters:
      s - GamePiece ID object
    • getGpIdSupport

      public GpIdSupport getGpIdSupport()
      Returns:
      Our registered Game Piece ID namespace service provider.
    • getDataArchive

      public DataArchive getDataArchive()
      VASSAL modules are stored in ".vmod" files, which are actually simple ".zip" files with a unique extension.
      Returns:
      the object which stores data for the module -- our .vmod Zip file.
    • getResourcePathFinder

      public ResourcePathFinder getResourcePathFinder()
    • getArchiveWriter

      public ArchiveWriter getArchiveWriter()
      VASSAL modules are stored in ".vmod" files, which are actually simple ".zip" files with a unique extension. If the module is being edited, return the writeable archive for the module
      Returns:
      the writer for our .vmod Zip file
    • getImageTileSource

      public ImageTileSource getImageTileSource()
      Returns:
      the object that provides tiling and caching services for tiling large map images.
    • isLocalizationEnabled

      public boolean isLocalizationEnabled()
      Is the module being translated into the user's Locale? Localization is disabled when editing a module
      Returns:
      true if the module/extension has been localized
    • isEditorOpen

      public boolean isEditorOpen()
      Is an editor window currently open
      Returns:
      true if we're running with an editor window
    • getGameModule

      public static GameModule getGameModule()
      Returns:
      the singleton instance of GameModule
    • getGameState

      public GameState getGameState()
      Return the object responsible for tracking the state of a game. Only one game in progress is allowed;
    • saveAs

      public void saveAs()
      If the module is being edited, write the module data after prompting for a new filename.
    • save

      public void save()
      If the module is being edited, write the module data to the current filename
    • getProperty

      public Object getProperty(Object key)
      Gets the value of a module level global property -- this includes identification information for the local player as well as the contents of any Global Property objects defined at module level in the Module.
      Specified by:
      getProperty in interface PropertySource
      Parameters:
      key - identifies the global property to be returned
      Returns:
      value of designated global property
    • getMutableProperty

      public MutableProperty getMutableProperty(String name)
      Gets the value of a mutable (changeable) "Global Property". Module level Global Properties serve as the "global variables" of a VASSAL Module, as they are accessible by any component at any time.
      Specified by:
      getMutableProperty in interface MutablePropertiesContainer
      Parameters:
      name - identifies the Global Property whose value should be returned
      Returns:
      value of designated global property
    • getTranslatableString

      public TranslatableString getTranslatableString(String name)
      Description copied from interface: TranslatableStringContainer
      Find an object with the given name
      Specified by:
      getTranslatableString in interface TranslatableStringContainer
    • addMutableProperty

      public void addMutableProperty(String key, MutableProperty p)
      Adds a new mutable (changeable) "Global Property" to the Module. Module level Global Properties serve as the "global variables" of a VASSAL Module, as they are accessible by any component at any time.
      Specified by:
      addMutableProperty in interface MutablePropertiesContainer
      Parameters:
      key - Name for the new Global Property
      p - Starting property value
    • addTranslatableString

      public void addTranslatableString(String key, TranslatableString p)
      Description copied from interface: TranslatableStringContainer
      Add a property under the given key
      Specified by:
      addTranslatableString in interface TranslatableStringContainer
      Parameters:
      key - key
      p - property
    • removeMutableProperty

      public MutableProperty removeMutableProperty(String key)
      Removes a mutable property from the Global Properties list.
      Specified by:
      removeMutableProperty in interface MutablePropertiesContainer
      Parameters:
      key - Name of the Global Property
      Returns:
      the removed property, for some reason.
    • removeTranslatableString

      public TranslatableString removeTranslatableString(String key)
      Description copied from interface: TranslatableStringContainer
      Remove the property with the given key
      Specified by:
      removeTranslatableString in interface TranslatableStringContainer
      Parameters:
      key - key
    • getMutablePropertiesContainerId

      public String getMutablePropertiesContainerId()
      Description copied from interface: MutablePropertiesContainer
      Return a unique Id for the container
      Specified by:
      getMutablePropertiesContainerId in interface MutablePropertiesContainer
      Returns:
      Identifies the ID/level for mutable properties stored here in the Module.
    • getTranslatableStringContainerId

      public String getTranslatableStringContainerId()
      Description copied from interface: TranslatableStringContainer
      Return a unique Id for the container
      Specified by:
      getTranslatableStringContainerId in interface TranslatableStringContainer
    • getLocalizedProperty

      public Object getLocalizedProperty(Object key)
      Description copied from interface: PropertySource
      Returns a localized translation of the specified property value, if available. Otherwise returns the non-localized version.
      Specified by:
      getLocalizedProperty in interface PropertySource
      Parameters:
      key - Name of the property to get the value of
      Returns:
      Localized/translated name of the named property, if one is available, otherwise returns the non-localized name
    • getCrc

      public long getCrc()
      Returns:
      a cumulative CRC from all of our files
    • getI18nData

      public ComponentI18nData getI18nData()
      Specified by:
      getI18nData in interface Translatable
      Overrides:
      getI18nData in class AbstractConfigurable
      Returns:
      the object containing the internationalization/localization information for this component
    • getPlayerRoster

      public PlayerRoster getPlayerRoster()
      Returns:
      the PlayerRoster instance, or null if no PlayerRoster exists within this GameModule
    • addSideChangeListenerToPlayerRoster

      public void addSideChangeListenerToPlayerRoster(PlayerRoster.SideChangeListener l)
      Adds listener for players changing sides
      Parameters:
      l - new SideChangeListener
    • removeSideChangeListenerFromPlayerRoster

      public void removeSideChangeListenerFromPlayerRoster(PlayerRoster.SideChangeListener l)
      Removes listener for players changing sides
      Parameters:
      l - old SideChangeListener
    • getExpressionList

      public List<String> getExpressionList()
      Description copied from class: AbstractConfigurable
      Specified by:
      getExpressionList in interface SearchTarget
      Overrides:
      getExpressionList in class AbstractConfigurable
      Returns:
      a list of the Configurables string/expression fields if any (for search)