se_core::ScriptComponent Class Reference

#include <ScriptComponent.hpp>

Inheritance diagram for se_core::ScriptComponent:

se_core::Component se_core::ActionFeed List of all members.

Public Types

typedef ComponentPtr< ScriptComponent,
sct_SCRIPT > 
Ptr

Public Member Functions

 ScriptComponent (Composite *owner, ActionComponent *consumer)
 ScriptComponent (Composite *owner, const ComponentFactory *factory)
virtual ~ScriptComponent ()
void nextAction (const ActionComponent &performer, int channel, ActionAndParameter &out)
virtual void setActive (bool state)
 Returns true if the Actor is inside an active area.
void pushScript (const Script *s)
 Push a script on the script stack of the Actor.
void pushScript (const char *name)
 Push a script with a given name on the script stack of the Actor.
void popScript ()
 Pop a script from the script stack of the Actor.
bool hasActiveScript () const
 Return true if the Actor has an active script.
const Scriptscript () const
 Get the active script of the Actor.
ScriptDatascriptData ()
void clearScripts ()
 Clear all scripts from the script stack.
void nextScriptAction (short channel, ActionAndParameter &aap)
 Ask currently running script for the next action in a channel.
void setDefaultScript (const Script *s)
 Set the default script of the Actor.
void stopScript ()
 Stop the presently active script.
void touch (void *param=0)
void touchDefault (void *param=0)
void feedbackEvent (const ActionComponent &source, int type)
virtual const char * name () const
 By default returns name of composite, which returns name of composite factory.
Compositeowner ()
const Compositeowner () const
 Component type.
Componentcomponent (int type)
const Componentcomponent (int type) const
int type () const
const ComponentFactoryfactory ()
bool isActive ()
bool isDead () const

Static Public Member Functions

ScriptComponentget (Composite &composite)
ScriptComponentget (Component &component)

Protected Member Functions

void cleanup ()
 Called by Composite.
virtual void setDead ()
 Called by Composite.
virtual void parentChanged (Composite *newParent, Composite *oldParent)
 Called by Composite.
virtual void zoneChanged (int type, Composite *newArea, Composite *oldArea)
 Called by Composite.
virtual void init ()
 Called by Composite.

Protected Attributes

short currentScript_
ActionComponentconsumer_
const ScriptscriptStack_ [SCRIPT_STACK_SIZE]
ScriptDatascriptData_ [SCRIPT_STACK_SIZE]
int type_
 The type of Component.
Compositeowner_
const ComponentFactoryfactory_

Static Protected Attributes

const short SCRIPT_STACK_SIZE = 6

Friends

class Composite

Member Typedef Documentation

typedef ComponentPtr<ScriptComponent, sct_SCRIPT> se_core::ScriptComponent::Ptr
 

Definition at line 37 of file ScriptComponent.hpp.


Constructor & Destructor Documentation

se_core::ScriptComponent::ScriptComponent Composite owner,
ActionComponent consumer
 

Definition at line 33 of file ScriptComponent.cpp.

References se_core::sct_SCRIPT.

se_core::ScriptComponent::ScriptComponent Composite owner,
const ComponentFactory factory
 

Definition at line 43 of file ScriptComponent.cpp.

References Assert, se_core::sct_ACTION, and se_core::sct_SCRIPT.

se_core::ScriptComponent::~ScriptComponent  )  [virtual]
 

Definition at line 53 of file ScriptComponent.cpp.

References se_core::IoSchema::cleanup().


Member Function Documentation

void se_core::ScriptComponent::cleanup  )  [protected, virtual]
 

Called by Composite.

Reimplemented from se_core::Component.

Definition at line 58 of file ScriptComponent.cpp.

void se_core::ScriptComponent::clearScripts  ) 
 

Clear all scripts from the script stack.

Remove Actor from any running Cutscene, and stop all script execution. Performet at cleanup.

Definition at line 114 of file ScriptComponent.cpp.

const Component* se_core::Component::component int  type  )  const [inline, inherited]
 

Definition at line 71 of file Component.hpp.

References se_core::Component::component().

Component* se_core::Component::component int  type  )  [inline, inherited]
 

Definition at line 67 of file Component.hpp.

References se_core::Composite::component().

Referenced by se_core::Component::component(), se_core::Component::ComponentPtr< T, type >::ComponentPtr(), se_ogre::O3dThingComponent::get(), se_ogre::O3dNodeComponent::get(), and se_ogre::O3dAreaComponent::get().

const ComponentFactory* se_core::Component::factory  )  [inline, inherited]
 

Definition at line 81 of file Component.hpp.

Referenced by se_core::Composite::releaseComponents().

