Pac-Man
Public Member Functions | Protected Member Functions | List of all members
CRedGhost Class Reference

CRedGhost is class that represents Red Ghost. More...

#include <CRedGhost.h>

Inheritance diagram for CRedGhost:
Inheritance graph
Collaboration diagram for CRedGhost:
Collaboration graph

Public Member Functions

 CRedGhost (const CMap &map, const SCoordinates &homeLocation)
 A constructor constructs new Red Ghost. More...
 
SGameObjectInfo getObjectInfo (const CGameInfo &gameInfo) const override
 Method implements CGhost virtual method.
 
pair< bool, SMainEntityInfogetMainEntityInfo () const override
 Returns info in category SMainEntityInfo. More...
 
- Public Member Functions inherited from CGhost
 CGhost (const CMap &map, const SCoordinates &homeLocation)
 It initializes new ghost. More...
 
virtual SCoordinates move (const CMap &map, const SMainEntitiesInfo &mainEntitiesInfo, const CGameInfo &gameInfo)
 It does general CGhost move behaviour. More...
 
void reset (const CMap &map)
 Method for resetting the ghost to the beginning state. More...
 
void killed (const CMap &map, uint32_t time)
 The method by which ghost is informed about his death. More...
 
bool canKill (const CGameInfo &gameInfo) const
 Returns information whether the ghost can kill player. More...
 
bool canBeKilled (const CGameInfo &gameInfo) const
 Returns information whether the ghost can be killed. More...
 
- Public Member Functions inherited from CMovingObject
 CMovingObject (const CMap &map, const SCoordinates &location)
 A constructor of the moving object. More...
 
bool isOnIntersection () const
 checks whether is object on intersection More...
 

Protected Member Functions

SCoordinates getTargetCoordinates (const CMap &map, const SMainEntitiesInfo &mainEntitiesInfo, const CGameInfo &gameInfo) override
 Specific implementation of CGhost method for Red Ghost.
 
- Protected Member Functions inherited from CGhost
EDirection generalGhostDecision (const CMap &map, const SCoordinates &targetCoords)
 Decides what would be the direction which would be chosen for next move. More...
 
- Protected Member Functions inherited from CMovingObject
void reset (const CMap &map, SCoordinates &coordinates)
 Method resets the moving object to initial state. More...
 
float innerGridMove (const SCoordinates &moveVector)
 Method that do the move in the space. More...
 
EGameObject getTileInDirection (const CMap &map, EDirection direction) const
 Method returns neighbour tile from map in given direction. More...
 

Additional Inherited Members

- Public Types inherited from CMovingObject
enum  EDirection {
  DIRECTION_LEFT, DIRECTION_UP, DIRECTION_RIGHT, DIRECTION_DOWN,
  NO_DIRECTION
}
 Enum of all directions that can moving object go in.
 
- Static Protected Member Functions inherited from CGhost
static bool canStepOn (EGameObject &object)
 Decides if ghost can step on given map object. More...
 
- Static Protected Member Functions inherited from CMovingObject
static EDirection getOpositeDirectionTo (EDirection directon)
 Method returns opposite direction to given direction. More...
 
static SCoordinates getMoveVector (EDirection direction, float speed)
 Method returns move vector constructed from given arguments. More...
 
- Protected Attributes inherited from CGhost
SCoordinates homeLocation_
 home location of the ghost
 
uint32_t timeOfDeath_ = 0
 time when the ghost was killed
 
bool alive_
 information if is the ghost alive
 
bool randomTileSet_
 information if a new random tile was set
 
SCoordinates randomTile_
 random tile is there for random target of the ghost
 
EDirection goingFromDirection_
 holds the direction from which is the ghost going
 
- Protected Attributes inherited from CMovingObject
CMap::CMapCoordinates location_
 

Detailed Description

CRedGhost is class that represents Red Ghost.

Constructor & Destructor Documentation

◆ CRedGhost()

CRedGhost::CRedGhost ( const CMap map,
const SCoordinates homeLocation 
)

A constructor constructs new Red Ghost.

Parameters
[in]mapmap in which the ghost will be
[in]homeLocationstart and home location for the ghost

Member Function Documentation

◆ getMainEntityInfo()

pair< bool, SMainEntityInfo > CRedGhost::getMainEntityInfo ( ) const
overridevirtual

Returns info in category SMainEntityInfo.

Returns
pair with a bool if the entity is a main entity and if is the second return value (info in category SMainEntityInfo) valid

Reimplemented from CGhost.


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