se_core::Area Class Reference

#include <Area.hpp>

Inheritance diagram for se_core::Area:

se_core::Component se_basic::NavMeshArea se_basic::SimpleArea List of all members.

Public Types

typedef ComponentPtr< Area,
sct_BLOB > 
Ptr

Public Member Functions

 Area (Composite *owner, const ComponentFactory *factory, coor_tile_t w, coor_tile_t h)
 Create a new area of a given size.
virtual ~Area ()
 Destructor.
virtual coor_t groundHeight (const Point3 &coor, short index=-1) const =0
 Height of ground (y-coordinate) at given (coor.x_, coor.z_).
virtual short index (const Point3 &wc, short oldIndex=-1) const =0
 Some area types maintain an index with positions.
virtual bool doesTouchVoid (const Point3 &wc, short index, coor_t radius) const =0
void saveThings ()
 Save area to a stream.
virtual void force (const Point3 &coor, Vector3 &dest) const =0
coor_tile_t width () const
coor_tile_t height () const
coor_world_t pagePosX () const
coor_world_t pagePosZ () const
bool isLegalCoor (coor_tile_t x, coor_tile_t y) const
bool isLegalLocalCoor (const Point3 &localCoor) const
bool isLegalWorldCoor (const Point3 &worldCoor) const
virtual short terrainStyle (const Point3 &coor, short index=-1) const =0
virtual short nextTerrainStyle (bray_t direction, const Point3 &coor)=0
virtual long touchedTerrain (const Point3 &centre, coor_t radius) const
 Wall collision utility method.
virtual long touchedTerrain (const Point3 &from, const Point3 &to) const
 Line of sight utility method.
CompositefindTarget (const char *factoryName, const Point3 &worldCoor) const
void reset ()
Areaneighbour (short relX, short relY, short relZ)
 Get neighbour.
const Areaneighbour (short relX, short relY, short relZ) const
Areaneighbour (const Point3 &worldCoor)
const Areaneighbour (const Point3 &worldCoor) const
bool addNeighbour (Area *area)
 Check if the area passed in is a neighbour, and if so, register it as such.
virtual bool isNeighbour (const Area &area) const
void flipSpawns (void)
 Flip all moving things in this area, making their nextPos() their pos().
Compositespawn (const char *thingName, const ViewPoint &coor, long deniedTsMask=0, PosComponent *parent=0)
 Spawn a new thing in this area.
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

long tsMask (short ts)

Protected Member Functions

virtual void setActive (bool state)
 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.
virtual void cleanup ()
 Called by Composite.

Protected Attributes

coor_tile_t width_
coor_tile_t height_
PosComponentposComponent_
SpawnAreaComponentspawnAreaComponent_
ScriptComponentscriptComponent_
ActionComponentactionComponent_
CollisionAreaComponentcollisionAreaComponent_
PhysicsAreaComponentphysicsAreaComponent_
SignalAreaComponentsignalAreaComponent_
ZoneAreaComponentzoneAreaComponent_
int type_
 The type of Component.
Compositeowner_
const ComponentFactoryfactory_

Friends

class Composite

Member Typedef Documentation

typedef ComponentPtr<Area, sct_BLOB> se_core::Area::Ptr
 

Reimplemented in se_basic::NavMeshArea, and se_basic::SimpleArea.

Definition at line 50 of file Area.hpp.


Constructor & Destructor Documentation

se_core::Area::Area Composite owner,
const ComponentFactory factory,
coor_tile_t  w,
coor_tile_t  h
 

Create a new area of a given size.

Definition at line 56 of file Area.cpp.

References se_core::AreaEdge::addLink(), coor_t, LogDetail, se_core::Composite::name(), se_core::sct_BLOB, se_core::BoundingBox::setMax(), and se_core::BoundingBox::setMin().

se_core::Area::~Area  )  [virtual]
 

Destructor.

Definition at line 94 of file Area.cpp.

References LogDetail.


Member Function Documentation

bool se_core::Area::addNeighbour Area area  ) 
 

Check if the area passed in is a neighbour, and if so, register it as such.

Returns:
true if the passed in area is a neighbour

Definition at line 266 of file Area.cpp.

References Assert, AssertWarning, coor_t, isNeighbour(), se_core::Component::name(), se_core::ZoneAreaComponent::page(), se_core::AreaEdge::removeLink(), se_core::Page::x_, se_core::Page::z_, and zoneAreaComponent_.

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

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

