3DRadSpace  v1.0.0a
Scripting documentation
_3DRadSpaceDll.Script Class Reference

C# Script class. More...

Inheritance diagram for _3DRadSpaceDll.Script:
_3DRadSpaceDll.GameObject

Public Member Functions

 Script (string name, bool enabled, string scriptpath, string ClassN)
 Script object main constructor. More...
 
 Script ()
 Empty Script object constructor. More...
 
bool Compile (bool ShowErrors)
 Compiles code in order to make it usable. More...
 
override void Load (ContentManager content)
 Initiailze the object by compiling the linked source. More...
 
void Start ()
 Executes [ClassName].Start(), where ClassName is part of the the compiled code. More...
 
void Run (MouseState mouse, KeyboardState keyboard, GameTime time)
 Executes [ClassName].Run(), where ClassName is part of the compiled source code. More...
 
void End ()
 Executes [ClassName].End(), where ClassName is part of the compiled source. More...
 
override void Update (MouseState mouse, KeyboardState keyboard, GameTime time)
 Runs the script code. More...
 
override void Draw (SpriteBatch spriteBatch, Matrix? view, Matrix? projection)
 Runs the script code dedicated to drawing. More...
 
- Public Member Functions inherited from _3DRadSpaceDll.GameObject
 GameObject ()
 Default constructor. More...
 
void Enable ()
 Enables object. More...
 
void Disable ()
 Disables object. More...
 
void Toggle ()
 Switches object on/off state. More...
 
void Show ()
 Shows the object. More...
 
void Hide ()
 Hides the object. More...
 
virtual void EditorDraw (SpriteBatch spriteBatch, Matrix? view, Matrix? projection)
 Object draw code for the 3DRadSpace editor More...
 
virtual void Trigger ()
 This is specific to objects like ExitFade, NetServer,etc More...
 
override bool Equals (object obj)
 Determines whether the specified object is equal to the current object. More...
 
override int GetHashCode ()
 Returns the hash code calculated from a string representing the data inside the object. More...
 
override string ToString ()
 Returns the object's name More...
 
void RunOnce ()
 Runs the object one Update loop. If used on a active object it will be stopped. More...
 

Properties

bool CompilationStatus [get]
 Checks if compilation succeded. More...
 
TimeSpan CompilationTime [get]
 Time for compilation. More...
 
string Path [get, set]
 Path to source code to be compiled and run. More...
 
string ClassName [get, set]
 Script entry class. More...
 
- Properties inherited from _3DRadSpaceDll.GameObject
string Name [get, set]
 Object Name. Used as a string identifier. More...
 
object Tag [get, set]
 Tag object. More...
 
bool Enabled [get, set]
 Checks if object is enabled. More...
 
bool Hidden [get, set]
 Checks if object is being drawn. More...
 
List< ObjectBehiavourBehiavours [get, set]
 Relation with other objects More...
 
Quaternion RotationQuaternion [get]
 Rotation in a Quaterion system. More...
 
string Resource [get, set]
 Resource file More...
 

Additional Inherited Members

- Static Public Member Functions inherited from _3DRadSpaceDll.GameObject
static implicit operator bool (GameObject o)
 Checks if the object exists. Same as GameObject != null. More...
 
static bool operator== (GameObject a, GameObject b)
 Checks if two GameObjects are equal. More...
 
static bool operator!= (GameObject a, GameObject b)
 The opposite of the equality operator. More...
 
- Public Attributes inherited from _3DRadSpaceDll.GameObject
Vector3 Position
 Object position More...
 
Vector3 Rotation
 Rotation in a Euler angles system. More...
 
List< int > SelectedObjects
 Used for editor. More...
 
- Events inherited from _3DRadSpaceDll.GameObject
onDraw OnDraw
 Called when object is being drawn on frame. More...
 
onUpdate OnUpdate
 Called when object is being updated on the update logic loop. More...
 
onObjectDestroy OnRemoval
 Called when object is being deleted. More...
 
onObjectLoad OnObjectLoad
 Called when a object resource is being loaded. More...
 

Detailed Description

C# Script class.

Constructor & Destructor Documentation

◆ Script() [1/2]

_3DRadSpaceDll.Script.Script ( string  name,
bool  enabled,
string  scriptpath,
string  ClassN 
)

Script object main constructor.

Parameters
nameObject name
enabledChecks if scripts will be run
scriptpathPath to the file that will be compiled.
ClassNClass name.

◆ Script() [2/2]

_3DRadSpaceDll.Script.Script ( )

Empty Script object constructor.

Member Function Documentation

◆ Compile()

bool _3DRadSpaceDll.Script.Compile ( bool  ShowErrors)

Compiles code in order to make it usable.

◆ Draw()

override void _3DRadSpaceDll.Script.Draw ( SpriteBatch  spriteBatch,
Matrix?  view,
Matrix?  projection 
)
virtual

Runs the script code dedicated to drawing.

Parameters
spriteBatchUsed by the user if the case.
viewUser by the user if the case again.
projectionUser by the user, if the case...

Reimplemented from _3DRadSpaceDll.GameObject.

◆ End()

void _3DRadSpaceDll.Script.End ( )

Executes [ClassName].End(), where ClassName is part of the compiled source.

◆ Load()

override void _3DRadSpaceDll.Script.Load ( ContentManager  content)
virtual

Initiailze the object by compiling the linked source.

Parameters
contentContent manager. Not used.

Reimplemented from _3DRadSpaceDll.GameObject.

◆ Run()

void _3DRadSpaceDll.Script.Run ( MouseState  mouse,
KeyboardState  keyboard,
GameTime  time 
)

Executes [ClassName].Run(), where ClassName is part of the compiled source code.

◆ Start()

void _3DRadSpaceDll.Script.Start ( )

Executes [ClassName].Start(), where ClassName is part of the the compiled code.

◆ Update()

override void _3DRadSpaceDll.Script.Update ( MouseState  mouse,
KeyboardState  keyboard,
GameTime  time 
)
virtual

Runs the script code.

Parameters
mouseUsed by the user if the case.
keyboardUsed by the user if the case.
timeUsed by the user if the case.

Reimplemented from _3DRadSpaceDll.GameObject.

Property Documentation

◆ ClassName

string _3DRadSpaceDll.Script.ClassName
getset

Script entry class.

◆ CompilationStatus

bool _3DRadSpaceDll.Script.CompilationStatus
get

Checks if compilation succeded.

◆ CompilationTime

TimeSpan _3DRadSpaceDll.Script.CompilationTime
get

Time for compilation.

◆ Path

string _3DRadSpaceDll.Script.Path
getset

Path to source code to be compiled and run.