A 2D Farming RPG
This is just a simple 2D farming RPG game
Loading...
Searching...
No Matches
GridPropertiesManager Class Reference

This will get the information from serialiable object and populate these class Basically this will store the data in runtime. More...

Inheritance diagram for GridPropertiesManager:
Inheritance graph
Collaboration diagram for GridPropertiesManager:
Collaboration graph

Public Member Functions

GridPropertyDetails GetGridPropertyDetails (int gridX, int gridY, Dictionary< string, GridPropertyDetails > gridPropertyDictionary)
 Return thr grid property details at the gridLocation for the supplied dictionary, or null if not found. More...
 
GridPropertyDetails GetGridPropertyDetails (int gridX, int gridY)
 Get the grid property details for the tile at (gridX, gridY). If no grid property details exist null is returned and can assume that all grid property details values are null or false More...
 
void ISaveableDeregister ()
 Remove the iSaveableObjectList More...
 
void ISaveableRegister ()
 Add the iSaveableObjectList More...
 
void ISaveableRestoreScene (string sceneName)
 Restore the previous scene when we revist to that scene. Scenario: We moved scene A to scene B. In this case, we saved current condition of scene A. Then we again move scene B to scene A. Now, we need to restore the scene A as it was before we moved away. More...
 
void ISaveableStoreScene (string sceneName)
 Saves the grid property dictionary for the current scene. This gets called when we moving scene A to scene B. In this case, we need to save current condition of the scene A, and load the scene B. This function does that. More...
 
void SetGridPropertyDetails (int gridX, int gridY, GridPropertyDetails gridPropertyDetails)
 Set the grid property details to gridPropertyDetails for the tile at (gridX, gridY) for current scene. More...
 
void SetGridPropertyDetails (int gridX, int gridY, GridPropertyDetails gridPropertyDetails, Dictionary< string, GridPropertyDetails > gridPropertyDictionary)
 Set the grid property details to gridPropertyDetails for the tile at (gridX, gridY) for the gridPropertyDictionary. More...
 
void ISaveableRegister ()
 
void ISaveableDeregister ()
 
void ISaveableStoreScene (string sceneName)
 
void ISaveableRestoreScene (string sceneName)
 

Data Fields

Grid m_Grid
 

Protected Member Functions

override void Awake ()
 
virtual void Awake ()
 

Properties

string ISaveableUniqueID [get, set]
 
GameObjectSave GameObjectSave [get, set]
 
- Properties inherited from SingletonMonobehaviour< GridPropertiesManager >
static T Instance [get]
 
- Properties inherited from ISaveable
string ISaveableUniqueID [get, set]
 
GameObjectSave GameObjectSave [get, set]
 

Private Member Functions

void OnEnable ()
 Call ISaveableRegister to add the iSaveableObjectList Subscribe to after scene loaded event. More...
 
void OnDisable ()
 Call ISaveableDeregister to remove the iSaveableObjectList Unsubscribe from after scene loaded event. More...
 
void Start ()
 Call InitialiseGridProperties() More...
 
void InitialiseGridProperties ()
 This initialises the grid property dictionary with the values from the SO_GridProperties assets and stores the values for each scene in GamaObjectSave sceneData. More...
 
void AfterSceneLoaded ()
 Get the Grid. More...
 

Private Attributes

Dictionary< string, GridPropertyDetailsm_GridPropertyDictionary
 
SO_GridProperties[] m_SOGridPropertiesArray = null
 
string m_ISaveableUniqueID
 
GameObjectSave m_GameObjectSave
 

Detailed Description

This will get the information from serialiable object and populate these class Basically this will store the data in runtime.

Definition at line 9 of file GridPropertiesManager.cs.

Member Function Documentation

◆ AfterSceneLoaded()

void GridPropertiesManager.AfterSceneLoaded ( )
inlineprivate

Get the Grid.

Definition at line 134 of file GridPropertiesManager.cs.

Here is the caller graph for this function:

◆ Awake()

override void GridPropertiesManager.Awake ( )
inlineprotectedvirtual

Reimplemented from SingletonMonobehaviour< GridPropertiesManager >.

Definition at line 26 of file GridPropertiesManager.cs.

◆ GetGridPropertyDetails() [1/2]

GridPropertyDetails GridPropertiesManager.GetGridPropertyDetails ( int  gridX,
int  gridY 
)
inline

Get the grid property details for the tile at (gridX, gridY). If no grid property details exist null is returned and can assume that all grid property details values are null or false

Returns

Definition at line 171 of file GridPropertiesManager.cs.

Here is the call graph for this function:

◆ GetGridPropertyDetails() [2/2]

GridPropertyDetails GridPropertiesManager.GetGridPropertyDetails ( int  gridX,
int  gridY,
Dictionary< string, GridPropertyDetails gridPropertyDictionary 
)
inline

Return thr grid property details at the gridLocation for the supplied dictionary, or null if not found.

Parameters
gridX
gridY
gridPropertyDictionary
Returns

Definition at line 146 of file GridPropertiesManager.cs.

Here is the caller graph for this function:

◆ InitialiseGridProperties()

void GridPropertiesManager.InitialiseGridProperties ( )
inlineprivate

This initialises the grid property dictionary with the values from the SO_GridProperties assets and stores the values for each scene in GamaObjectSave sceneData.

Definition at line 65 of file GridPropertiesManager.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ISaveableDeregister()

void GridPropertiesManager.ISaveableDeregister ( )
inline

Remove the iSaveableObjectList

Implements ISaveable.

Definition at line 179 of file GridPropertiesManager.cs.

Here is the caller graph for this function:

◆ ISaveableRegister()

void GridPropertiesManager.ISaveableRegister ( )
inline

Add the iSaveableObjectList

Implements ISaveable.

Definition at line 187 of file GridPropertiesManager.cs.

Here is the caller graph for this function:

◆ ISaveableRestoreScene()

void GridPropertiesManager.ISaveableRestoreScene ( string  sceneName)
inline

Restore the previous scene when we revist to that scene. Scenario: We moved scene A to scene B. In this case, we saved current condition of scene A. Then we again move scene B to scene A. Now, we need to restore the scene A as it was before we moved away.

Implements ISaveable.

Definition at line 197 of file GridPropertiesManager.cs.

◆ ISaveableStoreScene()

void GridPropertiesManager.ISaveableStoreScene ( string  sceneName)
inline

Saves the grid property dictionary for the current scene. This gets called when we moving scene A to scene B. In this case, we need to save current condition of the scene A, and load the scene B. This function does that.

Implements ISaveable.

Definition at line 216 of file GridPropertiesManager.cs.

◆ OnDisable()

void GridPropertiesManager.OnDisable ( )
inlineprivate

Call ISaveableDeregister to remove the iSaveableObjectList Unsubscribe from after scene loaded event.

Definition at line 47 of file GridPropertiesManager.cs.

Here is the call graph for this function:

◆ OnEnable()

void GridPropertiesManager.OnEnable ( )
inlineprivate

Call ISaveableRegister to add the iSaveableObjectList Subscribe to after scene loaded event.

Definition at line 37 of file GridPropertiesManager.cs.

Here is the call graph for this function:

◆ SetGridPropertyDetails() [1/2]

void GridPropertiesManager.SetGridPropertyDetails ( int  gridX,
int  gridY,
GridPropertyDetails  gridPropertyDetails 
)
inline

Set the grid property details to gridPropertyDetails for the tile at (gridX, gridY) for current scene.

Definition at line 234 of file GridPropertiesManager.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetGridPropertyDetails() [2/2]

void GridPropertiesManager.SetGridPropertyDetails ( int  gridX,
int  gridY,
GridPropertyDetails  gridPropertyDetails,
Dictionary< string, GridPropertyDetails gridPropertyDictionary 
)
inline

Set the grid property details to gridPropertyDetails for the tile at (gridX, gridY) for the gridPropertyDictionary.

Parameters
gridX
gridY
gridPropertyDetails
gridPropertyDictionary

Definition at line 246 of file GridPropertiesManager.cs.

◆ Start()

void GridPropertiesManager.Start ( )
inlineprivate

Call InitialiseGridProperties()

Definition at line 56 of file GridPropertiesManager.cs.

Here is the call graph for this function:

Field Documentation

◆ m_GameObjectSave

GameObjectSave GridPropertiesManager.m_GameObjectSave
private

Definition at line 19 of file GridPropertiesManager.cs.

◆ m_Grid

Grid GridPropertiesManager.m_Grid

Definition at line 11 of file GridPropertiesManager.cs.

◆ m_GridPropertyDictionary

Dictionary<string, GridPropertyDetails> GridPropertiesManager.m_GridPropertyDictionary
private

Definition at line 12 of file GridPropertiesManager.cs.

◆ m_ISaveableUniqueID

string GridPropertiesManager.m_ISaveableUniqueID
private

Definition at line 15 of file GridPropertiesManager.cs.

◆ m_SOGridPropertiesArray

SO_GridProperties [] GridPropertiesManager.m_SOGridPropertiesArray = null
private

Definition at line 13 of file GridPropertiesManager.cs.

Property Documentation

◆ GameObjectSave

GameObjectSave GridPropertiesManager.GameObjectSave
getset

Implements ISaveable.

Definition at line 21 of file GridPropertiesManager.cs.

◆ ISaveableUniqueID

string GridPropertiesManager.ISaveableUniqueID
getset

Implements ISaveable.

Definition at line 17 of file GridPropertiesManager.cs.


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