Drag[en]gine Game Engine  1.0
deScriptingSystem Class Reference

Scripting System. More...

#include <deScriptingSystem.h>

Inheritance diagram for deScriptingSystem:
deBaseSystem

Public Member Functions

Constructors and Destructors
 deScriptingSystem (deEngine *engine)
 
 ~deScriptingSystem ()
 
Management
deBaseScriptingModuleGetActiveModule () const
 Active module. More...
 
const decStringGetScriptDirectory () const
 Directory relative to the game directory where the scripts are located. More...
 
void SetScriptDirectory (const char *scriptDirectory)
 Set directory relative to the game directory where the scripts are located. More...
 
const decStringGetGameObject () const
 Initial game object to create. More...
 
void SetGameObject (const char *gameObject)
 Set initial game object to create. More...
 
void AddVFSSharedDataDir (deVirtualFileSystem &vfs, const char *path) const
 Add virtual file system container for module shared data. More...
 
bool GetEditMode () const
 
void SetEditMode (bool editMode)
 
void InitGame ()
 
void ExitGame ()
 
void OnFrameUpdate ()
 
void OnResizeRenderWindow ()
 
void PaintScreen ()
 
void SendEvent (deInputEvent *event)
 
void LoadCollider (deCollider *collider)
 
void LoadServer (deServer *server)
 
void LoadConnection (deConnection *connection)
 
void LoadNetworkState (deNetworkState *state)
 
void LoadAI (deAI *ai)
 
void LoadTouchSensor (deTouchSensor *touchSensor)
 
void LoadPropField (dePropField *propField)
 
void LoadParticleEmitterInstance (deParticleEmitterInstance *instance)
 
Overloadables
virtual void SetActiveModule (deLoadableModule *module)
 
virtual void ClearPermanents ()
 
virtual void PostStart ()
 
virtual void PreStop ()
 
- Public Member Functions inherited from deBaseSystem
 deBaseSystem (deEngine *engine, const char *systemName, int requiredModuleType)
 
virtual ~deBaseSystem ()
 
deEngineGetEngine () const
 
deLoadableModuleGetActiveLoadableModule () const
 
bool GetIsRunning () const
 
bool GetHasFailed () const
 
const char * GetSystemName () const
 
virtual bool CanStart ()
 
void SetHasFailed (bool hasFailed)
 
virtual void Start ()
 
virtual void Stop ()
 
void CheckAndActivateFirst (deModuleSystem::eModuleTypes type)
 
void LogInfo (const char *message)
 
void LogInfoFormat (const char *message,...)
 
void LogInfoFormatUsing (const char *message, va_list args)
 
void LogWarn (const char *message)
 
void LogWarnFormat (const char *message,...)
 
void LogWarnFormatUsing (const char *message, va_list args)
 
void LogError (const char *message)
 
void LogErrorFormat (const char *message,...)
 
void LogErrorFormatUsing (const char *message, va_list args)
 
void LogException (const deException &exception)
 

Detailed Description

Scripting System.

Provides support for an external scripting or programming language. This is the only system that can not change during the run of a game not even during engine-break time. The scripts drive the entire engine and should provide an interface ( abstraction layer ) between the engine and engine systems towards the game developer. The amount of access to the engine functionality is depending on the scripting module used.

Note
Currently the system sends events directly to the scripting system. It would be better to avoid this by giving the scripting system the chance to retrieve the events itself from a queue. The best idea would be to create an event queue in the engine object that the input system writes to and that the scripting system retrieves from. Conversion of events has to be done anyways.
Author
Pl├╝ss Roland
Version
1.0
Date
2008

Constructor & Destructor Documentation

◆ deScriptingSystem()

deScriptingSystem::deScriptingSystem ( deEngine engine)

Creates a new scripting system linked to the given engine.

◆ ~deScriptingSystem()

deScriptingSystem::~deScriptingSystem ( )

Cleans up the scripting system.

Member Function Documentation

◆ AddVFSSharedDataDir()

void deScriptingSystem::AddVFSSharedDataDir ( deVirtualFileSystem vfs,
const char *  path 
) const

Add virtual file system container for module shared data.

No container is added if no module is active or the active module has no shared data.

Referenced by GetGameObject().

◆ ClearPermanents()

virtual void deScriptingSystem::ClearPermanents ( )
virtual

Clears cross references and links that could lead to memory leaks. Do not forget to call the super function.

Reimplemented from deBaseSystem.

Referenced by GetEditMode().

◆ ExitGame()

void deScriptingSystem::ExitGame ( )

Exits the game it running.

Referenced by GetEditMode().

◆ GetActiveModule()

