Turn Card, Deck_List, Protocol, RNG, Network (Client, Server), Settings and Utility into libraries and remove cockatrice_common. (#6212)

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: ebbit1q <ebbit1q@gmail.com>
This commit is contained in:
BruebachL 2025-10-09 07:36:12 +02:00 committed by GitHub
parent be1403c920
commit 1ef07309d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
605 changed files with 3812 additions and 3408 deletions

View file

@ -1,8 +1,5 @@
#include "card_menu.h"
#include "../../../card/card_relation.h"
#include "../../../database/card_database_manager.h"
#include "../../../settings/card_counter_settings.h"
#include "../../../tabs/tab_game.h"
#include "../../board/card_item.h"
#include "../../zones/logic/view_zone_logic.h"
@ -12,6 +9,10 @@
#include "move_menu.h"
#include "pt_menu.h"
#include <libcockatrice/card/card_database/card_database_manager.h>
#include <libcockatrice/card/card_relation/card_relation.h>
#include <libcockatrice/settings/card_counter_settings.h>
CardMenu::CardMenu(Player *_player, const CardItem *_card, bool _shortcutsActive)
: player(_player), card(_card), shortcutsActive(_shortcutsActive)
{

View file

@ -1,7 +1,5 @@
#include "hand_menu.h"
#include "../../../settings/cache_settings.h"
#include "../../../settings/shortcuts_settings.h"
#include "../../abstract_game.h"
#include "../../zones/hand_zone.h"
#include "../player.h"
@ -9,6 +7,8 @@
#include <QAction>
#include <QMenu>
#include <libcockatrice/settings/cache_settings.h>
#include <libcockatrice/settings/shortcuts_settings.h>
HandMenu::HandMenu(Player *_player, PlayerActions *actions, QWidget *parent) : TearOffMenu(parent), player(_player)
{

View file

@ -1,7 +1,5 @@
#include "library_menu.h"
#include "../../../settings/cache_settings.h"
#include "../../../settings/shortcuts_settings.h"
#include "../../../tabs/tab_game.h"
#include "../../abstract_game.h"
#include "../player.h"
@ -9,6 +7,8 @@
#include <QAction>
#include <QMenu>
#include <libcockatrice/settings/cache_settings.h>
#include <libcockatrice/settings/shortcuts_settings.h>
LibraryMenu::LibraryMenu(Player *_player, QWidget *parent) : TearOffMenu(parent), player(_player)
{

View file

@ -1,7 +1,5 @@
#include "player_menu.h"
#include "../../../common/pb/command_reveal_cards.pb.h"
#include "../../../database/card_database_manager.h"
#include "../../../tabs/tab_game.h"
#include "../../board/card_item.h"
#include "../../zones/hand_zone.h"
@ -10,6 +8,9 @@
#include "card_menu.h"
#include "hand_menu.h"
#include <libcockatrice/card/card_database/card_database_manager.h>
#include <libcockatrice/protocol/pb/command_reveal_cards.pb.h>
PlayerMenu::PlayerMenu(Player *_player) : player(_player)
{
playerMenu = new TearOffMenu();

View file

@ -1,9 +1,10 @@
#include "say_menu.h"
#include "../../../settings/cache_settings.h"
#include "../player.h"
#include "../player_actions.h"
#include <libcockatrice/settings/cache_settings.h>
SayMenu::SayMenu(Player *_player) : player(_player)
{
connect(&SettingsCache::instance().messages(), &MessageSettings::messageMacrosChanged, this, &SayMenu::initSayMenu);

View file

@ -12,15 +12,6 @@
#include "../zones/stack_zone.h"
#include "../zones/table_zone.h"
#include "../zones/view_zone.h"
#include "color.h"
#include "pb/command_attach_card.pb.h"
#include "pb/command_set_card_counter.pb.h"
#include "pb/event_create_arrow.pb.h"
#include "pb/event_create_counter.pb.h"
#include "pb/event_draw_cards.pb.h"
#include "pb/serverinfo_player.pb.h"
#include "pb/serverinfo_user.pb.h"
#include "pb/serverinfo_zone.pb.h"
#include "player_target.h"
#include <QDebug>
@ -28,6 +19,15 @@
#include <QMetaType>
#include <QPainter>
#include <QtConcurrent>
#include <libcockatrice/protocol/pb/command_attach_card.pb.h>
#include <libcockatrice/protocol/pb/command_set_card_counter.pb.h>
#include <libcockatrice/protocol/pb/event_create_arrow.pb.h>
#include <libcockatrice/protocol/pb/event_create_counter.pb.h>
#include <libcockatrice/protocol/pb/event_draw_cards.pb.h>
#include <libcockatrice/protocol/pb/serverinfo_player.pb.h>
#include <libcockatrice/protocol/pb/serverinfo_user.pb.h>
#include <libcockatrice/protocol/pb/serverinfo_zone.pb.h>
#include <libcockatrice/utility/color.h>
Player::Player(const ServerInfo_User &info, int _id, bool _local, bool _judge, AbstractGame *_parent)
: QObject(_parent), game(_parent), playerInfo(new PlayerInfo(info, _id, _local, _judge)),

View file

@ -7,14 +7,11 @@
#ifndef PLAYER_H
#define PLAYER_H
#include "../../card/card_info.h"
#include "../../filters/filter_string.h"
#include "../../interface/tearoff_menu.h"
#include "../board/abstract_graphics_item.h"
#include "../dialogs/dlg_create_token.h"
#include "menu/player_menu.h"
#include "pb/card_attributes.pb.h"
#include "pb/game_event.pb.h"
#include "player_actions.h"
#include "player_area.h"
#include "player_event_handler.h"
@ -26,6 +23,9 @@
#include <QMap>
#include <QPoint>
#include <QTimer>
#include <libcockatrice/card/card_info.h>
#include <libcockatrice/protocol/pb/card_attributes.pb.h>
#include <libcockatrice/protocol/pb/game_event.pb.h>
inline Q_LOGGING_CATEGORY(PlayerLog, "player");

View file

@ -1,31 +1,32 @@
#include "player_actions.h"
#include "../../../common/pb/context_move_card.pb.h"
#include "../../card/card_relation.h"
#include "../../client/get_text_with_max.h"
#include "../../database/card_database_manager.h"
#include "../../tabs/tab_game.h"
#include "../board/card_item.h"
#include "../dialogs/dlg_move_top_cards_until.h"
#include "../dialogs/dlg_roll_dice.h"
#include "../zones/logic/view_zone_logic.h"
#include "card_menu_action_type.h"
#include "pb/command_attach_card.pb.h"
#include "pb/command_change_zone_properties.pb.h"
#include "pb/command_concede.pb.h"
#include "pb/command_create_token.pb.h"
#include "pb/command_draw_cards.pb.h"
#include "pb/command_flip_card.pb.h"
#include "pb/command_game_say.pb.h"
#include "pb/command_move_card.pb.h"
#include "pb/command_mulligan.pb.h"
#include "pb/command_reveal_cards.pb.h"
#include "pb/command_roll_die.pb.h"
#include "pb/command_set_card_attr.pb.h"
#include "pb/command_set_card_counter.pb.h"
#include "pb/command_shuffle.pb.h"
#include "pb/command_undo_draw.pb.h"
#include "trice_limits.h"
#include <libcockatrice/card/card_database/card_database_manager.h>
#include <libcockatrice/card/card_relation/card_relation.h>
#include <libcockatrice/protocol/pb/command_attach_card.pb.h>
#include <libcockatrice/protocol/pb/command_change_zone_properties.pb.h>
#include <libcockatrice/protocol/pb/command_concede.pb.h>
#include <libcockatrice/protocol/pb/command_create_token.pb.h>
#include <libcockatrice/protocol/pb/command_draw_cards.pb.h>
#include <libcockatrice/protocol/pb/command_flip_card.pb.h>
#include <libcockatrice/protocol/pb/command_game_say.pb.h>
#include <libcockatrice/protocol/pb/command_move_card.pb.h>
#include <libcockatrice/protocol/pb/command_mulligan.pb.h>
#include <libcockatrice/protocol/pb/command_reveal_cards.pb.h>
#include <libcockatrice/protocol/pb/command_roll_die.pb.h>
#include <libcockatrice/protocol/pb/command_set_card_attr.pb.h>
#include <libcockatrice/protocol/pb/command_set_card_counter.pb.h>
#include <libcockatrice/protocol/pb/command_shuffle.pb.h>
#include <libcockatrice/protocol/pb/command_undo_draw.pb.h>
#include <libcockatrice/protocol/pb/context_move_card.pb.h>
#include <libcockatrice/utility/trice_limits.h>
// milliseconds in between triggers of the move top cards until action
static constexpr int MOVE_TOP_CARD_UNTIL_INTERVAL = 100;

View file

@ -7,12 +7,13 @@
#ifndef COCKATRICE_PLAYER_ACTIONS_H
#define COCKATRICE_PLAYER_ACTIONS_H
#include "../../card/card_relation_type.h"
#include "event_processing_options.h"
#include "player.h"
#include <QMenu>
#include <QObject>
#include <libcockatrice/card/card_relation/card_relation_type.h>
#include <libcockatrice/protocol/pb/card_attributes.pb.h>
namespace google
{

View file

@ -5,30 +5,31 @@
#include "../board/card_item.h"
#include "../board/card_list.h"
#include "../zones/view_zone.h"
#include "pb/command_set_card_attr.pb.h"
#include "pb/context_move_card.pb.h"
#include "pb/context_undo_draw.pb.h"
#include "pb/event_attach_card.pb.h"
#include "pb/event_change_zone_properties.pb.h"
#include "pb/event_create_arrow.pb.h"
#include "pb/event_create_counter.pb.h"
#include "pb/event_create_token.pb.h"
#include "pb/event_del_counter.pb.h"
#include "pb/event_delete_arrow.pb.h"
#include "pb/event_destroy_card.pb.h"
#include "pb/event_draw_cards.pb.h"
#include "pb/event_dump_zone.pb.h"
#include "pb/event_flip_card.pb.h"
#include "pb/event_game_say.pb.h"
#include "pb/event_move_card.pb.h"
#include "pb/event_reveal_cards.pb.h"
#include "pb/event_roll_die.pb.h"
#include "pb/event_set_card_attr.pb.h"
#include "pb/event_set_card_counter.pb.h"
#include "pb/event_set_counter.pb.h"
#include "pb/event_shuffle.pb.h"
#include "player.h"
#include <libcockatrice/protocol/pb/command_set_card_attr.pb.h>
#include <libcockatrice/protocol/pb/context_move_card.pb.h>
#include <libcockatrice/protocol/pb/context_undo_draw.pb.h>
#include <libcockatrice/protocol/pb/event_attach_card.pb.h>
#include <libcockatrice/protocol/pb/event_change_zone_properties.pb.h>
#include <libcockatrice/protocol/pb/event_create_arrow.pb.h>
#include <libcockatrice/protocol/pb/event_create_counter.pb.h>
#include <libcockatrice/protocol/pb/event_create_token.pb.h>
#include <libcockatrice/protocol/pb/event_del_counter.pb.h>
#include <libcockatrice/protocol/pb/event_delete_arrow.pb.h>
#include <libcockatrice/protocol/pb/event_destroy_card.pb.h>
#include <libcockatrice/protocol/pb/event_draw_cards.pb.h>
#include <libcockatrice/protocol/pb/event_dump_zone.pb.h>
#include <libcockatrice/protocol/pb/event_flip_card.pb.h>
#include <libcockatrice/protocol/pb/event_game_say.pb.h>
#include <libcockatrice/protocol/pb/event_move_card.pb.h>
#include <libcockatrice/protocol/pb/event_reveal_cards.pb.h>
#include <libcockatrice/protocol/pb/event_roll_die.pb.h>
#include <libcockatrice/protocol/pb/event_set_card_attr.pb.h>
#include <libcockatrice/protocol/pb/event_set_card_counter.pb.h>
#include <libcockatrice/protocol/pb/event_set_counter.pb.h>
#include <libcockatrice/protocol/pb/event_shuffle.pb.h>
PlayerEventHandler::PlayerEventHandler(Player *_player) : player(_player)
{
}

View file

@ -9,8 +9,8 @@
#include "event_processing_options.h"
#include <QObject>
#include <pb/game_event.pb.h>
#include <pb/game_event_context.pb.h>
#include <libcockatrice/protocol/pb/game_event.pb.h>
#include <libcockatrice/protocol/pb/game_event_context.pb.h>
class CardItem;
class CardZoneLogic;

View file

@ -7,7 +7,6 @@
#ifndef COCKATRICE_PLAYER_INFO_H
#define COCKATRICE_PLAYER_INFO_H
#include "../../../common/pb/serverinfo_user.pb.h"
#include "../../deck/deck_loader.h"
#include "../zones/hand_zone.h"
#include "../zones/pile_zone.h"
@ -16,6 +15,7 @@
#include "player_target.h"
#include <QObject>
#include <libcockatrice/protocol/pb/serverinfo_user.pb.h>
class PlayerInfo : public QObject
{

View file

@ -1,21 +1,21 @@
#include "player_list_widget.h"
#include "../../interface/pixel_map_generator.h"
#include "../../server/abstract_client.h"
#include "../../server/user/user_context_menu.h"
#include "../../server/user/user_list_manager.h"
#include "../../server/user/user_list_widget.h"
#include "../../tabs/tab_account.h"
#include "../../tabs/tab_game.h"
#include "../../tabs/tab_supervisor.h"
#include "pb/command_kick_from_game.pb.h"
#include "pb/serverinfo_playerproperties.pb.h"
#include "pb/session_commands.pb.h"
#include <QAction>
#include <QHeaderView>
#include <QMenu>
#include <QMouseEvent>
#include <libcockatrice/network/client/abstract/abstract_client.h>
#include <libcockatrice/protocol/pb/command_kick_from_game.pb.h>
#include <libcockatrice/protocol/pb/serverinfo_playerproperties.pb.h>
#include <libcockatrice/protocol/pb/session_commands.pb.h>
PlayerListItemDelegate::PlayerListItemDelegate(QObject *const parent) : QStyledItemDelegate(parent)
{

View file

@ -7,10 +7,9 @@
#ifndef COCKATRICE_PLAYER_MANAGER_H
#define COCKATRICE_PLAYER_MANAGER_H
#include "pb/serverinfo_playerproperties.pb.h"
#include <QMap>
#include <QObject>
#include <libcockatrice/protocol/pb/serverinfo_playerproperties.pb.h>
class AbstractGame;
class Player;

View file

@ -1,13 +1,13 @@
#include "player_target.h"
#include "../../interface/pixel_map_generator.h"
#include "pb/serverinfo_user.pb.h"
#include "player.h"
#include <QDebug>
#include <QPainter>
#include <QPixmapCache>
#include <QtMath>
#include <libcockatrice/protocol/pb/serverinfo_user.pb.h>
PlayerCounter::PlayerCounter(Player *_player, int _id, const QString &_name, int _value, QGraphicsItem *parent)
: AbstractCounter(_player, _id, _name, false, _value, false, parent)