void se_core::ScriptComponent::feedbackEvent const ActionComponent source,
int  type
[virtual]
 

Implements se_core::ActionFeed.

Definition at line 243 of file ScriptComponent.cpp.

References se_core::Script::feedbackEvent().

ScriptComponent* se_core::ScriptComponent::get Component component  )  [inline, static]
 

Definition at line 49 of file ScriptComponent.hpp.

References se_core::Composite::component(), and se_core::Component::owner().

ScriptComponent* se_core::ScriptComponent::get Composite composite  )  [inline, static]
 

Definition at line 44 of file ScriptComponent.hpp.

References se_core::Composite::component().

bool se_core::ScriptComponent::hasActiveScript  )  const [inline]
 

Return true if the Actor has an active script.

Definition at line 87 of file ScriptComponent.hpp.

void se_core::Component::init  )  [protected, virtual, inherited]
 

Called by Composite.

Reimplemented in se_core::RootComponent, se_core::SignalAreaComponent, se_ogre::O3dAreaComponent, and se_ogre::O3dThingComponent.

Definition at line 42 of file Component.cpp.

Referenced by se_core::Composite::init().

bool se_core::Component::isActive  )  [inherited]
 

Definition at line 26 of file Component.cpp.

bool se_core::Component::isDead  )  const [inherited]
 

Definition at line 31 of file Component.cpp.

Referenced by se_core::Actor::affect().

const char * se_core::Component::name  )  const [virtual, inherited]
 

By default returns name of composite, which returns name of composite factory.

Reimplemented in se_core::CutsceneAreaComponent, se_core::CutsceneComponent, se_core::CutsceneManager, se_core::CollisionAreaComponent, se_core::SignalAreaComponent, se_core::SignalComponent, se_core::SpawnAreaComponent, se_core::SpawnManager, se_core::ZoneAreaComponent, se_core::ZoneComponent, se_core::ZoneManager, se_basic::NavMeshAreaComponent, se_basic::NavMeshComponent, and se_basic::NavMeshManager.

Definition at line 21 of file Component.cpp.

Referenced by se_core::Area::addNeighbour(), se_core::DefaultTC::collide(), se_core::CoDefault::collide(), se_basic::Say::perform(), and se_ogre::SpeechBubble::speechEvent().

void se_core::ScriptComponent::nextAction const ActionComponent performer,
int  channel,
ActionAndParameter out
[virtual]
 

Implements se_core::ActionFeed.

Definition at line 67 of file ScriptComponent.cpp.

void se_core::ScriptComponent::nextScriptAction short  channel,
ActionAndParameter aap
 

Ask currently running script for the next action in a channel.

Definition at line 73 of file ScriptComponent.cpp.

References se_core::ActionAndParameter::hasAction().

const Composite* se_core::Component::owner  )  const [inline, inherited]
 

Component type.

Definition at line 62 of file Component.hpp.

Composite* se_core::Component::owner  )  [inline, inherited]
 

Definition at line 54 of file Component.hpp.

Referenced by se_core::CollisionAreaComponent::_testCollisionCandidates(), se_core::CollisionAreaComponent::_testCollisionCandidates2(), se_core::HealthListeners::add(), se_core::ZoneAreaComponent::addNeighbour(), se_basic::PhTrackingCamera::affect(), se_core::HealthListeners::castHealthChangedEvent(), se_core::Component::ComponentPtr< T, type >::ComponentPtr(), se_ogre::ThingMOManager::create(), se_basic::SimpleAreaThingEncoder::encode(), se_core::SpawnComponent::get(), se_core::SignalComponent::get(), se_core::SignalAreaComponent::get(), get(), se_core::PosComponent::get(), se_core::PhysicsComponent::get(), se_core::StatComponent::get(), se_ogre::O3dThingComponent::get(), se_ogre::O3dNodeComponent::get(), se_ogre::O3dAreaComponent::get(), se_core::Pos::hasArea(), se_core::CollisionGrid::insert(), se_core::CollisionComponent::isCollideable(), se_core::ZoneComponent::name(), se_core::Component::ComponentPtr< T, type >::operator=(), se_core::DefaultTC::pop(), se_core::CoDefault::pop(), se_core::DefaultTC::popAndDie(), se_core::CoDefault::popAndDie(), se_core::CollisionAreaComponent::removeCollideable(), se_core::AreaManager::resetThings(), se_core::Actor::scheduleForDestruction(), se_core::AreaManager::setActive(), se_core::AreaManager::setInactive(), and se_ogre::O3dManager::updateStats().

virtual void se_core::Component::parentChanged Composite newParent,
Composite oldParent
[inline, protected, virtual, inherited]
 

Called by Composite.

