gSpawnPoint Class Reference

#include <gSpawn.h>

List of all members.

Public Member Functions

 gSpawnPoint (const eCoord &loc, const eCoord &dir)
 ~gSpawnPoint ()
void Spawn (eCoord &loc, eCoord &dir)
REAL Danger ()
void Clear ()

Private Attributes

int id
eCoord location
eCoord direction
REAL lastTimeUsed
int numberOfUses

Friends

class gArena


Detailed Description

Definition at line 33 of file gSpawn.h.


Constructor & Destructor Documentation

gSpawnPoint::gSpawnPoint ( const eCoord &  loc,
const eCoord &  dir 
)

Definition at line 41 of file gSpawn.cpp.

00042         :id(-1),location(loc),direction(dir),
00043 lastTimeUsed(se_GameTime()-1000000),numberOfUses(0){}

gSpawnPoint::~gSpawnPoint (  )  [inline]

Definition at line 43 of file gSpawn.h.

00043 {};


Member Function Documentation

void gSpawnPoint::Spawn ( eCoord &  loc,
eCoord &  dir 
)

Definition at line 46 of file gSpawn.cpp.

References d, direction, lastTimeUsed, location, numberOfUses, se_GameTime(), sg_spawnBack, sg_spawnSide, gArena::SizeMultiplier(), and gCycleMovement::SpeedMultiplier().

Referenced by init_game_objects(), and sg_RespawnPlayer().

00046                                               {
00047     /*
00048     if (ArmageTronTimer-lastTimeUsed>100)
00049       numberOfUses=0;
00050     */
00051 
00052     int d,away;
00053     if (numberOfUses%2==1){
00054         d=1;
00055         away=(numberOfUses+1)/2;
00056     }
00057     else{
00058         d=-1;
00059         away=numberOfUses/2;
00060     }
00061 
00062     dir=direction;
00063 
00064     loc=location * gArena::SizeMultiplier() - dir.Turn(sg_spawnBack,-d*sg_spawnSide) * away * gCycle::SpeedMultiplier();
00065 
00066     lastTimeUsed=se_GameTime();
00067     numberOfUses++;
00068 
00069 }

Here is the call graph for this function:

Here is the caller graph for this function:

REAL gSpawnPoint::Danger (  ) 

Definition at line 72 of file gSpawn.cpp.

References lastTimeUsed, numberOfUses, and se_GameTime().

00072                         {
00073     return numberOfUses+(100/(se_GameTime()+10-lastTimeUsed));
00074 }

Here is the call graph for this function:

void gSpawnPoint::Clear ( void   ) 

Definition at line 76 of file gSpawn.cpp.

References lastTimeUsed, numberOfUses, and se_GameTime().

00076                        {
00077     lastTimeUsed=se_GameTime()-1000000;
00078     numberOfUses=0;
00079 }

Here is the call graph for this function:


Friends And Related Function Documentation

friend class gArena [friend]

Definition at line 34 of file gSpawn.h.


Member Data Documentation

int gSpawnPoint::id [private]

Definition at line 36 of file gSpawn.h.

Referenced by gArena::NewSpawnPoint(), gArena::RemoveAllSpawn(), and gArena::~gArena().

eCoord gSpawnPoint::location [private]

Definition at line 37 of file gSpawn.h.

Referenced by Spawn().

eCoord gSpawnPoint::direction [private]

Definition at line 37 of file gSpawn.h.

Referenced by Spawn().

REAL gSpawnPoint::lastTimeUsed [private]

Definition at line 38 of file gSpawn.h.

Referenced by Clear(), Danger(), and Spawn().

int gSpawnPoint::numberOfUses [private]

Definition at line 39 of file gSpawn.h.

Referenced by Clear(), Danger(), and Spawn().


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