Called by Composite.

Reimplemented in se_core::NodeComponent, se_core::RootComponent, se_core::ActionComponent, se_core::CutsceneComponent, se_core::PosComponent, se_core::ScriptComponent, se_core::SignalAreaComponent, se_core::SignalComponent, se_core::SpawnComponent, se_ogre::O3dAreaComponent, se_ogre::O3dThingComponent, and se_basic::NavMeshComponent.

Definition at line 47 of file Component.cpp.

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

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().

virtual bool se_core::Area::doesTouchVoid const Point3 wc,
short  index,
coor_t  radius
const [pure virtual]
 

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

Definition at line 81 of file Component.hpp.

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

Composite * se_core::Area::findTarget const char *  factoryName,
const Point3 worldCoor
const
 

Definition at line 158 of file Area.cpp.

References coor_double_t, se_core::Point3::distanceSquared(), se_core::CompositeList::Iterator::hasNext(), se_core::Composite::name(), and se_core::CompositeList::Iterator::next().

void se_core::Area::flipSpawns void   ) 
 

Flip all moving things in this area, making their nextPos() their pos().

This method is called on active areas by the SimEngine class in the beginning of each step.

Definition at line 360 of file Area.cpp.

Referenced by se_basic::SimpleAreaThingParser::parse().

virtual void se_core::Area::force const Point3 coor,
Vector3 dest
const [pure virtual]
 

virtual coor_t se_core::Area::groundHeight const Point3 coor,
short  index = -1
const [pure virtual]
 

Height of ground (y-coordinate) at given (coor.x_, coor.z_).

coor_tile_t se_core::Area::height  )  const [inline]
 

Definition at line 84 of file Area.hpp.

References coor_tile_t.

Referenced by se_core::AreaManager::addArea(), se_basic::SimpleAreaFactory::create(), and se_basic::NavMeshAreaFactory::create().

virtual short se_core::Area::index const Point3 wc,
short  oldIndex = -1
const [pure virtual]
 

Some area types maintain an index with positions.

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().

bool se_core::Area::isLegalCoor coor_tile_t  x,
coor_tile_t  y
const [inline]
 

Definition at line 95 of file Area.hpp.

bool se_core::Area::isLegalLocalCoor const Point3 localCoor  )  const [inline]
 

Definition at line 99 of file Area.hpp.

References se_core::Tuple3::x_, se_core::Point3::xTile(), se_core::Tuple3::z_, and se_core::Point3::zTile().

bool se_core::Area::isLegalWorldCoor const Point3 worldCoor  )  const [inline]
 

Definition at line 108 of file Area.hpp.

References se_core::Tuple3::x_, se_core::Point3::xTile(), se_core::Tuple3::z_, and se_core::Point3::zTile().

bool se_core::Area::isNeighbour const Area area  )  const [virtual]
 

Reimplemented in se_basic::NavMeshArea.

Definition at line 258 of file Area.cpp.

References se_core::Page::isNeighbourOffset(), se_core::Page::x_, se_core::Page::z_, and zoneAreaComponent_.

Referenced by se_core::AreaManager::addArea(), and addNeighbour().

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 addNeighbour(), se_core::DefaultTC::collide(), se_core::CoDefault::collide(), se_basic::Say::perform(), and se_ogre::SpeechBubble::speechEvent().

const Area * se_core::Area::neighbour const Point3 worldCoor  )  const
 

Definition at line 339 of file Area.cpp.

References coor_t, se_core::Tuple3::x_, and se_core::Tuple3::z_.

Area * se_core::Area::neighbour const Point3 worldCoor  ) 
 

Definition at line 318 of file Area.cpp.

References coor_t, se_core::Tuple3::x_, and se_core::Tuple3::z_.

const Area * se_core::Area::neighbour short  relX,
short  relY,
short  relZ
const
 

Definition at line 310 of file Area.cpp.

Area * se_core::Area::neighbour short  relX,
short  relY,
short  relZ
 

Get neighbour.

Parameters:
relX 
relY 

Definition at line 302 of file Area.cpp.

virtual short se_core::Area::nextTerrainStyle bray_t  direction,
const Point3 coor
[pure virtual]
 

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(), 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::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().

coor_world_t se_core::Area::pagePosX  )  const [inline]
 

