mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 16:24:45 -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
19
cockatrice/src/game/board/arrow_data.cpp
Normal file
19
cockatrice/src/game/board/arrow_data.cpp
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#include "arrow_data.h"
|
||||
|
||||
ArrowData ArrowData::fromProto(const ServerInfo_Arrow &arrow)
|
||||
{
|
||||
ArrowData data;
|
||||
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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue