FrameIT
Stage Class Reference
Inheritance diagram for Stage:
IJSONsavable< Stage >

Classes

class  PlayerRecord
 Represents a save slot. More...
 
class  SaveGame
 

Public Member Functions

 Stage ()
 Initiates all parameterless members.
Used by JsonConverter to initate empty class.

See also
InitOOP
More...
 
 Stage (string category, int number, string name, string description, string scene, bool local=true)
 Standard Constructor.
Initiates all members.

See also
InitOOP, InitFields(string, int, string, string, string, bool)
More...
 
void InitFields (string category, int number, string name, string description, string scene, bool local)
 Sets members which are primitives. More...
 
void ClearAll ()
 Resets to factory condition. ClearSolution ClearPlay ClearALLRecords More...
 
void ClearSolution ()
 Resets solution and calling solution.hardreset(bool).

See also
FactRecorder.hardreset(bool)
More...
 
void ClearPlay ()
 Resets current player_record and calling player_record.factState.hardreset(bool).

See also
FactRecorder.hardreset(bool)
More...
 
void ClearALLRecords ()
 Resets and deletes all members of player_record_list.

See also
PlayerRecord.delete(List<Directories>)
More...
 
void deletet_record (PlayerRecord record, bool b_store=true)
 Deletes record and calls PlayerRecord.factState.hardreset().

See also
PlayerRecord.delete(List<Directories>), FactRecorder.hardreset(bool)
More...
 
bool set_record (string record_index)
 Clones record to player_record iff found in player_record_list
or initiates new player_record iff record ==null. More...
 
void push_record (double seconds_s=-1, bool force_push=false)
 Adds current player_record to player_record_list incrementing PlayerRecord.seconds beforehand. More...
 
void SetMode (bool create)
 Switches between player_record.factState (false) and solution (true) to display in GameWorld. More...
 
void delete ()
 Clears and deletes all files associated with this Stage. More...
 
void store (bool reset_player=false, bool force_stage_file=false)
 Stores and overwrites this Stage, player_record, every element in player_record_list and solution (no overwrite for latter if empty). More...
 
void ResetPlay ()
 Calls ClearPlay and store(true). More...
 
void ResetSaves ()
 Calls ClearPlay, ClearALLRecords and store(true). More...
 
bool CheckSolved ()
 Checks if current player_record is solved.
Iff return value true: More...
 
- Public Member Functions inherited from IJSONsavable< Stage >
virtual string _IJGetName (string name)
 
virtual List< Directories > _IJGetHierarchie (List< Directories > hierarchie_base)
 
virtual bool _IJGetRawObject (out T payload, string path)
 
virtual T _IJPreProcess (T payload)
 
virtual T _IJPostProcess (T payload)
 
bool store (List< Directories > hierarchie, string name, bool use_install_folder=false, bool overwrite=true, bool deep_store=true)
 
bool store_children (List< Directories > hierarchie, string name, bool use_install_folder=false, bool overwrite=true, bool deep_store=true)
 

Static Public Member Functions

static bool ShallowLoad (out Stage set, string path)
 Reads File given by path and writes its contents into set . More...
 
- Static Public Member Functions inherited from IJSONsavable< Stage >
static bool store (List< Directories > hierarchie, string name, T payload, bool use_install_folder=false, bool overwrite=true, bool deep_store=true)
 
static bool store_children (List< Directories > hierarchie, string name, T payload, bool use_install_folder=false, bool overwrite=true, bool deep_store=true)
 
static bool load_children (List< Directories > hierarchie, string name, ref T raw_payload, bool use_install_folder=false, bool deep_load=true, bool post_process=true)
 
static bool load (List< Directories > hierarchie, string name, out T payload, bool use_install_folder=false, bool deep_load=true, bool post_process=true)
 
static T postprocess (T payload)
 
static T preprocess (T payload)
 
static void delete_children (List< Directories > hierarchie, string name, bool use_install_folder=false, int skip_last_children=0)
 
static bool delete (List< Directories > hierarchie, string name, bool use_install_folder=false)
 

Public Attributes

string category = null
 Which category this Stage should be displayed in. More...
 
int number = -1
 Where to display this Stage within a category relative to others. More...
 
string description = null
 The description this Stage will be displayed with. More...
 
