Pacman Torben Petré
Loading...
Searching...
No Matches
logic::AbstractFactory Class Referenceabstract

Interface for creating game entities. More...

#include <AbstractFactory.h>

Inheritance diagram for logic::AbstractFactory:

Public Member Functions

virtual ~AbstractFactory ()=default
virtual std::shared_ptr< PacmanModelcreatePacMan (float x, float y, float mapWidth, float mapHeight)=0
 Creates a Pacman entity.
virtual std::shared_ptr< ChasingGhostcreateBlinky (float x, float y, float mapWidth, float mapHeight)=0
 Creates a ChasingGhost entity (Blinky's chasing personality).
virtual std::shared_ptr< AmbushGhostcreatePinky (float x, float y, float mapWidth, float mapHeight)=0
 Creates a AmbushGhost entity (Pinky's chasing personality).
virtual std::shared_ptr< AmbushGhostcreateInky (float x, float y, float mapWidth, float mapHeight)=0
 Creates a AmbushGhost entity (Inky's chasing personality).
virtual std::shared_ptr< RandomGhostcreateClyde (float x, float y, float mapWidth, float mapHeight)=0
 Creates a RandomGhost entity (Clyde's chasing personality).
virtual std::shared_ptr< WallModelcreateWall (float x, float y, char type)=0
 Creates a Wall entity.
virtual std::shared_ptr< CoinModelcreateCoin (float x, float y)=0
 Creates a Coin entity.
virtual std::shared_ptr< FruitModelcreateFruit (float x, float y)=0
 Creates a Fruit entity.

Detailed Description

Interface for creating game entities.

Defines the contract that allows the World to create entities without depending on graphical implementations.

Constructor & Destructor Documentation

◆ ~AbstractFactory()

virtual logic::AbstractFactory::~AbstractFactory ( )
virtualdefault

Member Function Documentation

◆ createBlinky()

virtual std::shared_ptr< ChasingGhost > logic::AbstractFactory::createBlinky ( float x,
float y,
float mapWidth,
float mapHeight )
pure virtual

Creates a ChasingGhost entity (Blinky's chasing personality).

Parameters
xNormalized initial x position
yNormalized initial y position
mapWidthAmount of horizontal tiles
mapHeightAmount of vertical tiles
Returns
A shared pointer to the ChasingGhost.

Implemented in ConcreteFactory.

◆ createClyde()

virtual std::shared_ptr< RandomGhost > logic::AbstractFactory::createClyde ( float x,
float y,
float mapWidth,
float mapHeight )
pure virtual

Creates a RandomGhost entity (Clyde's chasing personality).

Parameters
xNormalized initial x position
yNormalized initial y position
mapWidthAmount of horizontal tiles
mapHeightAmount of vertical tiles
Returns
A shared pointer to the RandomGhost.

Implemented in ConcreteFactory.

◆ createCoin()

virtual std::shared_ptr< CoinModel > logic::AbstractFactory::createCoin ( float x,
float y )
pure virtual

Creates a Coin entity.

Parameters
xNormalized initial x position
yNormalized initial y position
Returns
A shared pointer to the Coin.

Implemented in ConcreteFactory.

◆ createFruit()

virtual std::shared_ptr< FruitModel > logic::AbstractFactory::createFruit ( float x,
float y )
pure virtual

Creates a Fruit entity.

Parameters
xNormalized initial x position
yNormalized initial y position
Returns
A shared pointer to the Fruit.

Implemented in ConcreteFactory.

◆ createInky()

virtual std::shared_ptr< AmbushGhost > logic::AbstractFactory::createInky ( float x,
float y,
float mapWidth,
float mapHeight )
pure virtual

Creates a AmbushGhost entity (Inky's chasing personality).

Parameters
xNormalized initial x position
yNormalized initial y position
mapWidthAmount of horizontal tiles
mapHeightAmount of vertical tiles
Returns
A shared pointer to the AmbushGhost.

Implemented in ConcreteFactory.

◆ createPacMan()

virtual std::shared_ptr< PacmanModel > logic::AbstractFactory::createPacMan ( float x,
float y,
float mapWidth,
float mapHeight )
pure virtual

Creates a Pacman entity.

Parameters
xNormalized initial x position
yNormalized initial y position
mapWidthAmount of horizontal tiles
mapHeightAmount of vertical tiles
Returns
A shared pointer to the PacmanModel.

Implemented in ConcreteFactory.

◆ createPinky()

virtual std::shared_ptr< AmbushGhost > logic::AbstractFactory::createPinky ( float x,
float y,
float mapWidth,
float mapHeight )
pure virtual

Creates a AmbushGhost entity (Pinky's chasing personality).

Parameters
xNormalized initial x position
yNormalized initial y position
mapWidthAmount of horizontal tiles
mapHeightAmount of vertical tiles
Returns
A shared pointer to the AmbushGhost.

Implemented in ConcreteFactory.

◆ createWall()

virtual std::shared_ptr< WallModel > logic::AbstractFactory::createWall ( float x,
float y,
char type )
pure virtual

Creates a Wall entity.

Parameters
xNormalized initial x position
yNormalized initial y position
typeUsed by to determine the sprite of the view and whether the model is a door
Returns
A shared pointer to the Wall.

Implemented in ConcreteFactory.


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