se_core::Composite Class Reference

#include <Composite.hpp>

List of all members.

Public Types

typedef RefPtr< CompositeRefPtr
typedef Compositeid_type

Public Member Functions

 Composite (const CompositeFactory *factory)
 Composite (const CompositeFactory *factory, const char *name)
virtual ~Composite ()
RefPtrref ()
const char * name () const
int type () const
id_type id () const
void init (bool doTraverseChildren=true)
void cleanup (bool doTraverseChildren=true)
Componentcomponent (int type)
const Componentcomponent (int type) const
const CompositeFactoryfactory ()
void setFactory (const CompositeFactory *f)
bool hasParent () const
 Does the composite have a parent?
Compositeparent ()
 Get parent.
void setParent (Composite &p)
 Set the parent composite.
void resetParent ()
 Set parent composite to none.
const CompositeListchildren () const
 List of child composites.
void setActive (bool state, bool doTraverseChildren=true)
 Set composite state to active.
bool isActive () const
 Is the composite active.
void setTag (int t)
int tag () const
virtual void scheduleForDestruction ()
 Schedule the Composite for destruction.
bool isDead () const
 Returns true if Thing is scheduled for destruction.
void zoneChanged (int type, Composite *newZone, Composite *oldZone)
 Called during flip is area is changed from pos to nextPos.
void releaseComponents ()
 Destroy components.

Protected Types

enum  { FAST_COMPONENT_COUNT = 16 }

Protected Member Functions

void addChild (Composite &node)
 Add a Composite as a child.
void removeChild (Composite &node)
 Add a Composite as a child.

Protected Attributes

const char * name_
const CompositeFactoryfactory_
int tag_
bool isActive_
bool isDead_
ComponentList components_
Compositeparent_
CompositeList children_
ComponentfastComponents_ [16]
RefPtr ptr_
 Reference counted pointer.

Friends

class Component


Member Typedef Documentation

typedef Composite* se_core::Composite::id_type
 

Definition at line 35 of file Composite.hpp.

Referenced by se_core::AreaManager::areaById(), and id().

typedef RefPtr<Composite> se_core::Composite::RefPtr
 

Definition at line 34 of file Composite.hpp.

Referenced by ref().


Member Enumeration Documentation

anonymous enum [protected]
 

Enumeration values:
FAST_COMPONENT_COUNT 

Definition at line 156 of file Composite.hpp.


Constructor & Destructor Documentation

se_core::Composite::Composite const CompositeFactory factory  ) 
 

Definition at line 10 of file Composite.cpp.

se_core::Composite::Composite const CompositeFactory factory,
const char *  name
 

Definition at line 22 of file Composite.cpp.

se_core::Composite::~Composite  )  [virtual]
 

Definition at line 33 of file Composite.cpp.


Member Function Documentation

void se_core::Composite::addChild Composite node  )  [protected]
 

Add a Composite as a child.

Called by the childs setParent.

Definition at line 146 of file Composite.cpp.

Referenced by setParent().

const CompositeList& se_core::Composite::children  )  const [inline]
 

List of child composites.

Definition at line 82 of file Composite.hpp.

Referenced by se_basic::SimpleAreaThingEncoder::encode(), and se_core::CompositeList::TreeIterator::next().

void se_core::Composite::cleanup bool  doTraverseChildren = true  ) 
 

Definition at line 226 of file Composite.cpp.

References se_core::Component::cleanup(), se_core::ComponentList::Iterator::hasNext(), se_core::CompositeList::Iterator::hasNext(), se_core::ComponentList::Iterator::next(), and se_core::CompositeList::Iterator::next().

Referenced by se_core::SimEngine::cleanupGame(), se_core::SpawnManager::neutraliseDestructions(), and se_core::AreaManager::resetThings().

const Component * se_core::Composite::component int  type  )  const
 

Definition at line 100 of file Composite.cpp.

References se_core::ComponentList::Iterator::hasNext(), se_core::ComponentList::Iterator::next(), and se_core::Component::type().

Component * se_core::Composite::component int  type  ) 
 

Definition at line 83 of file Composite.cpp.

References se_core::ComponentList::Iterator::hasNext(), se_core::ComponentList::Iterator::next(), and se_core::Component::type().