string scene = null
 The name of a UnityEngine.SceneManagement.Scene that this Stage takes place in. More...
 
bool use_install_folder = false
 Wether this Stage is located in installation folder or user data (a.k.a. !local). More...
 
SolutionRecorder solution = null
 Defining when this Stage.player_record is considered as solved.

See also
FactRecorder.DynamiclySolved(SolutionRecorder, out List<List<string>>, out List<List<string>>)
More...
 
SaveGame savegame = null
 A single class containing all savegame-data. Stored seperately. More...
 
List< PlayerRecordsolution_approches = new()
 
List< string > AllowedScrolls = null
 
List< GadgetAllowedGadgets = null
 
bool creatorMode = false
 Wether player_record.factState (false) or solution (true) is exposed and drawn. More...
 

Properties

string name = null [getset]
 The name this Stage will be displayed with. Also defines names of save files of stage progress, solution More...
 
string path = null [getset]
 
bool completed_once [get]
 true iff there is at least one element in player_record_list where PlayerRecord.solved == true. More...
 
PlayerRecord player_record [getset]
 Current Stage progress. More...
 
Dictionary< string, PlayerRecord >? player_record_list [getset]
 A list containing all saved player progress.
More...
 
FactRecorder factState [getset]
 A wrapper returning (or setting) player_record.factState.
When player_record == null: More...
 
string record_name [get]
 Returns a name for player_record.name which needs to be uniquified once put into player_record_list (e.g. by push_record(double, bool) adding '_i'). More...
 
- Properties inherited from IJSONsavable< Stage >
string name [getset]
 
string path [getset]
 

Private Member Functions

void InitOOP ()
 Initiates members which are non primitives. More...
 

Static Private Member Functions

static Stage ()
 

Private Attributes

string record_index
 
FactRecorder hiddenState
 Tempory variable storing factState when creatorMode == true. More...
 

Additional Inherited Members

- Static Public Attributes inherited from IJSONsavable< Stage >
static readonly IJSONsavable< T > Instance
 
static readonly FieldInfo[] JsonSaveableFields
 
static readonly FieldInfo[] JsonAutoPreProcessFields
 
static readonly FieldInfo[] JsonAutoPostProcessFields
 
static readonly FieldInfo[] JsonSeperateFields
 
- Static Protected Attributes inherited from IJSONsavable< Stage >
static List< Directories > hierarchie
 

Constructor & Destructor Documentation

◆ Stage() [1/3]

static Stage.Stage ( )
staticprivate

◆ Stage() [2/3]

Stage.Stage ( )

Initiates all parameterless members.
Used by JsonConverter to initate empty class.

See also
InitOOP

◆ Stage() [3/3]

Stage.Stage ( string  category,
int  number,
string  name,
string  description,
string  scene,
bool  local = true 
)

Standard Constructor.
Initiates all members.

See also
InitOOP, InitFields(string, int, string, string, string, bool)

Parameters
categorysets category
numbersets number
namesets name
descriptionsets description
scenesets scene
localsets !use_install_folder

Member Function Documentation

◆ CheckSolved()

bool Stage.CheckSolved ( )

Checks if current player_record is solved.
Iff return value true:

Returns
true iff current player_record is solved.
See also
FactRecorder.DynamiclySolved(SolutionRecorder, out List<List<string>>, out List<List<string>>)

◆ ClearAll()

void Stage.ClearAll ( )

Resets to factory condition. ClearSolution ClearPlay ClearALLRecords

◆ ClearALLRecords()

void Stage.ClearALLRecords ( )

Resets and deletes all members of player_record_list.

See also
PlayerRecord.delete(List<Directories>)

◆ ClearPlay()

void Stage.ClearPlay ( )

Resets current player_record and calling player_record.factState.hardreset(bool).

See also
FactRecorder.hardreset(bool)

◆ ClearSolution()

void Stage.ClearSolution ( )

Resets solution and calling solution.hardreset(bool).

See also
FactRecorder.hardreset(bool)

◆ delete()

void Stage.delete ( )

Clears and deletes all files associated with this Stage.

Parameters
player_record_list_tooiff set false, all files regarding player_record_list will be spared.

◆ deletet_record()

void Stage.deletet_record ( PlayerRecord  record,
bool  b_store = true 
)

Deletes record and calls PlayerRecord.factState.hardreset().