Reimplemented in se_core::AreaChildComponent, and se_core::NodeComponent.

Definition at line 101 of file Component.hpp.

Referenced by se_core::Composite::resetParent(), and se_core::Composite::setParent().

void se_core::ScriptComponent::popScript  ) 
 

Pop a script from the script stack of the Actor.

The script below the present script on the script stack will be resumed.

Definition at line 164 of file ScriptComponent.cpp.

References Assert.

void se_core::ScriptComponent::pushScript const char *  name  ) 
 

Push a script with a given name on the script stack of the Actor.

The script will be executed until it is popped, or another script is pushed on top of it.

Definition at line 131 of file ScriptComponent.cpp.

void se_core::ScriptComponent::pushScript const Script s  ) 
 

Push a script on the script stack of the Actor.

The script will be executed until it is popped, or another script is pushed on top of it.

Definition at line 138 of file ScriptComponent.cpp.

References Assert, and se_core::Script::init().

const Script* se_core::ScriptComponent::script  )  const [inline]
 

Get the active script of the Actor.

Definition at line 94 of file ScriptComponent.hpp.

ScriptData* se_core::ScriptComponent::scriptData  )  [inline]
 

Definition at line 98 of file ScriptComponent.hpp.

void se_core::ScriptComponent::setActive bool  state  )  [virtual]
 

Returns true if the Actor is inside an active area.

Reimplemented from se_core::Component.

Definition at line 210 of file ScriptComponent.cpp.

virtual void se_core::Component::setDead  )  [inline, protected, virtual, inherited]
 

Called by Composite.

Reimplemented in se_core::SignalComponent, and se_core::SpawnComponent.

Definition at line 97 of file Component.hpp.

Referenced by se_core::Composite::scheduleForDestruction().

void se_core::ScriptComponent::setDefaultScript const Script s  ) 
 

Set the default script of the Actor.

Sets the script that the Actor will run when no cutscenes are showing. Actions perfomed inside a Cutscene (and outside if you want) that wants to set the script that the Actor uses after the Cutscene is done, should use this method.

Definition at line 96 of file ScriptComponent.cpp.

References se_core::Script::init().

void se_core::ScriptComponent::stopScript  ) 
 

Stop the presently active script.

Removes the actor from the showing cutscene, if any. If not, stop the default script and set the Actor to have no default script.

Definition at line 192 of file ScriptComponent.cpp.

References Assert.

void se_core::ScriptComponent::touch void *  param = 0  ) 
 

Definition at line 229 of file ScriptComponent.cpp.

void se_core::ScriptComponent::touchDefault void *  param = 0  ) 
 

Definition at line 234 of file ScriptComponent.cpp.

References Assert, and se_core::Script::touched().

int se_core::Component::type  )  const [inline, inherited]
 

Definition at line 76 of file Component.hpp.

Referenced by se_core::Composite::component().

void se_core::Component::zoneChanged int  type,
Composite newArea,
Composite oldArea
[protected, virtual, inherited]
 

Called by Composite.

Reimplemented in se_core::AreaChildComponent, se_core::CollisionComponent, and se_core::SignalComponent.

Definition at line 37 of file Component.cpp.

Referenced by se_core::Composite::zoneChanged().


Friends And Related Function Documentation

friend class Composite [friend, inherited]
 

Definition at line 89 of file Component.hpp.


Member Data Documentation

ActionComponent* se_core::ScriptComponent::consumer_ [protected]
 

Definition at line 141 of file ScriptComponent.hpp.

short se_core::ScriptComponent::currentScript_ [protected]
 

Definition at line 140 of file ScriptComponent.hpp.

const ComponentFactory* se_core::Component::factory_ [protected, inherited]
 

Definition at line 120 of file Component.hpp.

Composite* se_core::Component::owner_ [protected, inherited]
 

Definition at line 118 of file Component.hpp.

const short se_core::ScriptComponent::SCRIPT_STACK_SIZE = 6 [static, protected]
 

Definition at line 142 of file ScriptComponent.hpp.

ScriptData* se_core::ScriptComponent::scriptData_[SCRIPT_STACK_SIZE] [protected]
 

Definition at line 144 of file ScriptComponent.hpp.

const Script* se_core::ScriptComponent::scriptStack_[SCRIPT_STACK_SIZE] [protected]
 

Definition at line 143 of file ScriptComponent.hpp.

int se_core::Component::type_ [protected, inherited]
 

The type of Component.

Definition at line 117 of file Component.hpp.


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

Home Page | SagaEngine trunk (updated nightly) reference generated Sun Dec 2 20:06:28 2007 by Doxygen version 1.3.9.1.

SourceForge.net Logo