Definition at line 86 of file Area.hpp.

References coor_world_t.

coor_world_t se_core::Area::pagePosZ  )  const [inline]
 

Definition at line 90 of file Area.hpp.

References coor_world_t.

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::Area::reset  ) 
 

Definition at line 239 of file Area.cpp.

References se_core::CompositeList::TreeIterator::hasNext(), se_core::CompositeList::TreeIterator::next(), and se_core::Composite::scheduleForDestruction().

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

void se_core::Area::saveThings  ) 
 

Save area to a stream.

Todo:
: NOT YET IMPLEMENTED.

Definition at line 108 of file Area.cpp.

References Dump, and log_msg().

virtual void se_core::Component::setActive bool  state  )  [inline, protected, virtual, inherited]
 

Called by Composite.

Reimplemented in se_core::RootChildComponent, se_core::ActionComponent, se_core::CutsceneAreaComponent, se_core::PhysicsAreaComponent, se_core::CollisionAreaComponent, se_core::ScriptComponent, se_core::SignalAreaComponent, se_core::SpawnAreaComponent, se_core::ZoneAreaComponent, se_client::CameraComponent, se_client::PlayerComponent, se_ogre::O3dAreaComponent, se_ogre::O3dThingComponent, and se_basic::NavMeshAreaComponent.

Definition at line 93 of file Component.hpp.

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

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().

Composite * se_core::Area::spawn const char *  thingName,
const ViewPoint coor,
long  deniedTsMask = 0,
PosComponent parent = 0
 

Spawn a new thing in this area.

Spawning should be done this way, because a thing not belonging to an area will never be flip()'ed.

Definition at line 367 of file Area.cpp.

References se_core::ViewPoint::coor_, and LogDetail.

virtual short se_core::Area::terrainStyle const Point3 coor,
short  index = -1
const [pure virtual]
 

long se_core::Area::touchedTerrain const Point3 from,
const Point3 to
const [virtual]
 

Line of sight utility method.

Definition at line 408 of file Area.cpp.

References abs, se_core::Point3::xTile(), and se_core::Point3::zTile().

long se_core::Area::touchedTerrain const Point3 centre,
coor_t  radius
const [virtual]
 

Wall collision utility method.

Definition at line 379 of file Area.cpp.

References se_core::Tuple3::add(), coor_t, and se_core::Tuple3::set().

long se_core::Area::tsMask short  ts  )  [inline, static]
 

Definition at line 118 of file Area.hpp.

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

Definition at line 76 of file Component.hpp.

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

coor_tile_t se_core::Area::width  )  const [inline]
 

Definition at line 83 of file Area.hpp.

References coor_tile_t.

Referenced by se_core::AreaManager::addArea(), se_basic::SimpleAreaFactory::create(), and se_basic::NavMeshAreaFactory::create().

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::Area::actionComponent_ [protected]
 

Definition at line 172 of file Area.hpp.

CollisionAreaComponent* se_core::Area::collisionAreaComponent_ [protected]
 

Definition at line 173 of file Area.hpp.

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

Definition at line 120 of file Component.hpp.

coor_tile_t se_core::Area::height_ [protected]
 

Definition at line 167 of file Area.hpp.

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

Definition at line 118 of file Component.hpp.

PhysicsAreaComponent* se_core::Area::physicsAreaComponent_ [protected]
 

Definition at line 174 of file Area.hpp.

PosComponent* se_core::Area::posComponent_ [protected]
 

Definition at line 169 of file Area.hpp.

Referenced by se_basic::NavMeshArea::farthestLineOfSight().

ScriptComponent* se_core::Area::scriptComponent_ [protected]
 

Definition at line 171 of file Area.hpp.

SignalAreaComponent* se_core::Area::signalAreaComponent_ [protected]
 

Definition at line 175 of file Area.hpp.

SpawnAreaComponent* se_core::Area::spawnAreaComponent_ [protected]
 

Definition at line 170 of file Area.hpp.

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

The type of Component.

Definition at line 117 of file Component.hpp.

coor_tile_t se_core::Area::width_ [protected]
 

Definition at line 167 of file Area.hpp.

ZoneAreaComponent* se_core::Area::zoneAreaComponent_ [protected]
 

Definition at line 176 of file Area.hpp.

Referenced by addNeighbour(), and isNeighbour().


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

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

SourceForge.net Logo