mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-05 09:33:25 -08:00
* [Refactor] Move game logic into libcockatrice_game * [Refactor] Include card_state.h in player_actions.h * [Game] Inject settings providers into libcockatrice_game, drop Widgets * [Game] Follow base rename to createCardRequested after rebase * [Game] Drop unused CardItem forward declaration * [Game] Fix includes after moving game logic into libcockatrice_game --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
24 lines
No EOL
803 B
C++
24 lines
No EOL
803 B
C++
#include "arrow_data.h"
|
|
|
|
#include "libcockatrice/protocol/pb/serverinfo_arrow.pb.h"
|
|
#include "libcockatrice/utility/color.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;
|
|
} |