GigaPasjans
Loading...
Searching...
No Matches
Game::BulkCardInteraction Struct Reference

Represents an interaction where multiple cards are moved. More...

#include <InteractionManager.h>

Inheritance diagram for Game::BulkCardInteraction:
Collaboration diagram for Game::BulkCardInteraction:

Public Member Functions

 BulkCardInteraction (const std::vector< Card * > &cards, CardStack *stack)
 
void Do () override
 Executes the interaction.
 
void Undo () override
 Reverts the interaction.
 
void Serialize (nlohmann::json &obj) override
 Serializes the bulk interaction to JSON.
 

Static Public Member Functions

static BulkCardInteractionLoad (nlohmann::json &obj)
 Loads a bulk interaction from JSON.
 

Public Attributes

std::vector< Card * > Cards
 Cards involved in the interaction.
 
CardStackStack
 Destination stack.
 
CardStackPreviousStack
 Stack from which the cards originated.
 
int32 PreviousIndex
 Index of the first moved card in the original stack.
 
int32 FlippedCardIndex = -1
 Index of any card that was flipped due to this move.
 
- Public Attributes inherited from Game::IInteraction
InteractionType Type
 Type of the interaction.
 

Static Public Attributes

static std::vector< Card * > GrabbedCards
 Cards currently being moved (global state).
 

Detailed Description

Represents an interaction where multiple cards are moved.

Member Function Documentation

◆ Do()

void Game::BulkCardInteraction::Do ( )
overridevirtual

Executes the interaction.

Reimplemented from Game::IInteraction.

◆ Serialize()

void Game::BulkCardInteraction::Serialize ( nlohmann::json & obj)
overridevirtual

Serializes the bulk interaction to JSON.

Reimplemented from Game::IInteraction.

◆ Undo()

void Game::BulkCardInteraction::Undo ( )
overridevirtual

Reverts the interaction.

Reimplemented from Game::IInteraction.


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