mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-05 09:33:25 -08:00
[Refactor] Move game logic into libcockatrice_game (#7437)
* [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>
This commit is contained in:
parent
78964779c6
commit
345b0e8ba9
108 changed files with 598 additions and 281 deletions
|
|
@ -1,13 +1,13 @@
|
|||
#include "replay_manager.h"
|
||||
|
||||
#include "../../../client/settings/cache_settings.h"
|
||||
#include "../../../game/player/event_processing_options.h"
|
||||
#include "libcockatrice/protocol/pb/game_event.pb.h"
|
||||
#include "libcockatrice/protocol/pb/game_event_container.pb.h"
|
||||
#include "libcockatrice/protocol/pb/game_replay.pb.h"
|
||||
|
||||
#include <QTimer>
|
||||
#include <algorithm>
|
||||
#include <libcockatrice/game/player/event_processing_options.h>
|
||||
#include <libcockatrice/protocol/get_pb_extension.h>
|
||||
#include <libcockatrice/settings/interface_settings.h>
|
||||
#include <qnumeric.h>
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
#ifndef COCKATRICE_REPLAY_MANAGER_H
|
||||
#define COCKATRICE_REPLAY_MANAGER_H
|
||||
|
||||
#include "../../../game/player/event_processing_options.h"
|
||||
|
||||
#include <QList>
|
||||
#include <QObject>
|
||||
#include <QtGlobal>
|
||||
#include <libcockatrice/game/player/event_processing_options.h>
|
||||
#include <qtmetamacros.h>
|
||||
|
||||
class GameReplay;
|
||||
|
|
|
|||
|
|
@ -8,9 +8,8 @@
|
|||
#ifndef REPLAY_WIDGET_H
|
||||
#define REPLAY_WIDGET_H
|
||||
|
||||
#include "../../../game/player/event_processing_options.h"
|
||||
|
||||
#include <QWidget>
|
||||
#include <libcockatrice/game/player/event_processing_options.h>
|
||||
#include <qtmetamacros.h>
|
||||
|
||||
class ReplayManager;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,5 @@
|
|||
#include "user_context_menu.h"
|
||||
|
||||
#include "../../../../game/abstract_game.h"
|
||||
#include "../../../../game/game_event_handler.h"
|
||||
#include "../../../../game/game_meta_info.h"
|
||||
#include "../../dialogs/dlg_report_user.h"
|
||||
#include "../../interface/widgets/tabs/tab_supervisor.h"
|
||||
#include "../chat_view/chat_view.h"
|
||||
|
|
@ -37,6 +34,9 @@
|
|||
#include <QTableWidget>
|
||||
#include <QTableWidgetItem>
|
||||
#include <QWidget>
|
||||
#include <libcockatrice/game/abstract_game.h>
|
||||
#include <libcockatrice/game/game_event_handler.h>
|
||||
#include <libcockatrice/game/game_meta_info.h>
|
||||
#include <libcockatrice/network/client/abstract/abstract_client.h>
|
||||
#include <libcockatrice/protocol/pb/command_kick_from_game.pb.h>
|
||||
#include <libcockatrice/protocol/pb/commands.pb.h>
|
||||
|
|
|
|||
|
|
@ -2,16 +2,10 @@
|
|||
|
||||
#include "../../../client/settings/cache_settings.h"
|
||||
#include "../../../client/settings/shortcuts_settings.h"
|
||||
#include "../../../game/abstract_game.h"
|
||||
#include "../../../game/game_event_handler.h"
|
||||
#include "../../../game/game_meta_info.h"
|
||||
#include "../../../game/game_state.h"
|
||||
#include "../../../game/player/player_info.h"
|
||||
#include "../../../game/player/player_manager.h"
|
||||
#include "../../../database/interface/settings_card_preference_provider.h"
|
||||
#include "../../../game_graphics/board/abstract_card_item.h"
|
||||
#include "../game/game.h"
|
||||
#include "../game/player/player_logic.h"
|
||||
#include "../game/replay.h"
|
||||
#include "../game_graphics/board/arrow_item.h"
|
||||
#include "../game_graphics/board/card_item.h"
|
||||
#include "../game_graphics/deckview/deck_view_container.h"
|
||||
#include "../game_graphics/deckview/tabbed_deck_view_container.h"
|
||||
#include "../game_graphics/game_scene.h"
|
||||
|
|
@ -71,6 +65,15 @@
|
|||
#include <QWidget>
|
||||
#include <QtGlobal>
|
||||
#include <libcockatrice/card/database/card_database_manager.h>
|
||||
#include <libcockatrice/game/abstract_game.h>
|
||||
#include <libcockatrice/game/game.h>
|
||||
#include <libcockatrice/game/game_event_handler.h>
|
||||
#include <libcockatrice/game/game_meta_info.h>
|
||||
#include <libcockatrice/game/game_state.h>
|
||||
#include <libcockatrice/game/player/player_info.h>
|
||||
#include <libcockatrice/game/player/player_logic.h>
|
||||
#include <libcockatrice/game/player/player_manager.h>
|
||||
#include <libcockatrice/game/replay.h>
|
||||
#include <libcockatrice/network/client/abstract/abstract_client.h>
|
||||
#include <libcockatrice/protocol/pb/serverinfo_player.pb.h>
|
||||
#include <libcockatrice/protocol/pb/serverinfo_user.pb.h>
|
||||
|
|
@ -97,7 +100,8 @@ TabGame::TabGame(TabSupervisor *_tabSupervisor, GameReplay *_replay)
|
|||
: Tab(_tabSupervisor), sayLabel(nullptr), sayEdit(nullptr)
|
||||
{
|
||||
// THIS CTOR IS USED ON REPLAY
|
||||
game = new Replay(this, _replay, tabSupervisor->getIsLocalGame());
|
||||
game = new Replay(this, _replay, tabSupervisor->getIsLocalGame(), &SettingsCache::instance().userInterface(),
|
||||
new SettingsCardPreferenceProvider(this));
|
||||
|
||||
createCardInfoDock(true);
|
||||
createPlayerListDock(true);
|
||||
|
|
@ -141,7 +145,8 @@ TabGame::TabGame(TabSupervisor *_tabSupervisor,
|
|||
: Tab(_tabSupervisor), userListProxy(_tabSupervisor->getUserListManager())
|
||||
{
|
||||
// THIS CTOR IS USED ON GAMES
|
||||
game = new Game(this, tabSupervisor->getIsLocalGame(), _clients, event, _roomGameTypes);
|
||||
game = new Game(this, tabSupervisor->getIsLocalGame(), _clients, event, _roomGameTypes,
|
||||
&SettingsCache::instance().userInterface(), new SettingsCardPreferenceProvider(this));
|
||||
|
||||
createCardInfoDock();
|
||||
createPlayerListDock();
|
||||
|
|
|
|||
|
|
@ -2,9 +2,6 @@
|
|||
|
||||
#include "../../../client/settings/cache_settings.h"
|
||||
#include "../../../client/settings/shortcuts_settings.h"
|
||||
#include "../../../game/abstract_game.h"
|
||||
#include "../../../game/game_event_handler.h"
|
||||
#include "../../../game/game_meta_info.h"
|
||||
#include "../../intents/contexts/context_connect_to_server.h"
|
||||
#include "../../intents/contexts/context_join_game.h"
|
||||
#include "../../intents/contexts/context_join_room.h"
|
||||
|
|
@ -63,6 +60,9 @@
|
|||
#include <QSystemTrayIcon>
|
||||
#include <QTabBar>
|
||||
#include <libcockatrice/deck_list/loaded_deck.h>
|
||||
#include <libcockatrice/game/abstract_game.h>
|
||||
#include <libcockatrice/game/game_event_handler.h>
|
||||
#include <libcockatrice/game/game_meta_info.h>
|
||||
#include <libcockatrice/network/client/abstract/abstract_client.h>
|
||||
#include <libcockatrice/network/client/remote/remote_client.h>
|
||||
#include <libcockatrice/protocol/pb/event_game_joined.pb.h>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue