mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-02 19:43:55 -07:00
[Game][Arrows] Split Arrows into ArrowData and ArrowItem (#6918)
* [Game][Arrows] Split Arrows into ArrowData and ArrowItem Took 13 minutes Took 5 seconds Took 1 minute Took 26 seconds * Address comments. Took 17 minutes Took 9 seconds Took 1 minute * Change check. Took 3 minutes * Pass by const reference. Took 10 minutes * Remove extra method Took 2 minutes --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
bddf9bd818
commit
491d1c9187
15 changed files with 337 additions and 327 deletions
28
cockatrice/src/game/board/arrow_data.h
Normal file
28
cockatrice/src/game/board/arrow_data.h
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#ifndef COCKATRICE_ARROW_DATA_H
|
||||
#define COCKATRICE_ARROW_DATA_H
|
||||
|
||||
#include <QColor>
|
||||
#include <QString>
|
||||
#include <libcockatrice/protocol/pb/serverinfo_arrow.pb.h>
|
||||
#include <libcockatrice/utility/color.h>
|
||||
|
||||
struct ArrowData
|
||||
{
|
||||
int id;
|
||||
int startPlayerId;
|
||||
QString startZone;
|
||||
int startCardId;
|
||||
int targetPlayerId;
|
||||
QString targetZone; // empty = targeting a player
|
||||
int targetCardId = -1; // -1 = targeting a player
|
||||
QColor color;
|
||||
|
||||
static ArrowData fromProto(const ServerInfo_Arrow &arrow);
|
||||
|
||||
bool isPlayerTargeted() const
|
||||
{
|
||||
return targetZone.isEmpty();
|
||||
}
|
||||
};
|
||||
|
||||
#endif // COCKATRICE_ARROW_DATA_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue