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

#include <EntityModel.h>

Inheritance diagram for logic::CollectibleEntityModel:
Collaboration diagram for logic::CollectibleEntityModel:

Public Member Functions

 CollectibleEntityModel (float normalizedX, float normalizedY)
 Subclass of EntityModel to be used by collectible entities.
virtual Events collect ()=0
 Function that will be called when Pacman interacts with a collectible entity. Must handle this interaction.
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

◆ CollectibleEntityModel()

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

Subclass of EntityModel to be used by collectible entities.

Parameters
normalizedXNormalized initial X coordinate
normalizedYNormalized initial Y coordinate

Member Function Documentation

◆ collect()

virtual Events logic::CollectibleEntityModel::collect ( )
nodiscardpure virtual

Function that will be called when Pacman interacts with a collectible entity. Must handle this interaction.

Returns
Event for the World to notify its observers of

Implemented in logic::CoinModel, and logic::FruitModel.


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