xoreos  0.0.5
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Engines::Sonic::Module Class Reference

A Sonic module. More...

#include <module.h>

Inheritance diagram for Engines::Sonic::Module:
Inheritance graph
[legend]
Collaboration diagram for Engines::Sonic::Module:
Collaboration graph
[legend]

Public Member Functions

 Module (::Engines::Console &console)
 
 ~Module ()
 
void clear ()
 Clear the whole context. More...
 
void run ()
 Run the module. More...
 
void exit ()
 Exit the module. More...
 
bool isRunning () const
 Is the module currently running? More...
 
AreagetCurrentArea ()
 Return the area the PC is currently in. More...
 
void movePC (int32 area)
 Move the player character to this area. More...
 
- Public Member Functions inherited from Engines::Sonic::Object
 Object (ObjectType type=kObjectTypeInvalid)
 
virtual ~Object ()
 
ObjectType getType () const
 Return the exact type of the object. More...
 
virtual void show ()
 Show the object's model. More...
 
virtual void hide ()
 Hide the object's model. More...
 
uint32 getModelID () const
 Return the ID of the object's model. More...
 
virtual void getPosition (float &x, float &y, float &z) const
 Return the object's position within its area. More...
 
virtual void getOrientation (float &x, float &y, float &z, float &angle) const
 Return the object's orientation. More...
 
virtual void setPosition (float x, float y, float z)
 Set the object's position within its area. More...
 
virtual void setOrientation (float x, float y, float z, float angle)
 Set the object's orientation. More...
 
virtual void enter ()
 The cursor entered the object. More...
 
virtual void leave ()
 The cursor left the object. More...
 
virtual void highlight (bool enabled)
 (Un)Highlight the object. More...
 
- Public Member Functions inherited from Aurora::NWScript::Object
 Object ()
 
uint32 getID () const
 
const Common::UStringgetTag () const
 
- Public Member Functions inherited from Aurora::NWScript::VariableContainer
 VariableContainer ()
 
virtual ~VariableContainer ()
 
bool hasVariable (const Common::UString &var) const
 
VariablegetVariable (const Common::UString &var, Type type=kTypeVoid)
 
const VariablegetVariable (const Common::UString &var) const
 
void setVariable (const Common::UString &var, const Variable &value)
 
void removeVariable (const Common::UString &var)
 
void clearVariables ()
 
- Public Member Functions inherited from Engines::Sonic::ObjectContainer
 ObjectContainer ()
 
 ~ObjectContainer ()
 
void clearObjects ()
 
void addObject (Sonic::Object &object)
 Add an object to this container. More...
 
void removeObject (Sonic::Object &object)
 Remove an object from this container. More...
 
::Aurora::NWScript::ObjectgetFirstObjectByType (ObjectType type) const
 Return the first object of this type. More...
 
::Aurora::NWScript::ObjectSearchfindObjectsByType (ObjectType type) const
 Return a search context to iterate over all objects of this type. More...
 
- Public Member Functions inherited from Aurora::NWScript::ObjectContainer
 ObjectContainer ()
 
 ~ObjectContainer ()
 
void clearObjects ()
 
void addObject (Object &object)
 Add an object to this container. More...
 
void removeObject (Object &object)
 Remove an object from this container. More...
 
ObjectgetObjectByID (uint32 id) const
 Find a specific object by ID. More...
 
ObjectgetFirstObject () const
 Return the first object. More...
 
ObjectgetFirstObjectByTag (const Common::UString &tag) const
 Return the first object with this tag. More...
 
ObjectSearchfindObjects () const
 Return a search context to iterate over all objects. More...
 
ObjectSearchfindObjectsByTag (const Common::UString &tag) const
 Return a search context to iterate over all objects with this tag. More...
 

Protected Member Functions

void unload ()
 
void loadArea ()
 
void unloadArea ()
 
void handleEvents ()
 
bool handleCameraEvents (const Events::Event &event)
 
- Protected Member Functions inherited from Aurora::NWScript::ObjectContainer
void lock ()
 
void unlock ()
 

Protected Attributes

::Engines::Console_console
 
bool _running
 Are we currently running a module? More...
 
bool _exit
 Should we exit the module? More...
 
int32 _newArea
 The new area to enter. More...
 
Common::ScopedPtr< Area_area
 The current area. More...
 
- Protected Attributes inherited from Engines::Sonic::Object
ObjectType _type
 The object's type. More...
 
uint32 _modelID
 The ID of the object's model. More...
 