deBaseScriptingModule* deScriptingSystem::GetActiveModule ( ) const
inline

Active module.

◆ GetEditMode()

bool deScriptingSystem::GetEditMode ( ) const
inline

Determines if the scripts are executed in edit mode. In this mode the scripts are reduced to what is required by an editing application. The edit mode can only be changed while the system is not running.

References ClearPermanents(), ExitGame(), InitGame(), LoadAI(), LoadCollider(), LoadConnection(), LoadNetworkState(), LoadParticleEmitterInstance(), LoadPropField(), LoadServer(), LoadTouchSensor(), OnFrameUpdate(), OnResizeRenderWindow(), PaintScreen(), PostStart(), PreStop(), SendEvent(), SetActiveModule(), and SetEditMode().

◆ GetGameObject()

const decString& deScriptingSystem::GetGameObject ( ) const
inline

Initial game object to create.

References AddVFSSharedDataDir(), and SetGameObject().

◆ GetScriptDirectory()

const decString& deScriptingSystem::GetScriptDirectory ( ) const
inline

Directory relative to the game directory where the scripts are located.

References SetScriptDirectory().

◆ InitGame()

void deScriptingSystem::InitGame ( )

Inits the game if not running.

Referenced by GetEditMode().

◆ LoadAI()

void deScriptingSystem::LoadAI ( deAI ai)

Creates the peer object for the given ai using the active module and assigns it.

Referenced by GetEditMode().

◆ LoadCollider()

void deScriptingSystem::LoadCollider ( deCollider collider)

Creates the peer object for the given collider using the active module and assigns it.

Referenced by GetEditMode().

◆ LoadConnection()

void deScriptingSystem::LoadConnection ( deConnection connection)

Creates the peer object for the given connection using the active module and assigns it.

Referenced by GetEditMode().

◆ LoadNetworkState()

void deScriptingSystem::LoadNetworkState ( deNetworkState state)

Creates the peer object for the given network state using the active module and assigns it.

Referenced by GetEditMode().

◆ LoadParticleEmitterInstance()

void deScriptingSystem::LoadParticleEmitterInstance ( deParticleEmitterInstance instance)

Creates the peer object for the given particle emitter instance using the active module and assigns it.

Referenced by GetEditMode().

◆ LoadPropField()

void deScriptingSystem::LoadPropField ( dePropField propField)

Creates the peer object for the given prop field using the active module and assigns it.

Referenced by GetEditMode().

◆ LoadServer()

void deScriptingSystem::LoadServer ( deServer server)

Creates the peer object for the given server using the active module and assigns it.

Referenced by GetEditMode().

◆ LoadTouchSensor()

void deScriptingSystem::LoadTouchSensor ( deTouchSensor touchSensor)

Creates the peer object for the given touch sensor using the active module and assigns it.

Referenced by GetEditMode().

◆ OnFrameUpdate()

void deScriptingSystem::OnFrameUpdate ( )

A new fram update cycle started.

Referenced by GetEditMode().

◆ OnResizeRenderWindow()

void deScriptingSystem::OnResizeRenderWindow ( )

Render window has changed size.

Referenced by GetEditMode().

◆ PaintScreen()

void deScriptingSystem::PaintScreen ( )

Primary render target has to be painted.

Referenced by GetEditMode().

◆ PostStart()

virtual void deScriptingSystem::PostStart ( )
virtual

Carry out here actions right after the system started up.

Reimplemented from deBaseSystem.

Referenced by GetEditMode().

◆ PreStop()

virtual void deScriptingSystem::PreStop ( )
virtual

Carry out here actions right before the system shuts down.

Reimplemented from deBaseSystem.

Referenced by GetEditMode().

◆ SendEvent()

void deScriptingSystem::SendEvent ( deInputEvent event)

Event has to be processed.

Referenced by GetEditMode().

◆ SetActiveModule()

virtual void deScriptingSystem::SetActiveModule ( deLoadableModule module)
virtual

Sets the active loadable module. Do not forget to call the super function.

Reimplemented from deBaseSystem.

Referenced by GetEditMode().

◆ SetEditMode()

void deScriptingSystem::SetEditMode ( bool  editMode)

Sets if the scripts are executed in edit mode. In this mode the scripts are reduced to what is required by an editing application. The edit mode can only be changed while the system is not running.

Referenced by GetEditMode().

◆ SetGameObject()

void deScriptingSystem::SetGameObject ( const char *  gameObject)

Set initial game object to create.

Referenced by GetGameObject().

◆ SetScriptDirectory()

void deScriptingSystem::SetScriptDirectory ( const char *  scriptDirectory)

Set directory relative to the game directory where the scripts are located.

Referenced by GetScriptDirectory().


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