GigaPasjans
Loading...
Searching...
No Matches
Andromenda::Component Class Referenceabstract

Represents a renderable identified object. More...

#include <Component.h>

Inheritance diagram for Andromenda::Component:
Collaboration diagram for Andromenda::Component:

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 &registry) 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.
 
Surfacem_OwnerSurface = nullptr
 Owning surface.
 
Int2 m_Position
 Component position.
 

Friends

class Surface
 
class ComponentRegistry
 

Detailed Description

Represents a renderable identified object.

Member Function Documentation

◆ Draw()

◆ GetBounds()

Box Andromenda::Component::GetBounds ( )

Returns Component bounds. Position is already aligned.

Returns
Box

◆ getCenteredX()

int32 Andromenda::Component::getCenteredX ( )
protected

Returns X aligned to the center.

Returns
int32

◆ getSize()

virtual Int2 Andromenda::Component::getSize ( )
protectedpure virtual

Returns size of a component.

Returns
Int2

Implemented in Andromenda::SelectionTextComponent, and Andromenda::TextComponent.

◆ IsSelectable()

virtual bool Andromenda::Component::IsSelectable ( ) const
nodiscardpure virtual

◆ ProvideActions()

◆ SetActive()

void Andromenda::Component::SetActive ( bool active)

Sets m_IsActive to given state.

Parameters
active

◆ SetPosition()

void Andromenda::Component::SetPosition ( const Int2 & position)

Sets position to given.

Parameters
position

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