Package VASSAL.build.module
Class EventLog
java.lang.Object
VASSAL.build.AbstractBuildable
VASSAL.build.module.EventLog
- All Implemented Interfaces:
Buildable,GameComponent,PropertyNameSource,CommandEncoder,ValidityChecker
public class EventLog extends AbstractBuildable implements CommandEncoder, GameComponent
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classEventLog.Eventstatic classEventLog.StoreEvents -
Field Summary
Fields Modifier and Type Field Description static StringEVENT_LISTFields inherited from class VASSAL.build.AbstractBuildable
buildComponents, validator -
Constructor Summary
Constructors Constructor Description EventLog() -
Method Summary
Modifier and Type Method Description voidaddTo(Buildable b)Adds this component to its parent.voidclearSaved()Commanddecode(String s)Translate a String into aCommandstatic Iterable<EventLog.Event>decodedEvents(String s)Decodes aStringinto a sequence ofEvents.static Enumeration<EventLog.Event>decodeEvents(String s)Deprecated, for removal: This API element is subject to removal in a future version.Stringencode(Command c)Translate aCommandinto a Stringstatic StringencodedEvents(Iterable<EventLog.Event> events)Encodes a sequence ofEvents into aString.static StringencodeEvents(Enumeration<?> e)Deprecated, for removal: This API element is subject to removal in a future version.UseencodedEvents(Iterable)instead.String[]getAttributeNames()Lists all the buildFile (XML) attribute names for this component.StringgetAttributeValueString(String name)CommandgetRestoreCommand()When saving a game, each GameComponent should return aCommandthat, when executed, restores the GameComponent to its state when the game was saved If this component has no persistent state, return nullvoidlog(EventLog.Event e)voidsetAttribute(String name, Object value)Sets a buildFile (XML) attribute value for this component.voidsetup(boolean starting)Notify the GameComponent that a game has started/endedvoidstore(EventLog.Event e)Methods inherited from class VASSAL.build.AbstractBuildable
add, build, getAllDescendantComponents, getAllDescendantComponentsOf, getBuildables, getBuildComponents, getBuildElement, getComponents, getComponentsOf, getPropertyNames, validate
-
Field Details
-
EVENT_LIST
- See Also:
- Constant Field Values
-
-
Constructor Details
-
EventLog
public EventLog()
-
-
Method Details
-
addTo
Description copied from interface:BuildableAdds this component to its parent. In order to make Buildable objects extensible, the child is reponsible for adding itself to the parent. That way, Buildable subcomponents can be defined in an extension package without needing to modify the containing class. -
clearSaved
public void clearSaved() -
store
-
log
-
decode
Description copied from interface:CommandEncoderTranslate a String into aCommand- Specified by:
decodein interfaceCommandEncoder
-
encode
Description copied from interface:CommandEncoderTranslate aCommandinto a String- Specified by:
encodein interfaceCommandEncoder
-
setup
public void setup(boolean starting)Description copied from interface:GameComponentNotify the GameComponent that a game has started/ended- Specified by:
setupin interfaceGameComponent- Parameters:
starting- if true, a game is starting. If false, then a game is ending
-
getRestoreCommand
Description copied from interface:GameComponentWhen saving a game, each GameComponent should return aCommandthat, when executed, restores the GameComponent to its state when the game was saved If this component has no persistent state, return null- Specified by:
getRestoreCommandin interfaceGameComponent
-
decodedEvents
Decodes aStringinto a sequence ofEvents.- Parameters:
s- the event string- Returns:
- the events represented by the string
-
decodeEvents
@Deprecated(since="2020-08-06", forRemoval=true) public static Enumeration<EventLog.Event> decodeEvents(String s)Deprecated, for removal: This API element is subject to removal in a future version.UsedecodedEvents(String)instead. -
encodedEvents
Encodes a sequence ofEvents into aString.- Parameters:
events- the sequence of events- Returns:
- the string representing the events
-
encodeEvents
@Deprecated(since="2020-08-06", forRemoval=true) public static String encodeEvents(Enumeration<?> e)Deprecated, for removal: This API element is subject to removal in a future version.UseencodedEvents(Iterable)instead. -
getAttributeNames
Description copied from class:AbstractBuildableLists all the buildFile (XML) attribute names for this component. If this component is ALSO anAbstractConfigurable, then this list of attributes determines the appropriate attribute order forAbstractConfigurable.getAttributeDescriptions()andAbstractConfigurable.getAttributeTypes().- Specified by:
getAttributeNamesin classAbstractBuildable- Returns:
- a list of all buildFile (XML) attribute names for this component
-
setAttribute
Description copied from class:AbstractBuildableSets a buildFile (XML) attribute value for this component. Thekeyparameter will be one of those listed inAbstractBuildable.getAttributeNames(). If thevalueparameter is a String, it will be the value returned byAbstractBuildable.getAttributeValueString(java.lang.String)for the samekey. If the implementing class extendsAbstractConfigurable, thenvaluewill be an instance of the corresponding Class listed inAbstractConfigurable.getAttributeTypes()- Specified by:
setAttributein classAbstractBuildable- Parameters:
name- the name of the attribute. Will be one of those listed inAbstractBuildable.getAttributeNames()value- If thevalueparameter is a String, it will be the value returned byAbstractBuildable.getAttributeValueString(java.lang.String)for the samekey. If the implementing class extendsAbstractConfigurable, thenvaluecan also be an instance of the corresponding Class listed inAbstractConfigurable.getAttributeTypes()
-
getAttributeValueString
- Specified by:
getAttributeValueStringin classAbstractBuildable- Parameters:
name- the name of the attribute. Will be one of those listed inAbstractBuildable.getAttributeNames()- Returns:
- a String representation of the attribute with the given name. When initializing a module, this String value will be passed to
AbstractBuildable.setAttribute(java.lang.String, java.lang.Object).
-
decodedEvents(String)instead.