mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-26 16:43:55 -07:00
* [Game/Zones] Simple move refactor to differentiate between logic and graphics for zones Took 21 minutes * Clean up game/zones/logic folder. Took 6 minutes * Adjust tests. Took 3 minutes --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
71 lines
1.5 KiB
C++
71 lines
1.5 KiB
C++
/**
|
|
* @file view_zone_logic.h
|
|
* @ingroup GameLogicZones
|
|
* @brief TODO: Document this.
|
|
*/
|
|
|
|
#ifndef COCKATRICE_VIEW_ZONE_LOGIC_H
|
|
#define COCKATRICE_VIEW_ZONE_LOGIC_H
|
|
#include "card_zone_logic.h"
|
|
|
|
class ZoneViewZoneLogic : public CardZoneLogic
|
|
{
|
|
Q_OBJECT
|
|
signals:
|
|
void addToViews();
|
|
void removeFromViews();
|
|
void closeView();
|
|
|
|
private:
|
|
CardZoneLogic *origZone;
|
|
int numberCards;
|
|
bool revealZone, writeableRevealZone;
|
|
bool isReversed;
|
|
|
|
public:
|
|
enum CardAction
|
|
{
|
|
INITIALIZE,
|
|
ADD_CARD,
|
|
REMOVE_CARD
|
|
};
|
|
|
|
ZoneViewZoneLogic(Player *_player,
|
|
CardZoneLogic *_origZone,
|
|
int _numberCards,
|
|
bool _revealZone,
|
|
bool _writeableRevealZone,
|
|
bool _isReversed,
|
|
QObject *parent = nullptr);
|
|
|
|
bool prepareAddCard(int x);
|
|
void removeCard(int position, bool toNewZone);
|
|
void updateCardIds(CardAction action);
|
|
int getNumberCards() const
|
|
{
|
|
return numberCards;
|
|
}
|
|
bool getRevealZone() const
|
|
{
|
|
return revealZone;
|
|
}
|
|
bool getWriteableRevealZone() const
|
|
{
|
|
return writeableRevealZone;
|
|
}
|
|
void setWriteableRevealZone(bool _writeableRevealZone);
|
|
bool getIsReversed() const
|
|
{
|
|
return isReversed;
|
|
}
|
|
|
|
CardZoneLogic *getOriginalZone() const
|
|
{
|
|
return origZone;
|
|
}
|
|
|
|
protected:
|
|
void addCardImpl(CardItem *card, int x, int y) override;
|
|
};
|
|
|
|
#endif // COCKATRICE_VIEW_ZONE_LOGIC_H
|