TopDown Engine  v3.6
MoreMountains.Tools.MMPersistentBase Class Reference

A base class implementing the IMMPersistent interface, designed to be extended This mostly takes care of the GUID generation and validation More...

Inheritance diagram for MoreMountains.Tools.MMPersistentBase:
MoreMountains.Tools.IMMPersistent MoreMountains.Tools.MMPersistent

Public Member Functions

virtual string GetGuid ()
 Returns the object's GUID More...
 
virtual void SetGuid (string newGUID)
 Lets you set the object's GUID More...
 
virtual string OnSave ()
 On save, does nothing, meant to be extended More...
 
virtual void OnLoad (string data)
 On load, does nothing, meant to be extended More...
 
virtual bool ShouldBeSaved ()
 Lets the persistence manager know whether or not the object should be saved More...
 
virtual string GenerateGuid ()
 Generates a unique ID for the object, using the scene name, the object name, and a GUID More...
 
virtual bool GuidIsUnique (string guid)
 Checks if the object's ID is unique or not More...
 
virtual void ValidateGuid ()
 Validates the object's GUID, and generates a new one if needed, until a unique one is found More...
 

Public Attributes

bool SaveActive = true
 whether or not this object should be saved More...
 
string UniqueIDSuffix
 an optional suffix to add to the GUID, to make it more readable More...
 
bool GenerateGuidButton
 a debug button used to force a new GUI generation More...
 

Protected Member Functions

virtual void OnValidate ()
 On validate, we make sure the object gets a valid GUID More...
 

Protected Attributes

string _guid
 the object's unique ID More...
 

Detailed Description

A base class implementing the IMMPersistent interface, designed to be extended This mostly takes care of the GUID generation and validation

Member Function Documentation

◆ GenerateGuid()

virtual string MoreMountains.Tools.MMPersistentBase.GenerateGuid ( )
virtual

Generates a unique ID for the object, using the scene name, the object name, and a GUID

Returns

◆ GetGuid()

virtual string MoreMountains.Tools.MMPersistentBase.GetGuid ( )
virtual

Returns the object's GUID

Returns

Implements MoreMountains.Tools.IMMPersistent.

◆ GuidIsUnique()

virtual bool MoreMountains.Tools.MMPersistentBase.GuidIsUnique ( string  guid)
virtual

Checks if the object's ID is unique or not

Parameters
guid
Returns

◆ OnLoad()

virtual void MoreMountains.Tools.MMPersistentBase.OnLoad ( string  data)
virtual

On load, does nothing, meant to be extended

Parameters
data

Implements MoreMountains.Tools.IMMPersistent.

Reimplemented in MoreMountains.Tools.MMPersistent.

◆ OnSave()

virtual string MoreMountains.Tools.MMPersistentBase.OnSave ( )
virtual

On save, does nothing, meant to be extended

Returns

Implements MoreMountains.Tools.IMMPersistent.

Reimplemented in MoreMountains.Tools.MMPersistent.

◆ OnValidate()

virtual void MoreMountains.Tools.MMPersistentBase.OnValidate ( )
protectedvirtual

On validate, we make sure the object gets a valid GUID

◆ SetGuid()

virtual void MoreMountains.Tools.MMPersistentBase.SetGuid ( string  newGUID)
virtual

Lets you set the object's GUID

Parameters
newGUID

◆ ShouldBeSaved()

virtual bool MoreMountains.Tools.MMPersistentBase.ShouldBeSaved ( )
virtual

Lets the persistence manager know whether or not the object should be saved

Returns

Implements MoreMountains.Tools.IMMPersistent.

◆ ValidateGuid()

virtual void MoreMountains.Tools.MMPersistentBase.ValidateGuid ( )
virtual

Validates the object's GUID, and generates a new one if needed, until a unique one is found

Member Data Documentation

◆ _guid

string MoreMountains.Tools.MMPersistentBase._guid
protected

the object's unique ID

◆ GenerateGuidButton

bool MoreMountains.Tools.MMPersistentBase.GenerateGuidButton

a debug button used to force a new GUI generation

◆ SaveActive

bool MoreMountains.Tools.MMPersistentBase.SaveActive = true

whether or not this object should be saved

◆ UniqueIDSuffix

string MoreMountains.Tools.MMPersistentBase.UniqueIDSuffix

an optional suffix to add to the GUID, to make it more readable


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