4#include <andromenda/Component.h>
5#include <game/InteractionManager.h>
6#include <phosphorus/Languages.h>
8#include "CardConstants.h"
20 Int2 getSize()
override {
return CardConstants::CardSize; }
23 StockComponent() =
default;
34 registry.
Register(Keycode::Enter, _TW(
"stock.next"),
40 }, MouseButton::Right);
42 registry.
Register(Keycode::Q, _TW(
"card.grab"),
78 int xOffset = (card->
Type.
GetEnum() == CardType::N10) ? 4 : 3;
Represent registry of Action objects.
Definition ActionRegistry.h:74
void Register(const Keycode &keycode, const WideString &actionText, const Callback &callback, MouseButton button=MouseButton::None)
Registers given text and callback to given key.
Definition ActionRegistry.cpp:18
Represents a renderable identified object.
Definition Component.h:23
bool m_IsActive
A value indicating, whether object is being pointed by pointer.
Definition Component.h:32
Int2 m_Position
Component position.
Definition Component.h:61
Box GetBounds()
Returns Component bounds. Position is already aligned.
Definition Components.cpp:27
Applies given style to the stack when constructed and pops when destroyed.
Definition Terminal.h:185
void Pop()
Pops style at the top.
Definition TerminalBase.cpp:45
void Push(const TerminalStyle &style)
Pushes given style to the top.
Definition TerminalBase.cpp:43
Represents a playing card in a game. This class defines a card with properties such as color,...
Definition Card.h:61
enum Color GetTint() const
Gets the tint color of the card.
Definition Card.cpp:63
Phosphorus::EnumParameter< CardType > Type
The card's type.
Definition Card.h:96
Phosphorus::EnumParameter< CardColor > Color
The card's color.
Definition Card.h:91
static void TakeStockNextCard()
Draws the next card from the stock.
Definition InteractionManager.cpp:195
static bool ProvideActions(Andromenda::ActionRegistry ®istry)
Registers actions in the provided action registry.
Definition InteractionManager.cpp:286
void ProvideActions(Andromenda::ActionRegistry ®istry) override
Provides own actions to the ActionRegistry.
Definition StockComponent.h:29
bool IsSelectable() const override
Returns value indicating, whether component is selectable.
Definition StockComponent.h:26
void Draw(Andromenda::DrawContext &context) override
Draws self.
Definition StockComponent.h:47
T GetEnum() const
Casts integer to enum and returns.
Definition GameObject.h:242
T GetValue() const
Returns value.
Definition GameObject.h:134
Represents a mutable sequence of utf-16 characters, providing various member functions for string man...
Definition WideString.h:14
A utility which contains all essential class instances and functions for rendering objects.
Definition DrawContext.h:14
void Border(const Box &box)
Draws an rounded border at given position.
Definition DrawContext.cpp:58
void Put(const String &text, Int2 position)
Puts a UTF-8 text at given position and with given text.
Definition DrawContext.cpp:7
StyleStack StyleStack
Style stack.
Definition DrawContext.h:31
void Fill(const Box &box)
Draws an rectangle at given position.
Definition DrawContext.cpp:43
static Card * Grabbed
Currently selected card (global state).
Definition InteractionManager.h:242
static Card * GetCard()
Gets the currently selected card from the stock.
Definition InteractionManager.h:319
Represents a two component vector. Components are 32-bit and they are signed.
Definition Int2.h:11