gSensor Class Reference

#include <gSensor.h>

Inheritance diagram for gSensor:

Inheritance graph
[legend]
Collaboration diagram for gSensor:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 gSensor (eGameObject *o, const eCoord &start, const eCoord &d)
virtual void PassEdge (const eWall *w, REAL time, REAL, int=1)

Public Attributes

gSensorWallType type


Detailed Description

Definition at line 39 of file gSensor.h.


Constructor & Destructor Documentation

gSensor::gSensor ( eGameObject o,
const eCoord &  start,
const eCoord &  d 
) [inline]

Definition at line 43 of file gSensor.h.

00044             :eSensor(o,start,d), type(gSENSOR_NONE){}


Member Function Documentation

void gSensor::PassEdge ( const eWall w,
REAL  time,
REAL  a,
int  r = 1 
) [virtual]

Reimplemented from eSensor.

Reimplemented in gCycleChatBot::Sensor.

Definition at line 35 of file gSensor.cpp.

References gPlayerWall::BegTime(), gPlayerWall::Cycle(), gPlayerWall::EndTime(), gSENSOR_ENEMY, gSENSOR_RIM, gSENSOR_SELF, gSENSOR_TEAMMATE, gCycle::IsMe(), eSensor::lr, eSensor::PassEdge(), eGameObject::Team(), and type.

Referenced by gCycleChatBot::Sensor::PassEdge().

00035                                                             {
00036     if (!ww)
00037         return;
00038 
00039     try{
00040         eSensor::PassEdge(ww,time,a,r);
00041     }
00042     catch( eSensorFinished & e )
00043     {
00044         const gPlayerWall *w=dynamic_cast<const gPlayerWall*>(ww);
00045         if (w)
00046         {
00047             gCycle *owner=w->Cycle();
00048             if (owner && owner->IsMe( owned ) )
00049             {
00050                 type=gSENSOR_SELF;
00051             }
00052             else if ( owner && owned && owner->Team() == owned->Team() )
00053             {
00054                 type=gSENSOR_TEAMMATE;
00055             }
00056             else
00057             {
00058                 type=gSENSOR_ENEMY;
00059             }
00060 
00061             if (w->EndTime() < w->BegTime())
00062                 lr=-lr;
00063         }
00064         else if (dynamic_cast<const gWallRim*>(ww))
00065             type=gSENSOR_RIM;
00066 
00067         throw;
00068     }
00069 }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

gSensorWallType gSensor::type

Definition at line 41 of file gSensor.h.

Referenced by gHitData::AddHit(), blocks(), gCycleMovement::CalculateAcceleration(), gCycleChatBot::Distance(), gCycleMovement::DoTurn(), gCycleChatBot::FindHugReplacement(), and PassEdge().


The documentation for this class was generated from the following files:
Generated on Sat Mar 15 23:44:51 2008 for Armagetron Advanced by  doxygen 1.5.4