SUNENGINE 0.0.2
A simple and bright C++ game engine.
 
Loading...
Searching...
No Matches
UICommand.h
1#ifndef UICommand_H
2#define UICommand_H
3
4#include "../CommandBase.h"
5#include "UIComponent.h"
6#include "UIAttorney.h"
7
31class UICommand : public CommandBase
32{
33public:
38 void Execute() override = 0;
39
43 virtual ~UICommand() override = default;
44
50 void SetUIComponent(UIComponent* p, UIComponentType t);
51
57
62 UIComponentType GetType() const;
63
64private:
65 friend class UIAttorney::GameLoop;
66 UIComponentType Type = UIComponentType::None;
68};
69
70#endif
Defines the base class for all command objects.
Base class for all command objects.
Definition CommandBase.h:19
Attorney for game loop access to UIComponent methods.
Definition UIAttorney.h:34
Abstract base class for UI-related command objects.
Definition UICommand.h:32
UIComponent * GetUIComponent() const
Gets the associated UIComponent.
Definition UICommand.cpp:9
UIComponentType GetType() const
Gets the type of the associated UIComponent.
Definition UICommand.cpp:14
void Execute() override=0
Pure virtual method to execute the command. Must be implemented by derived classes.
void SetUIComponent(UIComponent *p, UIComponentType t)
Associates this command with a UIComponent and its type.
Definition UICommand.cpp:3
UIComponent * pUIComponent
Pointer to the associated UIComponent.
Definition UICommand.h:67
UIComponentType Type
Type of the associated UIComponent.
Definition UICommand.h:66
virtual ~UICommand() override=default
Virtual destructor.
Abstract base class for all UI components.
Definition UIComponent.h:32