DoopelPonger
|
Top level serialization class for creating action patterns in the Inspector. More...
Public Member Functions | |
List< string > | ConvertPropertiesToStrings () |
Convert each property into a string. Each element of the list should be a single property in the json like structure of <property name>:<value> with no comma or curly brackets. More... | |
void | FillPropertiesFromString (string objectString) |
Convert a string with all properties into this object. The parameter objectString is generated from calling the ConvertPropertiesToString method, and has each element of the array concatenated with a ,. More... | |
abstract CoopActionInformation | ToCoopActionInformation () |
Convert this object from the Inspector information into the data that is used during gameplay. More... | |
Public Attributes | |
GameObject | m_gameObject |
Range | delayBetweenActions |
Protected Member Functions | |
abstract List< string > | ConvertChildPropertiesToStrings () |
Convert all properties of the implementation class that should be serialized to a string. See the method ConvertPropertiesToString for more information. That method is the public method that calls this method when serializing. More... | |
abstract void | FillChildPropertiesFromString (string objectString) |
Construct the child class based on the string that was serialized. See the method FillPropertiesFromString for more information. That method is the public method that calls this method when serializing. More... | |
Protected Attributes | |
CoopActionInformation.ActionType | actionType |
Top level serialization class for creating action patterns in the Inspector.
The EditorActionInformation is the data that shows up in the inspector and the data that gets written to the save files. The file format for saving is a jank version of json. It is similar to json in that it uses a key value pair with brackets, but does not allow for the value to be another json object. Instead all sub-objects use () instead of {}. This makes deserialization easier since it does not need to keep track of how many levels of brackets the object is in.
A simple example of the serialization will look like: { delayBetweenActions: (min: 0, max: 20), actionType: MOVEMENT }
|
protectedpure virtual |
Convert all properties of the implementation class that should be serialized to a string. See the method ConvertPropertiesToString for more information. That method is the public method that calls this method when serializing.
Implemented in EditorAttackInformation, and EditorMovementInformation.
List<string> EditorActionInformation.ConvertPropertiesToStrings | ( | ) |
Convert each property into a string. Each element of the list should be a single property in the json like structure of <property name>:<value> with no comma or curly brackets.
|
protectedpure virtual |
Construct the child class based on the string that was serialized. See the method FillPropertiesFromString for more information. That method is the public method that calls this method when serializing.
The | serialized string of all the properties in this object. |
Implemented in EditorLinearMovementInformation, EditorSmoothStepMovementInformation, EditorPositionRotationChangeMovementInformation, EditorAttackInformation, and EditorAlphaChangeMovementInformation.
void EditorActionInformation.FillPropertiesFromString | ( | string | objectString | ) |
Convert a string with all properties into this object. The parameter objectString is generated from calling the ConvertPropertiesToString method, and has each element of the array concatenated with a ,.
objectString | The serialized string of all the properties in this object. |
|
pure virtual |
Convert this object from the Inspector information into the data that is used during gameplay.
Implemented in EditorBadBallAttackInformation, EditorLaserAttackInformation, EditorBallSplitterAttackInformation, EditorLinearMovementInformation, EditorSmoothStepMovementInformation, EditorShotgunAttackInformation, EditorPositionRotationChangeMovementInformation, and EditorAlphaChangeMovementInformation.
|
protected |
The action this information belongs to. This value should be assigned by the child class in the FillChildPropertiesFromString method.
Range EditorActionInformation.delayBetweenActions |
How long of a delay after finishing the action before continuing on to the next action.
GameObject EditorActionInformation.m_gameObject |
This property has the m_ prefix because I do not want it to show in the custom inspector. This is a dumb way to do it, but I've given up on finding a better way to do it :(