Referenced by se_core::Component::component(), se_core::Component::ComponentPtr< T, type >::ComponentPtr(), se_core::SpawnComponent::get(), se_core::SignalComponent::get(), se_core::SignalAreaComponent::get(), se_core::ScriptComponent::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::Component::ComponentPtr< T, type >::operator=(), se_core::NodeComponent::parentChanged(), se_client::PlayerParser::parse(), se_basic::SimpleAreaFactory::release(), se_basic::NavMeshAreaFactory::release(), se_core::ZoneAreaComponent::setActive(), se_core::SpawnAreaComponent::setActive(), se_core::SignalAreaComponent::setActive(), se_core::CutsceneAreaComponent::setActive(), se_core::RootChildComponent::setActive(), se_basic::NavMeshAreaComponent::setActive(), se_core::SignalComponent::zoneChanged(), se_core::CollisionComponent::zoneChanged(), se_core::AreaChildComponent::zoneChanged(), and se_ogre::O3dThingComponent::zoneChanged().

const CompositeFactory* se_core::Composite::factory  )  [inline]
 

Definition at line 54 of file Composite.hpp.

Referenced by se_core::SpawnManager::performDestructions(), se_core::AreaManager::resetAll(), and se_ogre::O3dManager::updateStats().

bool se_core::Composite::hasParent  )  const [inline]
 

Does the composite have a parent?

Definition at line 60 of file Composite.hpp.

Referenced by se_core::CompSchema::inactiveRoot().

id_type se_core::Composite::id  )  const [inline]
 

Definition at line 46 of file Composite.hpp.

References id_type.

Referenced by se_core::HealthListeners::add(), se_core::HealthListeners::castHealthChangedEvent(), and se_ogre::ThingMO::hasThing().

void se_core::Composite::init bool  doTraverseChildren = true  ) 
 

Definition at line 206 of file Composite.cpp.

References se_core::CompositeList::Iterator::hasNext(), se_core::ComponentList::Iterator::hasNext(), se_core::Component::init(), se_core::CompositeList::Iterator::next(), and se_core::ComponentList::Iterator::next().

Referenced by se_core::SimEngine::initGame().

bool se_core::Composite::isActive  )  const [inline]
 

Is the composite active.

Definition at line 95 of file Composite.hpp.

bool se_core::Composite::isDead  )  const [inline]
 

Returns true if Thing is scheduled for destruction.

See also:
scheduleForDestruction

Definition at line 113 of file Composite.hpp.

Referenced by se_core::DefaultTC::_pop(), se_core::CoDefault::_pop(), and se_core::CollisionComponent::isCollideable().

const char * se_core::Composite::name  )  const
 

Definition at line 39 of file Composite.cpp.

Referenced by se_core::DefaultTC::_pop(), se_core::CoDefault::_pop(), se_core::CollisionAreaComponent::_testCollisionCandidates(), se_core::CollisionAreaComponent::_testCollisionCandidates2(), se_core::ZoneAreaComponent::addNeighbour(), se_core::Area::Area(), se_ogre::O3dAreaComponent::compileStaticGeometry(), se_ogre::ThingMOManager::create(), se_basic::SimpleAreaThingEncoder::encode(), se_core::Area::findTarget(), se_ogre::O3dAreaComponent::hasStaticGeometry(), se_core::CollisionGrid::insert(), se_core::ZoneComponent::name(), se_ogre::ThingMO::name(), se_core::DefaultTC::pop(), se_core::CoDefault::pop(), se_core::CollisionAreaComponent::removeCollideable(), se_ogre::O3dManager::updateStats(), and se_client::CameraComponent::zoneChanged().

Composite* se_core::Composite::parent  )  [inline]
 

Get parent.

Definition at line 65 of file Composite.hpp.

RefPtr& se_core::Composite::ref  )  [inline]
 

Definition at line 41 of file Composite.hpp.

References RefPtr.

Referenced by se_core::StatComponent::setItem(), se_core::SpawnComponent::setSpawner(), and se_core::StatComponent::setTarget().

void se_core::Composite::releaseComponents  ) 
 

Destroy components.

Called by factory or destructor.

Definition at line 114 of file Composite.cpp.

References se_core::Component::factory(), se_core::ComponentList::Iterator::hasNext(), se_core::ComponentList::Iterator::next(), and se_core::ComponentFactory::release().

