HOG2
Public Member Functions | Private Member Functions | Private Attributes | List of all members
rewardSeekingUnit Class Reference

#include <RewardUnit.h>

Inheritance diagram for rewardSeekingUnit:
Inheritance graph
[legend]
Collaboration diagram for rewardSeekingUnit:
Collaboration graph
[legend]

Public Member Functions

 rewardSeekingUnit (int x, int y)
 
virtual const char * GetName ()
 
virtual void receiveReward (double)
 
virtual tDirection makeMove (MapProvider *, reservationProvider *, SimulationInfo *simInfo)
 
void OpenGLDraw (const MapProvider *, const SimulationInfo *) const
 
void addRewardLocation (rewardUnit *)
 
- Public Member Functions inherited from rewardUnit
 rewardUnit (int x, int y)
 
virtual double sendReward ()
 
void OpenGLDraw (const MapProvider *, const SimulationInfo *) const
 

Private Member Functions

double goToRewardLoc (MapAbstraction *aMap, int which)
 
void addPathToCache (path *p)
 

Private Attributes

std::vector< tDirectionmoves
 
std::vector< rewardUnit * > rewardLocs
 
aStar a
 

Detailed Description

Definition at line 28 of file RewardUnit.h.

Constructor & Destructor Documentation

◆ rewardSeekingUnit()

rewardSeekingUnit::rewardSeekingUnit ( int  x,
int  y 
)

Definition at line 31 of file RewardUnit.cpp.

Member Function Documentation

◆ addPathToCache()

void rewardSeekingUnit::addPathToCache ( path p)
private

◆ addRewardLocation()

void rewardSeekingUnit::addRewardLocation ( rewardUnit ru)

Definition at line 104 of file RewardUnit.cpp.

References rewardLocs.

◆ GetName()

virtual const char* rewardSeekingUnit::GetName ( )
inlinevirtual

Reimplemented from rewardUnit.

Definition at line 31 of file RewardUnit.h.

Referenced by addPathToCache(), and receiveReward().

◆ goToRewardLoc()

double rewardSeekingUnit::goToRewardLoc ( MapAbstraction *  aMap,
int  which 
)
private

Definition at line 61 of file RewardUnit.cpp.

References a, addPathToCache(), aStar::GetPath(), and rewardLocs.

Referenced by makeMove().

◆ makeMove()

tDirection rewardSeekingUnit::makeMove ( MapProvider mp,
reservationProvider ,
SimulationInfo simInfo 
)
virtual

Definition at line 42 of file RewardUnit.cpp.

References MapProvider::GetMapAbstraction(), goToRewardLoc(), kStay, moves, and rewardLocs.

◆ OpenGLDraw()

void rewardSeekingUnit::OpenGLDraw ( const MapProvider mp,
const SimulationInfo  
) const

Definition at line 79 of file RewardUnit.cpp.

References MapProvider::GetMap(), Map::GetOpenGLCoord(), kE, kN, kS, kW, and moves.

◆ receiveReward()

void rewardSeekingUnit::receiveReward ( double  amount)
virtual

Reimplemented from rewardUnit.

Definition at line 37 of file RewardUnit.cpp.

References GetName().

Member Data Documentation

◆ a

aStar rewardSeekingUnit::a
private

Definition at line 41 of file RewardUnit.h.

Referenced by goToRewardLoc().

◆ moves

std::vector<tDirection> rewardSeekingUnit::moves
private

Definition at line 39 of file RewardUnit.h.

Referenced by addPathToCache(), makeMove(), and OpenGLDraw().

◆ rewardLocs

std::vector<rewardUnit *> rewardSeekingUnit::rewardLocs
private

Definition at line 40 of file RewardUnit.h.

Referenced by addRewardLocation(), goToRewardLoc(), and makeMove().


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