float _position [3]
 The object's position. More...
 
float _orientation [4]
 The object's orientation. More...
 
- Protected Attributes inherited from Aurora::NWScript::Object
uint32 _id
 
Common::UString _tag
 

Additional Inherited Members

- Static Public Member Functions inherited from Engines::Sonic::ObjectContainer
static Sonic::ObjecttoObject (::Aurora::NWScript::Object *object)
 
static ModuletoModule (Aurora::NWScript::Object *object)
 
static AreatoArea (Aurora::NWScript::Object *object)
 
static PlaceabletoPlaceable (Aurora::NWScript::Object *object)
 

Detailed Description

A Sonic module.

Definition at line 45 of file module.h.

Constructor & Destructor Documentation

◆ Module()

Engines::Sonic::Module::Module ( ::Engines::Console console)

Definition at line 44 of file module.cpp.

References Aurora::NWScript::Object::_id, Common::generateIDNumber(), and ObjectMan.

Here is the call graph for this function:

◆ ~Module()

Engines::Sonic::Module::~Module ( )

Definition at line 50 of file module.cpp.

References clear(), and ObjectMan.

Here is the call graph for this function:

Member Function Documentation

◆ clear()

void Engines::Sonic::Module::clear ( )

Clear the whole context.

Definition at line 59 of file module.cpp.

References unload().

Referenced by ~Module().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ exit()

void Engines::Sonic::Module::exit ( )

Exit the module.

Definition at line 100 of file module.cpp.

References _exit.

◆ getCurrentArea()

Area * Engines::Sonic::Module::getCurrentArea ( )

Return the area the PC is currently in.

Definition at line 199 of file module.cpp.

References _area.

◆ handleCameraEvents()

bool Engines::Sonic::Module::handleCameraEvents ( const Events::Event event)
protected

Definition at line 164 of file module.cpp.

References CameraMan, Events::kEventKeyDown, and Events::kEventMouseMove.

Referenced by handleEvents().

Here is the caller graph for this function:

◆ handleEvents()

void Engines::Sonic::Module::handleEvents ( )
protected

Definition at line 134 of file module.cpp.

References _area, _console, CameraMan, EventMan, handleCameraEvents(), Engines::Console::isVisible(), Events::kEventKeyDown, Engines::Console::processEvent(), and Engines::Console::show().

Referenced by run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isRunning()

bool Engines::Sonic::Module::isRunning ( ) const

Is the module currently running?

Definition at line 96 of file module.cpp.

References _running.

◆ loadArea()

void Engines::Sonic::Module::loadArea ( )
protected

Definition at line 104 of file module.cpp.

References _area, _exit, _newArea, and unloadArea().

Referenced by run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ movePC()

void Engines::Sonic::Module::movePC ( int32  area)

Move the player character to this area.

Definition at line 203 of file module.cpp.

References _newArea.

Referenced by Engines::Sonic::Console::cmdGotoArea().

Here is the caller graph for this function:

◆ run()

void Engines::Sonic::Module::run ( )

Run the module.

Definition at line 63 of file module.cpp.

References _exit, _newArea, _running, Common::StackException::add(), EventMan, handleEvents(), and loadArea().

Here is the call graph for this function:

◆ unload()

void Engines::Sonic::Module::unload ( )
protected

Definition at line 130 of file module.cpp.

References unloadArea().

Referenced by clear().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unloadArea()

void Engines::Sonic::Module::unloadArea ( )
protected

Definition at line 121 of file module.cpp.

References _area.

Referenced by loadArea(), and unload().

Here is the caller graph for this function:

Member Data Documentation

◆ _area

Common::ScopedPtr<Area> Engines::Sonic::Module::_area
protected

The current area.

Definition at line 76 of file module.h.

Referenced by getCurrentArea(), handleEvents(), loadArea(), and unloadArea().

◆ _console

::Engines::Console* Engines::Sonic::Module::_console
protected

Definition at line 69 of file module.h.

Referenced by handleEvents().

◆ _exit

bool Engines::Sonic::Module::_exit
protected

Should we exit the module?

Definition at line 72 of file module.h.

Referenced by exit(), loadArea(), and run().

◆ _newArea

int32 Engines::Sonic::Module::_newArea
protected

The new area to enter.

Definition at line 74 of file module.h.

Referenced by loadArea(), movePC(), and run().

◆ _running

bool Engines::Sonic::Module::_running
protected

Are we currently running a module?

Definition at line 71 of file module.h.

Referenced by isRunning(), and run().


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