void se_core::Composite::removeChild Composite node  )  [protected]
 

Add a Composite as a child.

Called by the childs setParent.

Definition at line 152 of file Composite.cpp.

void se_core::Composite::resetParent  ) 
 

Set parent composite to none.

Definition at line 158 of file Composite.cpp.

References se_core::ComponentList::Iterator::hasNext(), se_core::ComponentList::Iterator::next(), and se_core::Component::parentChanged().

void se_core::Composite::scheduleForDestruction  )  [virtual]
 

Schedule the Composite for destruction.

The destruction will be delayed one or two AI steps before it is actually destroyed, to make sure that any reference to and Action upon the Thing in the world has a chance to be resolved first.

Definition at line 250 of file Composite.cpp.

References se_core::ComponentList::Iterator::hasNext(), se_core::ComponentList::Iterator::next(), and se_core::Component::setDead().

Referenced by se_basic::PhTrackingCamera::affect(), se_core::DefaultTC::popAndDie(), se_core::CoDefault::popAndDie(), se_core::Area::reset(), and se_core::Actor::scheduleForDestruction().

void se_core::Composite::setActive bool  state,
bool  doTraverseChildren = true
 

Set composite state to active.

Typically used for paging in active game zones.

Definition at line 51 of file Composite.cpp.

References se_core::ComponentList::Iterator::hasNext(), se_core::CompositeList::Iterator::hasNext(), se_core::ComponentList::Iterator::next(), se_core::CompositeList::Iterator::next(), and se_core::Component::setActive().

Referenced by se_core::SimEngine::go(), and se_core::SimEngine::perform().

void se_core::Composite::setFactory const CompositeFactory f  )  [inline]
 

Definition at line 55 of file Composite.hpp.

Referenced by se_core::AreaManager::createArea().

void se_core::Composite::setParent Composite p  ) 
 

Set the parent composite.

Definition at line 175 of file Composite.cpp.

References addChild(), se_core::ComponentList::Iterator::hasNext(), se_core::ComponentList::Iterator::next(), and se_core::Component::parentChanged().

Referenced by se_core::AreaManager::setActive(), se_core::AreaManager::setInactive(), and se_core::SpawnAreaComponent::spawn().

void se_core::Composite::setTag int  t  )  [inline]
 

Definition at line 97 of file Composite.hpp.

Referenced by se_basic::SimpleActorFactory::create().

int se_core::Composite::tag  )  const [inline]
 

Definition at line 98 of file Composite.hpp.

int se_core::Composite::type  )  const
 

Definition at line 45 of file Composite.cpp.

void se_core::Composite::zoneChanged int  type,
Composite newZone,
Composite oldZone
 

Called during flip is area is changed from pos to nextPos.

Definition at line 196 of file Composite.cpp.

References se_core::ComponentList::Iterator::hasNext(), se_core::ComponentList::Iterator::next(), and se_core::Component::zoneChanged().

Referenced by se_core::PosComponent::flip().


Friends And Related Function Documentation

friend class Component [friend]
 

Definition at line 126 of file Composite.hpp.


Member Data Documentation

CompositeList se_core::Composite::children_ [protected]
 

Definition at line 155 of file Composite.hpp.

ComponentList se_core::Composite::components_ [protected]
 

Definition at line 152 of file Composite.hpp.

const CompositeFactory* se_core::Composite::factory_ [protected]
 

Definition at line 147 of file Composite.hpp.

Component* se_core::Composite::fastComponents_[16] [protected]
 

Definition at line 157 of file Composite.hpp.

bool se_core::Composite::isActive_ [protected]
 

Definition at line 149 of file Composite.hpp.

bool se_core::Composite::isDead_ [protected]
 

Definition at line 150 of file Composite.hpp.

const char* se_core::Composite::name_ [protected]
 

Definition at line 146 of file Composite.hpp.

Composite* se_core::Composite::parent_ [protected]
 

Definition at line 154 of file Composite.hpp.

RefPtr se_core::Composite::ptr_ [protected]
 

Reference counted pointer.

Definition at line 163 of file Composite.hpp.

int se_core::Composite::tag_ [protected]
 

Definition at line 148 of file Composite.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:23 2007 by Doxygen version 1.3.9.1.

SourceForge.net Logo