base class for IUndoRedoAction that adds or removes a building from the map
|
|
| UndoRedoActionBuildingBase (IBuilding building) |
| |
| override IEnumerable< Vector2Int > | GetPoints () |
| | determines and returns the map points affected by this action
used, for example, to spawn particles at these points
|
| |
| override string | SaveData () |
| | serializes the objects state(usually to json) and returns it
|
| |
| override void | LoadData (string json) |
| | deserializes the serialized json data and loads the data as its new state
|
| |
| void | Undo () |
| | undoes the action
|
| |
| void | Redo () |
| | redoes the action after it has been undone
|
| |
| string | SaveData () |
| | serializes the objects state(usually to json) and returns it
|
| |
| void | LoadData (string json) |
| | deserializes the serialized json data and loads the data as its new state
|
| |
|
|
void | add () |
| |
|
void | remove () |
| |
|
|
IBuilding | Building [get] |
| |
| string | Name [get] |
| | name of the action to be displayed in the ui(tooltip)
|
| |
| virtual bool | CanUndo [get] |
| | whether the action is currently valid to be undone
for example building a hut cannot be undone if that hut has since been destroyed
|
| |
| virtual bool | CanRedo [get] |
| | whether the action is currently valid to be redone
|
| |
◆ GetPoints()
| override IEnumerable< Vector2Int > CityBuilderCore.UndoRedoActionBuildingBase.GetPoints |
( |
| ) |
|
|
inlinevirtual |
determines and returns the map points affected by this action
used, for example, to spawn particles at these points
- Returns
- points affected by the action
Reimplemented from CityBuilderCore.UndoRedoActionBase.
◆ LoadData()
| override void CityBuilderCore.UndoRedoActionBuildingBase.LoadData |
( |
string | json | ) |
|
|
inline |
◆ SaveData()
| override string CityBuilderCore.UndoRedoActionBuildingBase.SaveData |
( |
| ) |
|
|
inline |
serializes the objects state(usually to json) and returns it
- Returns
- serialized save data
Implements CityBuilderCore.ISaveData.