BGC Tools
Public Member Functions | Data Fields
BGC.Users.DefaultData Class Reference

Class to handle the default playerdata that is used when a player isn't logged in. More...

Inheritance diagram for BGC.Users.DefaultData:
Inheritance graph
[legend]
Collaboration diagram for BGC.Users.DefaultData:
Collaboration graph
[legend]

Public Member Functions

 DefaultData ()
 
override void DeletePlayerData ()
 
- Public Member Functions inherited from BGC.Users.ProfileData
 ProfileData (string userName)
 
virtual void Clear ()
 Clear all values and keys More...
 
void SetInt (string key, int value)
 Set value at indicated key More...
 
void SetBool (string key, bool value)
 Set value at indicated key More...
 
void SetString (string key, string value)
 Set value at indicated key More...
 
void SetFloat (string key, float value)
 Set value at indicated key More...
 
void SetDouble (string key, double value)
 Set value at indicated key More...
 
void SetJsonValue (string key, JsonValue value)
 Set value at indicated key More...
 
void SetJsonArray (string key, JsonArray value)
 Set value at indicated key More...
 
int GetInt (string key, int defaultReturn=0)
 Get value associated with indicated key More...
 
bool GetBool (string key, bool defaultReturn=false)
 Get value associated with indicated key More...
 
float GetFloat (string key, float defaultReturn=0f)
 Get value associated with indicated key More...
 
double GetDouble (string key, double defaultReturn=0.0)
 Get value associated with indicated key More...
 
string GetString (string key, string defaultReturn="")
 Get value associated with indicated key More...
 
JsonValue GetJsonValue (string key, JsonValue defaultReturn=default(JsonValue))
 Get value associated with indicated key More...
 
JsonArray GetJsonArray (string key, JsonArray defaultReturn=default(JsonArray))
 Get value associated with indicated key More...
 
bool HasKey (string key)
 Get if any value is associated with indicated key More...
 
void RemoveKey (string key)
 Remove any value is associated with indicated key More...
 
void Serialize ()
 Save contents to file More...
 
bool Deserialize ()
 Load user contents from file More...
 

Data Fields

override bool IsDefault => true
 

Additional Inherited Members

- Protected Attributes inherited from BGC.Users.ProfileData
string PlayerFilePath
 Path of the user datafile More...
 
- Properties inherited from BGC.Users.ProfileData
string UserName [get]
 
abstract bool IsDefault [get]
 Is this an instance of default data? More...
 

Detailed Description

Class to handle the default playerdata that is used when a player isn't logged in.

Definition at line 9 of file DefaultData.cs.

Constructor & Destructor Documentation

◆ DefaultData()

BGC.Users.DefaultData.DefaultData ( )
inline

Definition at line 13 of file DefaultData.cs.

14  : base("Default")
15  {
16  if (File.Exists(PlayerFilePath))
17  {
18  Deserialize();
19  }
20  else
21  {
22  //Create the data
23  Serialize();
24  }
25  }
void Serialize()
Save contents to file
Definition: ProfileData.cs:277
string PlayerFilePath
Path of the user datafile
Definition: ProfileData.cs:26
bool Deserialize()
Load user contents from file
Definition: ProfileData.cs:298

Member Function Documentation

◆ DeletePlayerData()

override void BGC.Users.DefaultData.DeletePlayerData ( )
inlinevirtual

Reimplemented from BGC.Users.ProfileData.

Definition at line 27 of file DefaultData.cs.

28  {
29  throw new InvalidOperationException("Cannot delete default data files.");
30  }

Field Documentation

◆ IsDefault

override bool BGC.Users.DefaultData.IsDefault => true

Definition at line 11 of file DefaultData.cs.


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