mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-12 11:01:29 -07:00
23da49ee5b
* [Game] [Arrows] Track creatorId, use arrowData in arrowItem, use registry, generate unique arrow id's on server side and delete-on-exist inserts. Took 2 minutes Took 1 minute * Fix emitting slot instead of signal. Took 15 minutes * Clear arrows locally in special circumstances i.e. teardown. Took 28 minutes --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
31 lines
708 B
C
31 lines
708 B
C
#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 creatorId = -1;
|
|
bool isLocalCreator = false;
|
|
int id = -1;
|
|
int startPlayerId = -1;
|
|
QString startZone = "";
|
|
int startCardId = -1;
|
|
int targetPlayerId = -1;
|
|
QString targetZone = "";
|
|
int targetCardId = -1;
|
|
QColor color = "";
|
|
|
|
static ArrowData fromProto(const ServerInfo_Arrow &arrow, int creatorId, bool isLocalCreator);
|
|
|
|
bool isPlayerTargeted() const
|
|
{
|
|
return targetZone.isEmpty();
|
|
}
|
|
};
|
|
|
|
#endif // COCKATRICE_ARROW_DATA_H
|