FrameIT
StageStatic Class Reference

Keeps track of all available and current Stage More...

Classes

struct  StageErrorStruct
 Created when an error (may) occures while a Stage is being created, because of incompatible variables. More...
 

Public Types

enum  Mode { Play , Create }
 Available Modes a Stage to be selected and/ or loaded in. More...
 

Static Public Member Functions

static void SetMode (Mode mode, GameObject gameObject=null)
 sets mode and en-/ disables children of gameObject with certain Tags, only available in certain Modes (e.g. in Def_Stage) More...
 
static StageErrorStruct Validate (string category, int id, string name, string description, string scene, bool local=true)
 
static StageErrorStruct LoadNewStage (string category, int id, string name, string description, string scene)
 
static void LoadCreate ()
 Load current stage in Mode.Create More...
 
static int NextNumber (bool local, string category)
 Finds first unused Stage.number in a certain category . More...
 
static bool ContainsNumber (string category, int i, bool local)
 Looks wether an Stage.number i exists within a certain Stage.category category in local saves (local == true) or install path. More...
 
static void ShallowLoadStages ()
 Looks for and initial loads (see Stage.ShallowLoad(ref Stage, string)) Stages in local_stage and !local_stage. More...
 
static void SetStage (string name, bool local)
 Sets parameters, defining what to load in LoadInitStage(bool, GameObject) and LoadInitStage(string, bool, bool, GameObject). More...
 
static Stage GetStage (string name, bool local)
 Returns a Stage or throws Exception if not found. More...
 
static void Delete (Stage stage)
 Deletes a Stage and all its associated files (including save games).

See also
Stage.delete(bool)
More...
 
static bool LoadInitStage (string name, bool local=false, bool restore_session=true, GameObject gameObject=null)
 Wrapps LoadInitStage(bool, GameObject) with extra parameters. Loads and initiates Stage defined by name and local . More...
 
static bool LoadInitStage (bool restore_session, GameObject gameObject=null)
 Loads and initiates Stage defined by current_name and local_stage. More...
 
static bool ContainsKey (string key)
 Wrapps ContainsKey(string, bool); defaulting local to local_stage More...
 
static bool ContainsKey (string key, bool local)
 Looks for a Stage key in StageLocal (local ==true) or StageOfficial (local ==false). More...
 

Static Public Attributes

static Dictionary< string, StageStageOfficial
 
static Dictionary< string, StageStageLocal
 
static Dictionary< string, int > Category
 Used to map StageOfficial categories into a ordered list for the StageMenue. More...
 
static string current_name
 Stage.name of current stage or one to be loaded.

See also
LoadInitStage(bool, GameObject)
More...
 
static bool local_stage
 !Stage.use_install_folder of current stage or one to be loaded.

See also
LoadInitStage(bool, GameObject)
More...
 
static Mode mode
 Current Mode More...
 
static readonly List< string > Worlds = GenerateWorldList()
 Loadable world scenes More...
 

Properties

static Stage??? stage [getset]
 Current Stage More...
 
static StageErrorStruct last_error [getprivate set]
 TODO: set when encountering an error More...
 

Static Private Member Functions

static List< string > GenerateWorldList ()
 Extracts all loadable scenes for Worlds. More...
 

Detailed Description

Keeps track of all available and current Stage

Member Enumeration Documentation

◆ Mode

Available Modes a Stage to be selected and/ or loaded in.

Enumerator
Play 
Create 

Member Function Documentation

◆ ContainsKey() [1/2]

static bool StageStatic.ContainsKey ( string  key)
static

Wrapps ContainsKey(string, bool); defaulting local to local_stage

◆ ContainsKey() [2/2]

static bool StageStatic.ContainsKey ( string  key,
bool  local 
)
static

Looks for a Stage key in StageLocal (local ==true) or StageOfficial (local ==false).

Returns
(local ? StageLocal : StageOfficial).ContainsKey(key)

◆ ContainsNumber()

static bool StageStatic.ContainsNumber ( string  category,
int  i,
bool  local 
)
static

Looks wether an Stage.number i exists within a certain Stage.category category in local saves (local == true) or install path.

Parameters
categoryto look in
ito look for
localwhere to look
Returns

◆ Delete()

static void StageStatic.Delete ( Stage  stage)
static

Deletes a Stage and all its associated files (including save games).

See also
Stage.delete(bool)

Parameters
stageto be deleted

◆ GenerateWorldList()

static List< string > StageStatic.GenerateWorldList ( )
staticprivate

Extracts all loadable scenes for Worlds.

Returns
Worlds

◆ GetStage()

static Stage StageStatic.GetStage ( string  name,
bool  local 
)
static

Returns a Stage or throws Exception if not found.

Parameters
nameStage.name
localwhere to look
Returns
(local ? StageLocal : StageOfficial)[name];

◆ LoadCreate()

static void StageStatic.LoadCreate ( )
static

Load current stage in Mode.Create

◆ LoadInitStage() [1/2]

static bool StageStatic.LoadInitStage ( bool  restore_session,
GameObject  gameObject = null 
)
static

Loads and initiates Stage defined by current_name and local_stage.

Parameters
restore_sessionwether to restore last (loaded) player session (true) or start from scratch (false).
gameObject(e.g. UI/ Def_Stage) toggles recursively children with tag "DevelopingMode" to mode == Mode.Create.
Returns
false iff Stage defined by current_name and local_stage could not be found or loaded.

◆ LoadInitStage() [2/2]

static bool StageStatic.LoadInitStage ( string  name,
bool  local = false,
bool  restore_session = true,
GameObject  gameObject = null 
)
static

Wrapps LoadInitStage(bool, GameObject) with extra parameters. Loads and initiates Stage defined by name and local .

Parameters
namesets current_name iff succeedes
localsets current_name iff succeedes
restore_sessionwether to restore last (loaded) player session (true) or start from scratch (false).
gameObject(e.g. UI/ Def_Stage) toggles recursively children with tag "DevelopingMode" to mode == Mode.Create.
Returns
false iff Stage defined by name and local could not be found or loaded.

◆ LoadNewStage()

static StageErrorStruct StageStatic.LoadNewStage ( string  category,
int  id,
string  name,
string  description,
string  scene 
)
static

◆ NextNumber()

static int StageStatic.NextNumber ( bool  local,
string  category 
)
static

Finds first unused Stage.number in a certain category .

Parameters
localwhich kind of stage we are looking at
categorythe category in question
Returns
first unused Stage.number in a certain category

◆ SetMode()

static void StageStatic.SetMode ( Mode  mode,
GameObject  gameObject = null 
)
static

sets mode and en-/ disables children of gameObject with certain Tags, only available in certain Modes (e.g. in Def_Stage)

Parameters
modeMode to set
gameObjectwhich children will be checked

◆ SetStage()

static void StageStatic.SetStage ( string  name,
bool  local 
)
static

Sets parameters, defining what to load in LoadInitStage(bool, GameObject) and LoadInitStage(string, bool, bool, GameObject).

Parameters
namesets current_name
localsets local_stage

◆ ShallowLoadStages()

static void StageStatic.ShallowLoadStages ( )
static

Looks for and initial loads (see Stage.ShallowLoad(ref Stage, string)) Stages in local_stage and !local_stage.

◆ Validate()

static StageErrorStruct StageStatic.Validate ( string  category,
int  id,
string  name,
string  description,
string  scene,
bool  local = true 
)
static

Member Data Documentation

◆ Category

Dictionary<string, int> StageStatic.Category
static
Initial value:
= new Dictionary<string, int> {
{ "", -1 },
{ "Demo Category", 0 },
}

Used to map StageOfficial categories into a ordered list for the StageMenue.

◆ current_name

string StageStatic.current_name
static

Stage.name of current stage or one to be loaded.

See also
LoadInitStage(bool, GameObject)

◆ local_stage

bool StageStatic.local_stage
static

!Stage.use_install_folder of current stage or one to be loaded.

See also
LoadInitStage(bool, GameObject)

◆ mode

Mode StageStatic.mode
static

Current Mode

◆ StageLocal

Dictionary<string, Stage> StageStatic.StageLocal
static

  • Key: stage name
  • Value: stages created by local user

◆ StageOfficial

Dictionary<string, Stage> StageStatic.StageOfficial
static

  • Key: stage name
  • Value: stages created by KWARC

◆ Worlds

readonly List<string> StageStatic.Worlds = GenerateWorldList()
static

Loadable world scenes

Property Documentation

◆ last_error

StageErrorStruct StageStatic.last_error
staticgetprivate set

TODO: set when encountering an error

◆ stage

Stage??? StageStatic.stage
staticgetset

Current Stage


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