Loading...
Searching...
No Matches
CityBuilderCore.IUndoRedoAction Interface Reference

Detailed Description

represents an action that can be undone and redone using an IUndoRedoStack

Inheritance diagram for CityBuilderCore.IUndoRedoAction:
CityBuilderCore.ISaveData CityBuilderCore.UndoRedoActionBase CityBuilderCore.UndoRedoActions CityBuilderCore.RoadNetwork.UndoRedoRoadBase CityBuilderCore.StructureCollectionFloat.UndoRedoStructureCollectionFloatBase CityBuilderCore.StructureTerrainTreeVariants.UndoRedoStructureTerrainTreeVariantsBase CityBuilderCore.StructureTerrainTrees.UndoRedoStructureTerrainTreesBase CityBuilderCore.UndoRedoActionBuildingBase CityBuilderCore.UndoRedoActionStructureBase CityBuilderCore.UndoRedoGlobalItems CityBuilderCore.RoadNetwork.RoadAddition CityBuilderCore.RoadNetwork.RoadRemoval CityBuilderCore.StructureCollectionFloat.StructureCollectionFloatAddition CityBuilderCore.StructureCollectionFloat.StructureCollectionFloatRemoval CityBuilderCore.StructureTerrainTreeVariants.StructureTerrainTreeVariantsAddition CityBuilderCore.StructureTerrainTreeVariants.StructureTerrainTreeVariantsRemoval CityBuilderCore.StructureTerrainTrees.StructureTerrainTreesAddition CityBuilderCore.StructureTerrainTrees.StructureTerrainTreesRemoval CityBuilderCore.BuildingAddition CityBuilderCore.BuildingRemoval CityBuilderCore.StructureAddition CityBuilderCore.StructureRemoval

Public Member Functions

void Undo ()
 undoes the action
 
void Redo ()
 redoes the action after it has been undone
 
IEnumerable< Vector2Int > GetPoints ()
 determines and returns the map points affected by this action
used, for example, to spawn particles at these points
 
- Public Member Functions inherited from CityBuilderCore.ISaveData
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
 

Properties

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
 
bool CanRedo [get]
 whether the action is currently valid to be redone
 
string Name [get]
 name of the action to be displayed in the ui(tooltip)
 

Member Function Documentation

◆ GetPoints()

◆ Redo()

◆ Undo()

Property Documentation

◆ CanRedo

bool CityBuilderCore.IUndoRedoAction.CanRedo
get

◆ CanUndo

bool CityBuilderCore.IUndoRedoAction.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

Implemented in CityBuilderCore.BuildingAddition, CityBuilderCore.UndoRedoActionBase, CityBuilderCore.UndoRedoActions, and CityBuilderCore.UndoRedoGlobalItems.

◆ Name