mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 00:04:48 -07:00
* [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>
21 lines
No EOL
702 B
C++
21 lines
No EOL
702 B
C++
#include "arrow_data.h"
|
|
|
|
ArrowData ArrowData::fromProto(const ServerInfo_Arrow &arrow, int creatorId, bool isLocalCreator)
|
|
{
|
|
ArrowData data;
|
|
data.creatorId = creatorId;
|
|
data.isLocalCreator = isLocalCreator;
|
|
data.id = arrow.id();
|
|
data.startPlayerId = arrow.start_player_id();
|
|
data.startZone = QString::fromStdString(arrow.start_zone());
|
|
data.startCardId = arrow.start_card_id();
|
|
data.targetPlayerId = arrow.target_player_id();
|
|
data.color = convertColorToQColor(arrow.arrow_color());
|
|
|
|
if (arrow.has_target_zone()) {
|
|
data.targetZone = QString::fromStdString(arrow.target_zone());
|
|
data.targetCardId = arrow.target_card_id();
|
|
}
|
|
|
|
return data;
|
|
} |