See also
PlayerRecord.delete(List<Directories>), FactRecorder.hardreset(bool)

Parameters
recordto be deleted
b_storeiff true stores changes made to this Stage

◆ InitFields()

void Stage.InitFields ( string  category,
int  number,
string  name,
string  description,
string  scene,
bool  local 
)

Sets members which are primitives.

Parameters
categorysets category
numbersets number
namesets name
descriptionsets description
scenesets scene
localsets !use_install_folder

◆ InitOOP()

void Stage.InitOOP ( )
private

Initiates members which are non primitives.

◆ push_record()

void Stage.push_record ( double  seconds_s = -1,
bool  force_push = false 
)

Adds current player_record to player_record_list incrementing PlayerRecord.seconds beforehand.

IMPACTS SERVER PERFORMANCE: Increases number of Facts at the Server for every Fact in current player_record

Parameters
seconds_stime in seconds to be added to player_record.seconds before pushing.
Iff set to -1 Time.timeSinceLevelLoadAsDouble will be used.
force_pushiff set true && StageStatic.mode == StageStatic.Mode.Create && creatorMode
current displayed solution in factState will be pushed into player_record_list

◆ ResetPlay()

void Stage.ResetPlay ( )

Calls ClearPlay and store(true).

◆ ResetSaves()

void Stage.ResetSaves ( )

◆ set_record()

bool Stage.set_record ( string  record_index)

Clones record to player_record iff found in player_record_list
or initiates new player_record iff record ==null.

Parameters
recordto be set or null
Returns
false iff record not found in player_record_list
or PlayerRecord.load(List<Directories>) fails.

◆ SetMode()

void Stage.SetMode ( bool  create)

Switches between player_record.factState (false) and solution (true) to display in GameWorld.

Parameters
createsets creatorMode

◆ ShallowLoad()

static bool Stage.ShallowLoad ( out Stage  set,
string  path 
)
static

Reads File given by path and writes its contents into set .

Will not read members decorated with JsonIgnoreAttribute: solution, player_record.

Parameters
setto be written in
pathfile location
Returns
true iff succeeded

◆ store()

void Stage.store ( bool  reset_player = false,
bool  force_stage_file = false 
)

Stores and overwrites this Stage, player_record, every element in player_record_list and solution (no overwrite for latter if empty).

Parameters
reset_playerwether to clear current player_record

Member Data Documentation

◆ AllowedGadgets

List<Gadget> Stage.AllowedGadgets = null

◆ AllowedScrolls

List<string> Stage.AllowedScrolls = null

◆ category

string Stage.category = null

Which category this Stage should be displayed in.

◆ creatorMode

bool Stage.creatorMode = false

Wether player_record.factState (false) or solution (true) is exposed and drawn.

◆ description

string Stage.description = null

The description this Stage will be displayed with.

◆ hiddenState

FactRecorder Stage.hiddenState
private

Tempory variable storing factState when creatorMode == true.

◆ number

int Stage.number = -1

Where to display this Stage within a category relative to others.

◆ record_index

string Stage.record_index
private

◆ savegame

SaveGame Stage.savegame = null

A single class containing all savegame-data. Stored seperately.

◆ scene

string Stage.scene = null

The name of a UnityEngine.SceneManagement.Scene that this Stage takes place in.

◆ solution

◆ solution_approches

List<PlayerRecord> Stage.solution_approches = new()

◆ use_install_folder

bool Stage.use_install_folder = false

Wether this Stage is located in installation folder or user data (a.k.a. !local).

Property Documentation

◆ completed_once

bool Stage.completed_once
get

true iff there is at least one element in player_record_list where PlayerRecord.solved == true.

◆ factState

FactRecorder Stage.factState
getset

A wrapper returning (or setting) player_record.factState.
When player_record == null:

◆ name

string Stage.name = null
getset

The name this Stage will be displayed with. Also defines names of save files of stage progress, solution

◆ path

string Stage.path = null
getset

◆ player_record

PlayerRecord Stage.player_record
getset

Current Stage progress.

◆ player_record_list

Dictionary<string, PlayerRecord>? Stage.player_record_list
getset

A list containing all saved player progress.

◆ record_name

string Stage.record_name
getprivate

Returns a name for player_record.name which needs to be uniquified once put into player_record_list (e.g. by push_record(double, bool) adding '_i').


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