Pacman Torben Petré
Loading...
Searching...
No Matches
logic::CoinModel Class Referencefinal

#include <CoinModel.h>

Inheritance diagram for logic::CoinModel:
Collaboration diagram for logic::CoinModel:

Public Member Functions

 CoinModel (float normalizedX, float normalizedY)
 Constructs a Coin model. Coins can be picked up by Pacman.
Events collect () override
 To be called when Pacman interacts with this Coin. Will notify its observers.
Public Member Functions inherited from logic::CollectibleEntityModel
 CollectibleEntityModel (float normalizedX, float normalizedY)
 Subclass of EntityModel to be used by collectible entities.
Public Member Functions inherited from logic::EntityModel
 EntityModel (float normalizedX, float normalizedY)
 Base class for entities.
 ~EntityModel () override=default
float getX () const
float getY () const
Public Member Functions inherited from logic::Subject
virtual ~Subject ()=default
void attach (const std::shared_ptr< Observer > &observer)
 Attaches an observer to this Subject.
void notify (Events event)
 Call the Observer update function with the provided event.

Additional Inherited Members

Protected Attributes inherited from logic::EntityModel
float x
float y
Protected Attributes inherited from logic::Subject
std::list< std::weak_ptr< Observer > > observers

Constructor & Destructor Documentation

◆ CoinModel()

CoinModel::CoinModel ( float normalizedX,
float normalizedY )
explicit

Constructs a Coin model. Coins can be picked up by Pacman.

Parameters
normalizedXNormalized X spawn coordinate
normalizedYNormalized Y spawn coordinate

Member Function Documentation

◆ collect()

Events CoinModel::collect ( )
nodiscardoverridevirtual

To be called when Pacman interacts with this Coin. Will notify its observers.

Returns
Event that the World should notify its Observers about.

Implements logic::CollectibleEntityModel.


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