gWinZoneHack Class Reference

win zone: lets players who enter win the round More...

#include <gWinZone.h>

Inheritance diagram for gWinZoneHack:

Inheritance graph
[legend]
Collaboration diagram for gWinZoneHack:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 gWinZoneHack (eGrid *grid, const eCoord &pos)
 local constructor
 gWinZoneHack (nMessage &m)
 network constructor
 ~gWinZoneHack ()
 destructor

Private Member Functions

virtual void OnEnter (gCycle *target, REAL time)
 reacts on objects inside the zone (declares them the winner)


Detailed Description

win zone: lets players who enter win the round

Definition at line 120 of file gWinZone.h.


Constructor & Destructor Documentation

gWinZoneHack::gWinZoneHack ( eGrid grid,
const eCoord &  pos 
)

local constructor

Parameters:
grid Grid to put the zone into
pos Position to spawn the zone at

Definition at line 588 of file gWinZone.cpp.

References tColor::b_, gZone::color_, tColor::g_, and tColor::r_.

00589         :gZone( grid, pos )
00590 {
00591     color_.r_ = 0.0f;
00592     color_.g_ = 1.0f;
00593     color_.b_ = 0.0f;
00594 }

gWinZoneHack::gWinZoneHack ( nMessage m  ) 

network constructor

Parameters:
m Message to read creation data from
null 

Definition at line 607 of file gWinZone.cpp.

00608         : gZone( m )
00609 {
00610 }

gWinZoneHack::~gWinZoneHack ( void   ) 

destructor

Definition at line 621 of file gWinZone.cpp.

00622 {
00623 }


Member Function Documentation

void gWinZoneHack::OnEnter ( gCycle target,
REAL  time 
) [private, virtual]

reacts on objects inside the zone (declares them the winner)

Parameters:
target the cycle that has been found inside the zone
time the current time

Reimplemented from gZone.

Definition at line 636 of file gWinZone.cpp.

References ePlayerNetID::CurrentTeam(), gZone::GetExpansionSpeed(), gZone::GetRadius(), eNetGameObject::Player(), nNetObject::RequestSync(), gZone::SetExpansionSpeed(), gZone::SetReferenceTime(), and sg_DeclareWinner().

00637 {
00638     static const char* message="$player_win_instant";
00639     sg_DeclareWinner( target->Player()->CurrentTeam(), message );
00640 
00641     // let zone vanish
00642     if ( GetExpansionSpeed() >= 0 )
00643     {
00644         SetReferenceTime();
00645         SetExpansionSpeed( -GetRadius()*.5 );
00646         RequestSync();
00647     }
00648 }

Here is the call graph for this function:


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