DoopelPonger
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
EditorActionInformation Class Referenceabstract

Top level serialization class for creating action patterns in the Inspector. More...

Inheritance diagram for EditorActionInformation:
Inheritance graph
[legend]
Collaboration diagram for EditorActionInformation:
Collaboration graph
[legend]

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
 

Detailed Description

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 }

Member Function Documentation

◆ ConvertChildPropertiesToStrings()

abstract List<string> EditorActionInformation.ConvertChildPropertiesToStrings ( )
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.

Returns
Each property of the child class that should be serialized.

Implemented in EditorAttackInformation, and EditorMovementInformation.

◆ ConvertPropertiesToStrings()

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.

Returns
Every property that should be serialized.

◆ FillChildPropertiesFromString()

abstract void EditorActionInformation.FillChildPropertiesFromString ( string  objectString)
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.

Parameters
Theserialized string of all the properties in this object.

Implemented in EditorLinearMovementInformation, EditorSmoothStepMovementInformation, EditorPositionRotationChangeMovementInformation, EditorAttackInformation, and EditorAlphaChangeMovementInformation.

◆ FillPropertiesFromString()

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 ,.

Parameters
objectStringThe serialized string of all the properties in this object.

◆ ToCoopActionInformation()

abstract CoopActionInformation EditorActionInformation.ToCoopActionInformation ( )
pure virtual

Convert this object from the Inspector information into the data that is used during gameplay.

Returns
An implementation of the CoopActionInformation that best fits this action information.

Implemented in EditorBadBallAttackInformation, EditorLaserAttackInformation, EditorBallSplitterAttackInformation, EditorLinearMovementInformation, EditorSmoothStepMovementInformation, EditorShotgunAttackInformation, EditorPositionRotationChangeMovementInformation, and EditorAlphaChangeMovementInformation.

Member Data Documentation

◆ actionType

CoopActionInformation.ActionType EditorActionInformation.actionType
protected

The action this information belongs to. This value should be assigned by the child class in the FillChildPropertiesFromString method.

◆ delayBetweenActions

Range EditorActionInformation.delayBetweenActions

How long of a delay after finishing the action before continuing on to the next action.

◆ m_gameObject

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 :(


The documentation for this class was generated from the following file: