C#Code
C#Code
Public Member Functions | Protected Member Functions | Private Attributes
Libraries.ScriptingCSharp.CSharpScriptManager Class Reference

List of all members.

Public Member Functions

 CSharpScriptManager ()
bool RunScript (BaseCSharpScript script)
bool RunScript (CSharpScriptDelegate scriptFunction)
bool RunScript (CSharpScriptDelegate scriptFunction, StringType ID)
bool RunScript (CSharpScriptDelegate scriptFunction, string ID)
void Update (int timePassed)
void Render (Microsoft.Xna.Framework.Graphics.GraphicsDevice device)
void RemoveScript (StringType ID)
 CSharpScriptManager ()
bool RunScript (BaseCSharpScript script)
bool RunScript (CSharpScriptDelegate scriptFunction)
bool RunScript (CSharpScriptDelegate scriptFunction, StringType ID)
bool RunScript (CSharpScriptDelegate scriptFunction, string ID)
void Update (int timePassed)
void Render (Microsoft.Xna.Framework.Graphics.GraphicsDevice device)
void RemoveScript (StringType ID)

Protected Member Functions

int GetScriptInd (StringType ID)
BaseCSharpScript GetScript (StringType ID)
int GetScriptInd (StringType ID)
BaseCSharpScript GetScript (StringType ID)

Private Attributes

readonly List< BaseCSharpScriptm_scripts
 Stores all scripts in the script manager.

Detailed Description

Scripting can be done with C# itself in a similar way to using lua. It is possible to yield a function and resume later, just like what made lua so nice. :) This is a manager class that stores and runs "scripts". A script will be a function that yields. You create the function as a delegate and store that in the script manager. The manager runs the function and clears it up when the "script" finishes.


Constructor & Destructor Documentation

Libraries.ScriptingCSharp.CSharpScriptManager.CSharpScriptManager ( )

Default constructor.

Libraries.ScriptingCSharp.CSharpScriptManager.CSharpScriptManager ( )

Default constructor.


Member Function Documentation

BaseCSharpScript Libraries.ScriptingCSharp.CSharpScriptManager.GetScript ( StringType  ID) [protected]

Find the script with the matching ID and return it.

ID - ID of the script to find.

Return:
Value is the matching script, null if no match was found.
BaseCSharpScript Libraries.ScriptingCSharp.CSharpScriptManager.GetScript ( StringType  ID) [protected]

Find the script with the matching ID and return it.

ID - ID of the script to find.

Return:
Value is the matching script, null if no match was found.
int Libraries.ScriptingCSharp.CSharpScriptManager.GetScriptInd ( StringType  ID) [protected]

Find the index that the script with the given ID is at.

- ID to find. Should not be null.


Return:
Value is the index if a match was found, -1 if not.
int Libraries.ScriptingCSharp.CSharpScriptManager.GetScriptInd ( StringType  ID) [protected]

Find the index that the script with the given ID is at.

- ID to find. Should not be null.


Return:
Value is the index if a match was found, -1 if not.
void Libraries.ScriptingCSharp.CSharpScriptManager.RemoveScript ( StringType  ID)

Find and remove the script with the given ID. If the ID is null then nothing happens.

void Libraries.ScriptingCSharp.CSharpScriptManager.RemoveScript ( StringType  ID)

Find and remove the script with the given ID. If the ID is null then nothing happens.

void Libraries.ScriptingCSharp.CSharpScriptManager.Render ( Microsoft.Xna.Framework.Graphics.GraphicsDevice  device)

Render the 3D manager. If a script has anything to render then it will be rendered now as well.

timePassed - How much time the update is for.
void Libraries.ScriptingCSharp.CSharpScriptManager.Render ( Microsoft.Xna.Framework.Graphics.GraphicsDevice  device)

Render the 3D manager. If a script has anything to render then it will be rendered now as well.

timePassed - How much time the update is for.
bool Libraries.ScriptingCSharp.CSharpScriptManager.RunScript ( CSharpScriptDelegate  scriptFunction)

Run the given script. If the script is finished after running it will be freed. If not it will be stored and run again later. If it gets stored it will be stored as a anonymous script.

script - The script to run.

Return:
Value is true if the script ran, false if not. It won't run if it is null.
bool Libraries.ScriptingCSharp.CSharpScriptManager.RunScript ( BaseCSharpScript  script)

Run the given script. If the script is finished after running it will be freed. If not it will be stored and run again later.

script - The script to run.

Return:
Value is true if the script ran, false if not. It won't run if it is null or if it is not anonymous and a script with the same name already exists.
bool Libraries.ScriptingCSharp.CSharpScriptManager.RunScript ( CSharpScriptDelegate  scriptFunction,
string  ID 
)

Run the given script. If the script is finished after running it will be freed. If not it will be stored and run again later. If it gets stored it will be stored as a anonymous script.

script - The script to run.
ID - Id of the script.

Return:
Value is true if the script ran, false if not. It won't run if it is null or if it is not anonymous and a script with the same name already exists.
bool Libraries.ScriptingCSharp.CSharpScriptManager.RunScript ( CSharpScriptDelegate  scriptFunction)

Run the given script. If the script is finished after running it will be freed. If not it will be stored and run again later. If it gets stored it will be stored as a anonymous script.

script - The script to run.

Return:
Value is true if the script ran, false if not. It won't run if it is null.
bool Libraries.ScriptingCSharp.CSharpScriptManager.RunScript ( CSharpScriptDelegate  scriptFunction,
string  ID 
)

Run the given script. If the script is finished after running it will be freed. If not it will be stored and run again later. If it gets stored it will be stored as a anonymous script.

script - The script to run.
ID - Id of the script.

Return:
Value is true if the script ran, false if not. It won't run if it is null or if it is not anonymous and a script with the same name already exists.
bool Libraries.ScriptingCSharp.CSharpScriptManager.RunScript ( CSharpScriptDelegate  scriptFunction,
StringType  ID 
)

Run the given script. If the script is finished after running it will be freed. If not it will be stored and run again later. If it gets stored it will be stored as a anonymous script.

script - The script to run.
ID - Id of the script.

Return:
Value is true if the script ran, false if not. It won't run if it is null or if it is not anonymous and a script with the same name already exists.
bool Libraries.ScriptingCSharp.CSharpScriptManager.RunScript ( BaseCSharpScript  script)

Run the given script. If the script is finished after running it will be freed. If not it will be stored and run again later.

script - The script to run.

Return:
Value is true if the script ran, false if not. It won't run if it is null or if it is not anonymous and a script with the same name already exists.
bool Libraries.ScriptingCSharp.CSharpScriptManager.RunScript ( CSharpScriptDelegate  scriptFunction,
StringType  ID 
)

Run the given script. If the script is finished after running it will be freed. If not it will be stored and run again later. If it gets stored it will be stored as a anonymous script.

script - The script to run.
ID - Id of the script.

Return:
Value is true if the script ran, false if not. It won't run if it is null or if it is not anonymous and a script with the same name already exists.
void Libraries.ScriptingCSharp.CSharpScriptManager.Update ( int  timePassed)

Update all the scripts. Destroy any that are finished and remove them.

timePassed - How much time the update is for.
void Libraries.ScriptingCSharp.CSharpScriptManager.Update ( int  timePassed)

Update all the scripts. Destroy any that are finished and remove them.

timePassed - How much time the update is for.

Member Data Documentation

Stores all scripts in the script manager.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Enumerations Properties