|
GigaPasjans
|
Represents a renderable identified object. More...
#include <Component.h>


Public Member Functions | |
| bool | UpdateState () |
| Checks whether component is dirty, if yes then returns true and sets dirty state to false, else returns false. | |
| void | SetActive (bool active) |
| Sets m_IsActive to given state. | |
| Box | GetBounds () |
| Returns Component bounds. Position is already aligned. | |
| void | SetPosition (const Int2 &position) |
| Sets position to given. | |
| void | ProvideActions (ActionRegistry ®istry) override=0 |
| Provides own actions to the ActionRegistry. | |
| virtual bool | IsSelectable () const =0 |
| Returns value indicating, whether component is selectable. | |
| virtual void | Draw (DrawContext &context)=0 |
| Draws self. | |
Protected Member Functions | |
| int32 | getCenteredX () |
| Returns X aligned to the center. | |
| virtual Int2 | getSize ()=0 |
| Returns size of a component. | |
| void | markAsDirty () |
| Sets m_Dirty to true. | |
Protected Attributes | |
| bool | m_IsActive = false |
| A value indicating, whether object is being pointed by pointer. | |
| std::atomic< bool > | m_Dirty = false |
| A value indicating, whether object is dirty. | |
| String | m_Id = "" |
| Object identifier, that is unique per ComponentRegistry. | |
| ComponentCallback | m_Callback |
| Action component callback. | |
| Surface * | m_OwnerSurface = nullptr |
| Owning surface. | |
| Int2 | m_Position |
| Component position. | |
Friends | |
| class | Surface |
| class | ComponentRegistry |
Represents a renderable identified object.
|
pure virtual |
| Box Andromenda::Component::GetBounds | ( | ) |
|
protected |
Returns X aligned to the center.
|
protectedpure virtual |
Returns size of a component.
Implemented in Andromenda::SelectionTextComponent, and Andromenda::TextComponent.
|
nodiscardpure virtual |
Returns value indicating, whether component is selectable.
Implemented in Andromenda::SelectionTextComponent, Andromenda::TextComponent, Game::AsciiArtComponent, Game::CardComponent, Game::FoundationComponent, Game::FragmentComponent, Game::SettingComponent, and Game::StockComponent.
|
overridepure virtual |
Provides own actions to the ActionRegistry.
Implements Andromenda::IActionProvider.
Implemented in Andromenda::SelectionTextComponent, Andromenda::TextComponent, Game::AsciiArtComponent, Game::BooleanComponent, Game::CardComponent, Game::EnumComponent, Game::FoundationComponent, Game::FragmentComponent, Game::SettingComponent, and Game::StockComponent.
| void Andromenda::Component::SetActive | ( | bool | active | ) |
Sets m_IsActive to given state.
| active |
| void Andromenda::Component::SetPosition | ( | const Int2 & | position | ) |
Sets position to given.
| position |