mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-05-12 13:54:03 -05:00
Some checks failed
Build Desktop / Configure (push) Has been cancelled
Build Docker Image / amd64 & arm64 (push) Has been cancelled
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (Debian, DEB, 13) (push) Has been cancelled
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (Debian, DEB, skip, 11) (push) Has been cancelled
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (Debian, DEB, skip, 12) (push) Has been cancelled
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (Fedora, RPM, 42) (push) Has been cancelled
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (Fedora, RPM, skip, 41) (push) Has been cancelled
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (Ubuntu, DEB, 24.04) (push) Has been cancelled
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (Ubuntu, DEB, skip, 22.04) (push) Has been cancelled
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (yes, Arch, skip) (push) Has been cancelled
Build Desktop / macOS ${{matrix.target}}${{ matrix.soc == 'Intel' && ' Intel' || '' }}${{ matrix.type == 'Debug' && ' Debug' || '' }} (1, macos-13, Intel, 13, Release, 14.3.1) (push) Has been cancelled
Build Desktop / macOS ${{matrix.target}}${{ matrix.soc == 'Intel' && ' Intel' || '' }}${{ matrix.type == 'Debug' && ' Debug' || '' }} (1, macos-14, Apple, 14, Release, 15.4) (push) Has been cancelled
Build Desktop / macOS ${{matrix.target}}${{ matrix.soc == 'Intel' && ' Intel' || '' }}${{ matrix.type == 'Debug' && ' Debug' || '' }} (1, macos-15, Apple, 15, Release, 16.2) (push) Has been cancelled
Build Desktop / macOS ${{matrix.target}}${{ matrix.soc == 'Intel' && ' Intel' || '' }}${{ matrix.type == 'Debug' && ' Debug' || '' }} (macos-15, Apple, 15, Debug, 16.2) (push) Has been cancelled
Build Desktop / Windows ${{matrix.target}} (msvc2019_64, 5.15.*, 7) (push) Has been cancelled
Build Desktop / Windows ${{matrix.target}} (msvc2019_64, qtimageformats qtmultimedia qtwebsockets, 6.6.*, 10) (push) Has been cancelled
* move common server files * update includes with move * create participant, move code * fix linker errors * fix regressions * mark function as override to make clang happy * split out spectator to new file * forgot to add to cmakelists * autocompleter picking wrong casing for var name * clean up forwards declarations in player * fix includes in game
29 lines
1.1 KiB
C++
29 lines
1.1 KiB
C++
#include "server_arrow.h"
|
|
|
|
#include "pb/serverinfo_arrow.pb.h"
|
|
#include "server_card.h"
|
|
#include "server_cardzone.h"
|
|
#include "server_player.h"
|
|
|
|
Server_Arrow::Server_Arrow(int _id, Server_Card *_startCard, Server_ArrowTarget *_targetItem, const color &_arrowColor)
|
|
: id(_id), startCard(_startCard), targetItem(_targetItem), arrowColor(_arrowColor)
|
|
{
|
|
}
|
|
|
|
void Server_Arrow::getInfo(ServerInfo_Arrow *info)
|
|
{
|
|
info->set_id(id);
|
|
info->set_start_player_id(startCard->getZone()->getPlayer()->getPlayerId());
|
|
info->set_start_zone(startCard->getZone()->getName().toStdString());
|
|
info->set_start_card_id(startCard->getId());
|
|
info->mutable_arrow_color()->CopyFrom(arrowColor);
|
|
|
|
Server_Card *targetCard = qobject_cast<Server_Card *>(targetItem);
|
|
if (targetCard) {
|
|
info->set_target_player_id(targetCard->getZone()->getPlayer()->getPlayerId());
|
|
info->set_target_zone(targetCard->getZone()->getName().toStdString());
|
|
info->set_target_card_id(targetCard->getId());
|
|
} else
|
|
info->set_target_player_id(static_cast<Server_Player *>(targetItem)->getPlayerId());
|
|
}
|