Cockatrice 2025-11-30-Development-2.11.0-beta.38
A cross-platform virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
server_move_card_struct.h
Go to the documentation of this file.
1#ifndef MOVE_CARD_STRUCT
2#define MOVE_CARD_STRUCT
3
4#include "server_card.h"
5class CardToMove;
6
8{
11 const CardToMove *cardToMove;
13 MoveCardStruct(Server_Card *_card, int _position, const CardToMove *_cardToMove)
14 : card(_card), position(_position), cardToMove(_cardToMove), xCoord(_card->getX()), yCoord(_card->getY())
15
16 {
17 }
18 bool operator<(const MoveCardStruct &other) const
19 {
20 return (yCoord == other.yCoord &&
21 ((xCoord == other.xCoord && position < other.position) || xCoord < other.xCoord)) ||
22 yCoord < other.yCoord;
23 }
24};
25
26#endif
Definition server_card.h:36
int xCoord
Definition server_move_card_struct.h:12
const CardToMove * cardToMove
Definition server_move_card_struct.h:11
int position
Definition server_move_card_struct.h:10
Server_Card * card
Definition server_move_card_struct.h:9
MoveCardStruct(Server_Card *_card, int _position, const CardToMove *_cardToMove)
Definition server_move_card_struct.h:13
bool operator<(const MoveCardStruct &other) const
Definition server_move_card_struct.h:18
int yCoord
Definition server_move_card_struct.h:12