mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-09 11: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
|
|
@ -420,6 +420,9 @@ if(WITH_ORACLE OR WITH_CLIENT)
|
||||||
add_subdirectory(${CMAKE_SOURCE_DIR}/libcockatrice_models ${CMAKE_BINARY_DIR}/libcockatrice_models)
|
add_subdirectory(${CMAKE_SOURCE_DIR}/libcockatrice_models ${CMAKE_BINARY_DIR}/libcockatrice_models)
|
||||||
add_subdirectory(${CMAKE_SOURCE_DIR}/libcockatrice_filters ${CMAKE_BINARY_DIR}/libcockatrice_filters)
|
add_subdirectory(${CMAKE_SOURCE_DIR}/libcockatrice_filters ${CMAKE_BINARY_DIR}/libcockatrice_filters)
|
||||||
endif()
|
endif()
|
||||||
|
if(WITH_CLIENT)
|
||||||
|
add_subdirectory(${CMAKE_SOURCE_DIR}/libcockatrice_game ${CMAKE_BINARY_DIR}/libcockatrice_game)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(WITH_SERVER)
|
if(WITH_SERVER)
|
||||||
add_subdirectory(servatrice)
|
add_subdirectory(servatrice)
|
||||||
|
|
|
||||||
|
|
@ -69,20 +69,15 @@ set(cockatrice_SOURCES
|
||||||
src/filters/filter_builder.cpp
|
src/filters/filter_builder.cpp
|
||||||
src/filters/filter_tree_model.cpp
|
src/filters/filter_tree_model.cpp
|
||||||
src/filters/syntax_help.cpp
|
src/filters/syntax_help.cpp
|
||||||
src/game/abstract_game.cpp
|
|
||||||
src/game_graphics/board/abstract_card_drag_item.cpp
|
src/game_graphics/board/abstract_card_drag_item.cpp
|
||||||
src/game_graphics/board/abstract_card_item.cpp
|
src/game_graphics/board/abstract_card_item.cpp
|
||||||
src/game_graphics/board/abstract_counter.cpp
|
src/game_graphics/board/abstract_counter.cpp
|
||||||
src/game/board/arrow_data.cpp
|
|
||||||
src/game_graphics/board/arrow_item.cpp
|
src/game_graphics/board/arrow_item.cpp
|
||||||
src/game_graphics/board/arrow_registry.cpp
|
src/game_graphics/board/arrow_registry.cpp
|
||||||
src/game_graphics/board/arrow_target.cpp
|
src/game_graphics/board/arrow_target.cpp
|
||||||
src/game_graphics/board/card_drag_item.cpp
|
src/game_graphics/board/card_drag_item.cpp
|
||||||
src/game_graphics/board/card_item.cpp
|
src/game_graphics/board/card_item.cpp
|
||||||
src/game/board/card_list.cpp
|
|
||||||
src/game/board/card_state.cpp
|
|
||||||
src/game_graphics/board/counter_general.cpp
|
src/game_graphics/board/counter_general.cpp
|
||||||
src/game/board/counter_state.cpp
|
|
||||||
src/game_graphics/board/translate_counter_name.cpp
|
src/game_graphics/board/translate_counter_name.cpp
|
||||||
src/game_graphics/deckview/deck_view.cpp
|
src/game_graphics/deckview/deck_view.cpp
|
||||||
src/game_graphics/deckview/deck_view_container.cpp
|
src/game_graphics/deckview/deck_view_container.cpp
|
||||||
|
|
@ -91,15 +86,10 @@ set(cockatrice_SOURCES
|
||||||
src/game_graphics/dialogs/dlg_create_token.cpp
|
src/game_graphics/dialogs/dlg_create_token.cpp
|
||||||
src/game_graphics/dialogs/dlg_move_top_cards_until.cpp
|
src/game_graphics/dialogs/dlg_move_top_cards_until.cpp
|
||||||
src/game_graphics/dialogs/dlg_roll_dice.cpp
|
src/game_graphics/dialogs/dlg_roll_dice.cpp
|
||||||
src/game/game.cpp
|
|
||||||
src/game/game_event_handler.cpp
|
|
||||||
src/game/game_meta_info.cpp
|
|
||||||
src/game_graphics/game_scene.cpp
|
src/game_graphics/game_scene.cpp
|
||||||
src/game/game_state.cpp
|
|
||||||
src/game_graphics/game_view.cpp
|
src/game_graphics/game_view.cpp
|
||||||
src/game_graphics/hand_counter.cpp
|
src/game_graphics/hand_counter.cpp
|
||||||
src/game_graphics/log/message_log_widget.cpp
|
src/game_graphics/log/message_log_widget.cpp
|
||||||
src/game/phase.cpp
|
|
||||||
src/game_graphics/phases_toolbar.cpp
|
src/game_graphics/phases_toolbar.cpp
|
||||||
src/game_graphics/player/menu/card_menu.cpp
|
src/game_graphics/player/menu/card_menu.cpp
|
||||||
src/game_graphics/player/menu/custom_zone_menu.cpp
|
src/game_graphics/player/menu/custom_zone_menu.cpp
|
||||||
|
|
@ -117,23 +107,11 @@ set(cockatrice_SOURCES
|
||||||
src/game_graphics/tally/stats_tally.cpp
|
src/game_graphics/tally/stats_tally.cpp
|
||||||
src/game_graphics/tally/subtype_tally.cpp
|
src/game_graphics/tally/subtype_tally.cpp
|
||||||
src/game_graphics/tally/tally.cpp
|
src/game_graphics/tally/tally.cpp
|
||||||
src/game/player/player_actions.cpp
|
|
||||||
src/game_graphics/player/player_area.cpp
|
src/game_graphics/player/player_area.cpp
|
||||||
src/game_graphics/player/player_dialogs.cpp
|
src/game_graphics/player/player_dialogs.cpp
|
||||||
src/game/player/player_event_handler.cpp
|
|
||||||
src/game_graphics/player/player_graphics_item.cpp
|
src/game_graphics/player/player_graphics_item.cpp
|
||||||
src/game/player/player_info.cpp
|
|
||||||
src/game_graphics/player/player_list_widget.cpp
|
src/game_graphics/player/player_list_widget.cpp
|
||||||
src/game/player/player_logic.cpp
|
|
||||||
src/game/player/player_manager.cpp
|
|
||||||
src/game_graphics/player/player_target.cpp
|
src/game_graphics/player/player_target.cpp
|
||||||
src/game/replay.cpp
|
|
||||||
src/game/zones/card_zone_logic.cpp
|
|
||||||
src/game/zones/hand_zone_logic.cpp
|
|
||||||
src/game/zones/pile_zone_logic.cpp
|
|
||||||
src/game/zones/stack_zone_logic.cpp
|
|
||||||
src/game/zones/table_zone_logic.cpp
|
|
||||||
src/game/zones/view_zone_logic.cpp
|
|
||||||
src/game_graphics/zones/card_zone.cpp
|
src/game_graphics/zones/card_zone.cpp
|
||||||
src/game_graphics/zones/hand_zone.cpp
|
src/game_graphics/zones/hand_zone.cpp
|
||||||
src/game_graphics/zones/pile_zone.cpp
|
src/game_graphics/zones/pile_zone.cpp
|
||||||
|
|
@ -573,6 +551,7 @@ target_link_libraries(
|
||||||
PUBLIC libcockatrice_card
|
PUBLIC libcockatrice_card
|
||||||
libcockatrice_deck_list
|
libcockatrice_deck_list
|
||||||
libcockatrice_filters
|
libcockatrice_filters
|
||||||
|
libcockatrice_game
|
||||||
libcockatrice_utility
|
libcockatrice_utility
|
||||||
libcockatrice_network
|
libcockatrice_network
|
||||||
libcockatrice_models
|
libcockatrice_models
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,18 @@
|
||||||
#define COCKATRICE_SETTINGS_CARD_PREFERENCE_PROVIDER_H
|
#define COCKATRICE_SETTINGS_CARD_PREFERENCE_PROVIDER_H
|
||||||
#include "../../client/settings/cache_settings.h"
|
#include "../../client/settings/cache_settings.h"
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
#include <libcockatrice/interfaces/interface_card_preference_provider.h>
|
#include <libcockatrice/interfaces/interface_card_preference_provider.h>
|
||||||
#include <libcockatrice/settings/card_override_settings.h>
|
#include <libcockatrice/settings/card_override_settings.h>
|
||||||
#include <libcockatrice/settings/cards_display_settings.h>
|
#include <libcockatrice/settings/cards_display_settings.h>
|
||||||
|
|
||||||
class SettingsCardPreferenceProvider : public ICardPreferenceProvider
|
class SettingsCardPreferenceProvider : public QObject, public ICardPreferenceProvider
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
explicit SettingsCardPreferenceProvider(QObject *parent = nullptr) : QObject(parent)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
[[nodiscard]] QString getCardPreferenceOverride(const QString &cardName) const override
|
[[nodiscard]] QString getCardPreferenceOverride(const QString &cardName) const override
|
||||||
{
|
{
|
||||||
return SettingsCache::instance().cardOverrides().getCardPreferenceOverride(cardName);
|
return SettingsCache::instance().cardOverrides().getCardPreferenceOverride(cardName);
|
||||||
|
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
/**
|
|
||||||
* @file replay.h
|
|
||||||
* @ingroup GameLogic
|
|
||||||
* @ingroup Replay
|
|
||||||
*/
|
|
||||||
//! \todo Document this file.
|
|
||||||
|
|
||||||
#ifndef COCKATRICE_REPLAY_H
|
|
||||||
#define COCKATRICE_REPLAY_H
|
|
||||||
|
|
||||||
#include "abstract_game.h"
|
|
||||||
|
|
||||||
#include <qtmetamacros.h>
|
|
||||||
|
|
||||||
class GameReplay;
|
|
||||||
class QObject;
|
|
||||||
|
|
||||||
class Replay : public AbstractGame
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
explicit Replay(QObject *_parent, const GameReplay *_replay, bool isLocalGame);
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // COCKATRICE_REPLAY_H
|
|
||||||
|
|
@ -7,11 +7,18 @@
|
||||||
#ifndef ABSTRACTCARDITEM_H
|
#ifndef ABSTRACTCARDITEM_H
|
||||||
#define ABSTRACTCARDITEM_H
|
#define ABSTRACTCARDITEM_H
|
||||||
|
|
||||||
#include "../../game/board/card_state.h"
|
|
||||||
#include "../animated_item.h"
|
#include "../animated_item.h"
|
||||||
#include "arrow_target.h"
|
#include "arrow_target.h"
|
||||||
#include "graphics_item_type.h"
|
#include "graphics_item_type.h"
|
||||||
|
|
||||||
|
#include <QColor>
|
||||||
|
#include <QGraphicsItem>
|
||||||
|
#include <QSizeF>
|
||||||
|
#include <QString>
|
||||||
|
#include <QtGlobal>
|
||||||
|
#include <libcockatrice/game/board/card_state.h>
|
||||||
|
#include <qtmetamacros.h>
|
||||||
|
|
||||||
class PlayerLogic;
|
class PlayerLogic;
|
||||||
class CardInfo;
|
class CardInfo;
|
||||||
class QPainter;
|
class QPainter;
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,6 @@
|
||||||
|
|
||||||
#include "../../client/settings/cache_settings.h"
|
#include "../../client/settings/cache_settings.h"
|
||||||
#include "../../client/settings/shortcuts_settings.h"
|
#include "../../client/settings/shortcuts_settings.h"
|
||||||
#include "../../game/board/counter_state.h"
|
|
||||||
#include "../../game/player/player_actions.h"
|
|
||||||
#include "../../game/player/player_info.h"
|
|
||||||
#include "../../game/player/player_logic.h"
|
|
||||||
#include "../../game_graphics/board/translate_counter_name.h"
|
#include "../../game_graphics/board/translate_counter_name.h"
|
||||||
#include "../../interface/widgets/menus/tearoff_menu.h"
|
#include "../../interface/widgets/menus/tearoff_menu.h"
|
||||||
|
|
||||||
|
|
@ -23,6 +19,10 @@
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
#include <libcockatrice/game/board/counter_state.h>
|
||||||
|
#include <libcockatrice/game/player/player_actions.h>
|
||||||
|
#include <libcockatrice/game/player/player_info.h>
|
||||||
|
#include <libcockatrice/game/player/player_logic.h>
|
||||||
#include <libcockatrice/utility/expression.h>
|
#include <libcockatrice/utility/expression.h>
|
||||||
#include <qnamespace.h>
|
#include <qnamespace.h>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,6 @@
|
||||||
#include "arrow_item.h"
|
#include "arrow_item.h"
|
||||||
|
|
||||||
#include "../../client/settings/cache_settings.h"
|
#include "../../client/settings/cache_settings.h"
|
||||||
#include "../../game/board/arrow_data.h"
|
|
||||||
#include "../../game/player/player_actions.h"
|
|
||||||
#include "../../game/player/player_info.h"
|
|
||||||
#include "../../game/player/player_logic.h"
|
|
||||||
#include "../../game/zones/card_zone_logic.h"
|
|
||||||
#include "../game_scene.h"
|
#include "../game_scene.h"
|
||||||
#include "../player/player_target.h"
|
#include "../player/player_target.h"
|
||||||
#include "../z_values.h"
|
#include "../z_values.h"
|
||||||
|
|
@ -27,6 +22,11 @@
|
||||||
#include <QTransform>
|
#include <QTransform>
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
#include <QtMath>
|
#include <QtMath>
|
||||||
|
#include <libcockatrice/game/board/arrow_data.h>
|
||||||
|
#include <libcockatrice/game/player/player_actions.h>
|
||||||
|
#include <libcockatrice/game/player/player_info.h>
|
||||||
|
#include <libcockatrice/game/player/player_logic.h>
|
||||||
|
#include <libcockatrice/game/zones/card_zone_logic.h>
|
||||||
#include <libcockatrice/settings/cards_display_settings.h>
|
#include <libcockatrice/settings/cards_display_settings.h>
|
||||||
#include <libcockatrice/utility/zone_names.h>
|
#include <libcockatrice/utility/zone_names.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
#ifndef ARROWITEM_H
|
#ifndef ARROWITEM_H
|
||||||
#define ARROWITEM_H
|
#define ARROWITEM_H
|
||||||
|
|
||||||
#include "../../game/board/arrow_data.h"
|
|
||||||
#include "../animated_item.h"
|
#include "../animated_item.h"
|
||||||
#include "arrow_target.h"
|
#include "arrow_target.h"
|
||||||
#include "graphics_item_type.h"
|
#include "graphics_item_type.h"
|
||||||
|
|
@ -18,6 +17,7 @@
|
||||||
#include <QRectF>
|
#include <QRectF>
|
||||||
#include <QSharedPointer>
|
#include <QSharedPointer>
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
#include <libcockatrice/game/board/arrow_data.h>
|
||||||
#include <qtmetamacros.h>
|
#include <qtmetamacros.h>
|
||||||
|
|
||||||
class CardItem;
|
class CardItem;
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
#include "arrow_registry.h"
|
#include "arrow_registry.h"
|
||||||
|
|
||||||
#include "../../game/board/arrow_data.h"
|
|
||||||
#include "arrow_item.h"
|
#include "arrow_item.h"
|
||||||
|
|
||||||
#include <QSharedPointer>
|
#include <QSharedPointer>
|
||||||
|
#include <libcockatrice/game/board/arrow_data.h>
|
||||||
|
|
||||||
void ArrowRegistry::insert(QSharedPointer<ArrowData> data, ArrowItem *arrow)
|
void ArrowRegistry::insert(QSharedPointer<ArrowData> data, ArrowItem *arrow)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,10 @@
|
||||||
#ifndef COCKATRICE_ARROW_REGISTRY_H
|
#ifndef COCKATRICE_ARROW_REGISTRY_H
|
||||||
#define COCKATRICE_ARROW_REGISTRY_H
|
#define COCKATRICE_ARROW_REGISTRY_H
|
||||||
|
|
||||||
#include "../../game/board/arrow_data.h"
|
|
||||||
|
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include <QSet>
|
#include <QSet>
|
||||||
|
#include <libcockatrice/game/board/arrow_data.h>
|
||||||
|
|
||||||
class ArrowItem;
|
class ArrowItem;
|
||||||
struct ArrowData;
|
struct ArrowData;
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,6 @@
|
||||||
#include "card_item.h"
|
#include "card_item.h"
|
||||||
|
|
||||||
#include "../../client/settings/cache_settings.h"
|
#include "../../client/settings/cache_settings.h"
|
||||||
#include "../../game/abstract_game.h"
|
|
||||||
#include "../../game/board/card_state.h"
|
|
||||||
#include "../../game/game_state.h"
|
|
||||||
#include "../../game/phase.h"
|
|
||||||
#include "../../game/player/player_actions.h"
|
|
||||||
#include "../../game/player/player_info.h"
|
|
||||||
#include "../../game/player/player_logic.h"
|
|
||||||
#include "../../game/player/player_manager.h"
|
|
||||||
#include "../../game/zones/card_zone_logic.h"
|
|
||||||
#include "../../game/zones/table_zone_logic.h"
|
|
||||||
#include "../../game/zones/view_zone_logic.h"
|
|
||||||
#include "../card_dimensions.h"
|
#include "../card_dimensions.h"
|
||||||
#include "../game_scene.h"
|
#include "../game_scene.h"
|
||||||
#include "arrow_item.h"
|
#include "arrow_item.h"
|
||||||
|
|
@ -41,6 +30,17 @@
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
#include <libcockatrice/card/card_info.h>
|
#include <libcockatrice/card/card_info.h>
|
||||||
|
#include <libcockatrice/game/abstract_game.h>
|
||||||
|
#include <libcockatrice/game/board/card_state.h>
|
||||||
|
#include <libcockatrice/game/game_state.h>
|
||||||
|
#include <libcockatrice/game/phase.h>
|
||||||
|
#include <libcockatrice/game/player/player_actions.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/zones/card_zone_logic.h>
|
||||||
|
#include <libcockatrice/game/zones/table_zone_logic.h>
|
||||||
|
#include <libcockatrice/game/zones/view_zone_logic.h>
|
||||||
#include <libcockatrice/protocol/pb/serverinfo_card.pb.h>
|
#include <libcockatrice/protocol/pb/serverinfo_card.pb.h>
|
||||||
#include <libcockatrice/settings/interface_settings.h>
|
#include <libcockatrice/settings/interface_settings.h>
|
||||||
#include <libcockatrice/utility/card_ref.h>
|
#include <libcockatrice/utility/card_ref.h>
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@
|
||||||
#ifndef CARDITEM_H
|
#ifndef CARDITEM_H
|
||||||
#define CARDITEM_H
|
#define CARDITEM_H
|
||||||
|
|
||||||
#include "../../game/board/card_state.h"
|
|
||||||
#include "abstract_card_item.h"
|
#include "abstract_card_item.h"
|
||||||
#include "graphics_item_type.h"
|
#include "graphics_item_type.h"
|
||||||
|
|
||||||
|
|
@ -16,6 +15,7 @@
|
||||||
#include <QPointF>
|
#include <QPointF>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QVariantList>
|
#include <QVariantList>
|
||||||
|
#include <libcockatrice/game/board/card_state.h>
|
||||||
#include <qtmetamacros.h>
|
#include <qtmetamacros.h>
|
||||||
|
|
||||||
class CardDragItem;
|
class CardDragItem;
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,6 @@
|
||||||
|
|
||||||
#include "../../client/settings/cache_settings.h"
|
#include "../../client/settings/cache_settings.h"
|
||||||
#include "../../client/settings/shortcuts_settings.h"
|
#include "../../client/settings/shortcuts_settings.h"
|
||||||
#include "../../game/abstract_game.h"
|
|
||||||
#include "../../game/game_event_handler.h"
|
|
||||||
#include "../../game/game_state.h"
|
|
||||||
#include "../../interface/card_picture_loader/card_picture_loader.h"
|
#include "../../interface/card_picture_loader/card_picture_loader.h"
|
||||||
#include "../../interface/deck_loader/deck_loader.h"
|
#include "../../interface/deck_loader/deck_loader.h"
|
||||||
#include "../../interface/widgets/dialogs/dlg_load_deck.h"
|
#include "../../interface/widgets/dialogs/dlg_load_deck.h"
|
||||||
|
|
@ -34,6 +31,9 @@
|
||||||
#include <libcockatrice/deck_list/deck_file_format.h>
|
#include <libcockatrice/deck_list/deck_file_format.h>
|
||||||
#include <libcockatrice/deck_list/loaded_deck.h>
|
#include <libcockatrice/deck_list/loaded_deck.h>
|
||||||
#include <libcockatrice/deck_list/playmat_resolver.h>
|
#include <libcockatrice/deck_list/playmat_resolver.h>
|
||||||
|
#include <libcockatrice/game/abstract_game.h>
|
||||||
|
#include <libcockatrice/game/game_event_handler.h>
|
||||||
|
#include <libcockatrice/game/game_state.h>
|
||||||
#include <libcockatrice/protocol/pb/response_deck_download.pb.h>
|
#include <libcockatrice/protocol/pb/response_deck_download.pb.h>
|
||||||
#include <libcockatrice/protocol/pending_command.h>
|
#include <libcockatrice/protocol/pending_command.h>
|
||||||
#include <libcockatrice/settings/interface_settings.h>
|
#include <libcockatrice/settings/interface_settings.h>
|
||||||
|
|
|
||||||
|
|
@ -7,12 +7,11 @@
|
||||||
#ifndef DLG_CREATETOKEN_H
|
#ifndef DLG_CREATETOKEN_H
|
||||||
#define DLG_CREATETOKEN_H
|
#define DLG_CREATETOKEN_H
|
||||||
|
|
||||||
#include "../../game/player/token_info.h"
|
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
#include <libcockatrice/game/player/token_info.h>
|
||||||
#include <qtmetamacros.h>
|
#include <qtmetamacros.h>
|
||||||
|
|
||||||
class QLabel;
|
class QLabel;
|
||||||
|
|
|
||||||
|
|
@ -7,12 +7,11 @@
|
||||||
#ifndef DLG_MOVE_TOP_CARDS_UNTIL_H
|
#ifndef DLG_MOVE_TOP_CARDS_UNTIL_H
|
||||||
#define DLG_MOVE_TOP_CARDS_UNTIL_H
|
#define DLG_MOVE_TOP_CARDS_UNTIL_H
|
||||||
|
|
||||||
#include "../../game/player/move_top_cards_until_options.h"
|
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
#include <libcockatrice/game/player/move_top_cards_until_options.h>
|
||||||
#include <qtmetamacros.h>
|
#include <qtmetamacros.h>
|
||||||
|
|
||||||
class FilterString;
|
class FilterString;
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,6 @@
|
||||||
#include "game_scene.h"
|
#include "game_scene.h"
|
||||||
|
|
||||||
#include "../client/settings/cache_settings.h"
|
#include "../client/settings/cache_settings.h"
|
||||||
#include "../game/abstract_game.h"
|
|
||||||
#include "../game/board/arrow_data.h"
|
|
||||||
#include "../game/player/player_actions.h"
|
|
||||||
#include "../game/player/player_event_handler.h"
|
|
||||||
#include "../game/player/player_info.h"
|
|
||||||
#include "../game/player/player_logic.h"
|
|
||||||
#include "../game/zones/card_zone_logic.h"
|
|
||||||
#include "../game/zones/view_zone_logic.h"
|
|
||||||
#include "animated_item.h"
|
#include "animated_item.h"
|
||||||
#include "board/abstract_card_item.h"
|
#include "board/abstract_card_item.h"
|
||||||
#include "board/arrow_item.h"
|
#include "board/arrow_item.h"
|
||||||
|
|
@ -41,6 +33,14 @@
|
||||||
#include <QtMath>
|
#include <QtMath>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
#include <libcockatrice/game/abstract_game.h>
|
||||||
|
#include <libcockatrice/game/board/arrow_data.h>
|
||||||
|
#include <libcockatrice/game/player/player_actions.h>
|
||||||
|
#include <libcockatrice/game/player/player_event_handler.h>
|
||||||
|
#include <libcockatrice/game/player/player_info.h>
|
||||||
|
#include <libcockatrice/game/player/player_logic.h>
|
||||||
|
#include <libcockatrice/game/zones/card_zone_logic.h>
|
||||||
|
#include <libcockatrice/game/zones/view_zone_logic.h>
|
||||||
#include <libcockatrice/settings/interface_settings.h>
|
#include <libcockatrice/settings/interface_settings.h>
|
||||||
#include <libcockatrice/utility/zone_names.h>
|
#include <libcockatrice/utility/zone_names.h>
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
#ifndef GAMESCENE_H
|
#ifndef GAMESCENE_H
|
||||||
#define GAMESCENE_H
|
#define GAMESCENE_H
|
||||||
|
|
||||||
#include "../game/board/arrow_data.h"
|
|
||||||
#include "../game/zones/card_zone_logic.h"
|
|
||||||
#include "animated_item.h"
|
#include "animated_item.h"
|
||||||
#include "board/arrow_item.h"
|
#include "board/arrow_item.h"
|
||||||
#include "board/arrow_registry.h"
|
#include "board/arrow_registry.h"
|
||||||
|
|
@ -20,6 +18,8 @@
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QTransform>
|
#include <QTransform>
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
#include <libcockatrice/game/board/arrow_data.h>
|
||||||
|
#include <libcockatrice/game/zones/card_zone_logic.h>
|
||||||
#include <qtmetamacros.h>
|
#include <qtmetamacros.h>
|
||||||
|
|
||||||
// IWYU pragma: keep
|
// IWYU pragma: keep
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
#include "hand_counter.h"
|
#include "hand_counter.h"
|
||||||
|
|
||||||
#include "../game/board/card_list.h"
|
|
||||||
#include "../game/zones/card_zone_logic.h"
|
|
||||||
#include "../interface/pixel_map_generator.h"
|
#include "../interface/pixel_map_generator.h"
|
||||||
|
|
||||||
#include <QGraphicsSceneMouseEvent>
|
#include <QGraphicsSceneMouseEvent>
|
||||||
|
|
@ -14,6 +12,8 @@
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QStringLiteral>
|
#include <QStringLiteral>
|
||||||
#include <QTransform>
|
#include <QTransform>
|
||||||
|
#include <libcockatrice/game/board/card_list.h>
|
||||||
|
#include <libcockatrice/game/zones/card_zone_logic.h>
|
||||||
#include <qnamespace.h>
|
#include <qnamespace.h>
|
||||||
|
|
||||||
class QGraphicsItem;
|
class QGraphicsItem;
|
||||||
|
|
|
||||||
|
|
@ -3,16 +3,6 @@
|
||||||
#include "../../client/settings/cache_settings.h"
|
#include "../../client/settings/cache_settings.h"
|
||||||
#include "../../client/settings/card_counter_settings.h"
|
#include "../../client/settings/card_counter_settings.h"
|
||||||
#include "../../client/sound_engine.h"
|
#include "../../client/sound_engine.h"
|
||||||
#include "../../client/translation.h"
|
|
||||||
#include "../../game/abstract_game.h"
|
|
||||||
#include "../../game/board/card_list.h"
|
|
||||||
#include "../../game/game_state.h"
|
|
||||||
#include "../../game/phase.h"
|
|
||||||
#include "../../game/player/player_event_handler.h"
|
|
||||||
#include "../../game/player/player_info.h"
|
|
||||||
#include "../../game/player/player_logic.h"
|
|
||||||
#include "../../game/player/player_manager.h"
|
|
||||||
#include "../../game/zones/card_zone_logic.h"
|
|
||||||
#include "../../interface/card_localization.h"
|
#include "../../interface/card_localization.h"
|
||||||
#include "../../interface/widgets/server/chat_view/chat_view.h"
|
#include "../../interface/widgets/server/chat_view/chat_view.h"
|
||||||
#include "../board/card_item.h"
|
#include "../board/card_item.h"
|
||||||
|
|
@ -24,6 +14,16 @@
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QSharedPointer>
|
#include <QSharedPointer>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
#include <libcockatrice/game/abstract_game.h>
|
||||||
|
#include <libcockatrice/game/board/card_list.h>
|
||||||
|
#include <libcockatrice/game/game_state.h>
|
||||||
|
#include <libcockatrice/game/phase.h>
|
||||||
|
#include <libcockatrice/game/player/player_event_handler.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/translation.h>
|
||||||
|
#include <libcockatrice/game/zones/card_zone_logic.h>
|
||||||
#include <libcockatrice/protocol/pb/context_move_card.pb.h>
|
#include <libcockatrice/protocol/pb/context_move_card.pb.h>
|
||||||
#include <libcockatrice/protocol/pb/context_mulligan.pb.h>
|
#include <libcockatrice/protocol/pb/context_mulligan.pb.h>
|
||||||
#include <libcockatrice/settings/chat_settings.h>
|
#include <libcockatrice/settings/chat_settings.h>
|
||||||
|
|
|
||||||
|
|
@ -3,15 +3,7 @@
|
||||||
#include "../../../client/settings/cache_settings.h"
|
#include "../../../client/settings/cache_settings.h"
|
||||||
#include "../../../client/settings/card_counter_settings.h"
|
#include "../../../client/settings/card_counter_settings.h"
|
||||||
#include "../../../client/settings/shortcuts_settings.h"
|
#include "../../../client/settings/shortcuts_settings.h"
|
||||||
#include "../../../game/abstract_game.h"
|
|
||||||
#include "../../../game/player/card_menu_action_type.h"
|
|
||||||
#include "../../../game/player/player_info.h"
|
|
||||||
#include "../../../game/player/player_manager.h"
|
|
||||||
#include "../../../game/zones/card_zone_logic.h"
|
|
||||||
#include "../../board/card_item.h"
|
#include "../../board/card_item.h"
|
||||||
#include "../../game/player/player_actions.h"
|
|
||||||
#include "../../game/player/player_logic.h"
|
|
||||||
#include "../../game/zones/view_zone_logic.h"
|
|
||||||
#include "../../game_scene.h"
|
#include "../../game_scene.h"
|
||||||
#include "../player_graphics_item.h"
|
#include "../player_graphics_item.h"
|
||||||
#include "libcockatrice/card/card_info.h"
|
#include "libcockatrice/card/card_info.h"
|
||||||
|
|
@ -35,6 +27,14 @@
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
#include <libcockatrice/card/database/card_database_manager.h>
|
#include <libcockatrice/card/database/card_database_manager.h>
|
||||||
#include <libcockatrice/card/relation/card_relation.h>
|
#include <libcockatrice/card/relation/card_relation.h>
|
||||||
|
#include <libcockatrice/game/abstract_game.h>
|
||||||
|
#include <libcockatrice/game/player/card_menu_action_type.h>
|
||||||
|
#include <libcockatrice/game/player/player_actions.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/zones/card_zone_logic.h>
|
||||||
|
#include <libcockatrice/game/zones/view_zone_logic.h>
|
||||||
#include <libcockatrice/utility/zone_names.h>
|
#include <libcockatrice/utility/zone_names.h>
|
||||||
#include <qnamespace.h>
|
#include <qnamespace.h>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
#include "custom_zone_menu.h"
|
#include "custom_zone_menu.h"
|
||||||
|
|
||||||
#include "../../../game/player/player_info.h"
|
|
||||||
#include "../../game/player/player_logic.h"
|
|
||||||
#include "../../game_scene.h"
|
#include "../../game_scene.h"
|
||||||
#include "../player_graphics_item.h"
|
#include "../player_graphics_item.h"
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
|
#include <libcockatrice/game/player/player_info.h>
|
||||||
|
#include <libcockatrice/game/player/player_logic.h>
|
||||||
|
|
||||||
CustomZoneMenu::CustomZoneMenu(PlayerGraphicsItem *_player) : player(_player)
|
CustomZoneMenu::CustomZoneMenu(PlayerGraphicsItem *_player) : player(_player)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,7 @@
|
||||||
|
|
||||||
#include "../../../client/settings/cache_settings.h"
|
#include "../../../client/settings/cache_settings.h"
|
||||||
#include "../../../client/settings/shortcuts_settings.h"
|
#include "../../../client/settings/shortcuts_settings.h"
|
||||||
#include "../../../game/player/player_info.h"
|
|
||||||
#include "../../../game/player/player_manager.h"
|
|
||||||
#include "../../../game/zones/pile_zone_logic.h"
|
|
||||||
#include "../../../interface/widgets/menus/tearoff_menu.h"
|
#include "../../../interface/widgets/menus/tearoff_menu.h"
|
||||||
#include "../../game/abstract_game.h"
|
|
||||||
#include "../../game/player/player_actions.h"
|
|
||||||
#include "../../game/player/player_logic.h"
|
|
||||||
#include "../player_graphics_item.h"
|
#include "../player_graphics_item.h"
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
|
|
@ -19,6 +13,12 @@
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
|
#include <libcockatrice/game/abstract_game.h>
|
||||||
|
#include <libcockatrice/game/player/player_actions.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/zones/pile_zone_logic.h>
|
||||||
#include <libcockatrice/utility/zone_names.h>
|
#include <libcockatrice/utility/zone_names.h>
|
||||||
|
|
||||||
class QWidget;
|
class QWidget;
|
||||||
|
|
|
||||||
|
|
@ -2,14 +2,7 @@
|
||||||
|
|
||||||
#include "../../../client/settings/cache_settings.h"
|
#include "../../../client/settings/cache_settings.h"
|
||||||
#include "../../../client/settings/shortcuts_settings.h"
|
#include "../../../client/settings/shortcuts_settings.h"
|
||||||
#include "../../../game/board/card_list.h"
|
|
||||||
#include "../../../game/player/player_info.h"
|
|
||||||
#include "../../../game/player/player_manager.h"
|
|
||||||
#include "../../../game/zones/hand_zone_logic.h"
|
|
||||||
#include "../../../interface/widgets/menus/tearoff_menu.h"
|
#include "../../../interface/widgets/menus/tearoff_menu.h"
|
||||||
#include "../../game/abstract_game.h"
|
|
||||||
#include "../../game/player/player_actions.h"
|
|
||||||
#include "../../game/player/player_logic.h"
|
|
||||||
#include "../player_graphics_item.h"
|
#include "../player_graphics_item.h"
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
|
|
@ -20,6 +13,13 @@
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
|
#include <libcockatrice/game/abstract_game.h>
|
||||||
|
#include <libcockatrice/game/board/card_list.h>
|
||||||
|
#include <libcockatrice/game/player/player_actions.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/zones/hand_zone_logic.h>
|
||||||
#include <libcockatrice/utility/zone_names.h>
|
#include <libcockatrice/utility/zone_names.h>
|
||||||
|
|
||||||
class QWidget;
|
class QWidget;
|
||||||
|
|
|
||||||
|
|
@ -2,14 +2,7 @@
|
||||||
|
|
||||||
#include "../../../client/settings/cache_settings.h"
|
#include "../../../client/settings/cache_settings.h"
|
||||||
#include "../../../client/settings/shortcuts_settings.h"
|
#include "../../../client/settings/shortcuts_settings.h"
|
||||||
#include "../../../game/board/card_list.h"
|
|
||||||
#include "../../../game/player/player_info.h"
|
|
||||||
#include "../../../game/player/player_manager.h"
|
|
||||||
#include "../../../game/zones/pile_zone_logic.h"
|
|
||||||
#include "../../../interface/widgets/menus/tearoff_menu.h"
|
#include "../../../interface/widgets/menus/tearoff_menu.h"
|
||||||
#include "../../game/abstract_game.h"
|
|
||||||
#include "../../game/player/player_actions.h"
|
|
||||||
#include "../../game/player/player_logic.h"
|
|
||||||
#include "../player_graphics_item.h"
|
#include "../player_graphics_item.h"
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
|
|
@ -23,6 +16,13 @@
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
|
#include <libcockatrice/game/abstract_game.h>
|
||||||
|
#include <libcockatrice/game/board/card_list.h>
|
||||||
|
#include <libcockatrice/game/player/player_actions.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/zones/pile_zone_logic.h>
|
||||||
|
|
||||||
class QWidget;
|
class QWidget;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,13 @@
|
||||||
|
|
||||||
#include "../../../client/settings/cache_settings.h"
|
#include "../../../client/settings/cache_settings.h"
|
||||||
#include "../../../client/settings/shortcuts_settings.h"
|
#include "../../../client/settings/shortcuts_settings.h"
|
||||||
#include "../../../game/player/card_menu_action_type.h"
|
|
||||||
#include "../../game/player/player_actions.h"
|
|
||||||
#include "../../game/player/player_logic.h"
|
|
||||||
#include "../../game_scene.h"
|
#include "../../game_scene.h"
|
||||||
#include "../player_graphics_item.h"
|
#include "../player_graphics_item.h"
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
|
#include <libcockatrice/game/player/card_menu_action_type.h>
|
||||||
|
#include <libcockatrice/game/player/player_actions.h>
|
||||||
|
#include <libcockatrice/game/player/player_logic.h>
|
||||||
|
|
||||||
MoveMenu::MoveMenu(PlayerGraphicsItem *player) : QMenu(tr("Move to"))
|
MoveMenu::MoveMenu(PlayerGraphicsItem *player) : QMenu(tr("Move to"))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,6 @@
|
||||||
|
|
||||||
#include "../../../client/settings/cache_settings.h"
|
#include "../../../client/settings/cache_settings.h"
|
||||||
#include "../../../client/settings/shortcuts_settings.h"
|
#include "../../../client/settings/shortcuts_settings.h"
|
||||||
#include "../../../game/abstract_game.h"
|
|
||||||
#include "../../../game/player/player_info.h"
|
|
||||||
#include "../../../game/player/player_logic.h"
|
|
||||||
#include "../../../game/player/player_manager.h"
|
|
||||||
#include "../../../game_graphics/zones/hand_zone.h"
|
#include "../../../game_graphics/zones/hand_zone.h"
|
||||||
#include "../../../game_graphics/zones/pile_zone.h"
|
#include "../../../game_graphics/zones/pile_zone.h"
|
||||||
#include "../../../game_graphics/zones/table_zone.h"
|
#include "../../../game_graphics/zones/table_zone.h"
|
||||||
|
|
@ -26,6 +22,10 @@
|
||||||
|
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
#include <libcockatrice/game/abstract_game.h>
|
||||||
|
#include <libcockatrice/game/player/player_info.h>
|
||||||
|
#include <libcockatrice/game/player/player_logic.h>
|
||||||
|
#include <libcockatrice/game/player/player_manager.h>
|
||||||
|
|
||||||
PlayerMenu::PlayerMenu(PlayerGraphicsItem *_player) : QObject(_player), player(_player)
|
PlayerMenu::PlayerMenu(PlayerGraphicsItem *_player) : QObject(_player), player(_player)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,12 @@
|
||||||
|
|
||||||
#include "../../../client/settings/cache_settings.h"
|
#include "../../../client/settings/cache_settings.h"
|
||||||
#include "../../../client/settings/shortcuts_settings.h"
|
#include "../../../client/settings/shortcuts_settings.h"
|
||||||
#include "../../game/player/player_actions.h"
|
|
||||||
#include "../../game/player/player_logic.h"
|
|
||||||
#include "../../game_scene.h"
|
#include "../../game_scene.h"
|
||||||
#include "../player_graphics_item.h"
|
#include "../player_graphics_item.h"
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
|
#include <libcockatrice/game/player/player_actions.h>
|
||||||
|
#include <libcockatrice/game/player/player_logic.h>
|
||||||
|
|
||||||
PtMenu::PtMenu(PlayerGraphicsItem *player) : QMenu(tr("Power / toughness"))
|
PtMenu::PtMenu(PlayerGraphicsItem *player) : QMenu(tr("Power / toughness"))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,6 @@
|
||||||
#include "rfg_menu.h"
|
#include "rfg_menu.h"
|
||||||
|
|
||||||
#include "../../../game/player/player_info.h"
|
|
||||||
#include "../../../game/zones/pile_zone_logic.h"
|
|
||||||
#include "../../../interface/widgets/menus/tearoff_menu.h"
|
#include "../../../interface/widgets/menus/tearoff_menu.h"
|
||||||
#include "../../game/player/player_actions.h"
|
|
||||||
#include "../../game/player/player_logic.h"
|
|
||||||
#include "../player_graphics_item.h"
|
#include "../player_graphics_item.h"
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
|
|
@ -12,6 +8,10 @@
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
|
#include <libcockatrice/game/player/player_actions.h>
|
||||||
|
#include <libcockatrice/game/player/player_info.h>
|
||||||
|
#include <libcockatrice/game/player/player_logic.h>
|
||||||
|
#include <libcockatrice/game/zones/pile_zone_logic.h>
|
||||||
#include <libcockatrice/utility/zone_names.h>
|
#include <libcockatrice/utility/zone_names.h>
|
||||||
|
|
||||||
class QWidget;
|
class QWidget;
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
#include "say_menu.h"
|
#include "say_menu.h"
|
||||||
|
|
||||||
#include "../../../client/settings/cache_settings.h"
|
#include "../../../client/settings/cache_settings.h"
|
||||||
#include "../../game/player/player_actions.h"
|
|
||||||
#include "../../game/player/player_logic.h"
|
|
||||||
#include "../player_graphics_item.h"
|
#include "../player_graphics_item.h"
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QKeySequence>
|
#include <QKeySequence>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
#include <libcockatrice/game/player/player_actions.h>
|
||||||
|
#include <libcockatrice/game/player/player_logic.h>
|
||||||
#include <libcockatrice/settings/message_settings.h>
|
#include <libcockatrice/settings/message_settings.h>
|
||||||
|
|
||||||
SayMenu::SayMenu(PlayerGraphicsItem *_player) : player(_player)
|
SayMenu::SayMenu(PlayerGraphicsItem *_player) : player(_player)
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,13 @@
|
||||||
|
|
||||||
#include "../../../client/settings/cache_settings.h"
|
#include "../../../client/settings/cache_settings.h"
|
||||||
#include "../../../client/settings/shortcuts_settings.h"
|
#include "../../../client/settings/shortcuts_settings.h"
|
||||||
#include "../../../game/player/player_info.h"
|
|
||||||
#include "../../game/player/player_actions.h"
|
|
||||||
#include "../../game/player/player_logic.h"
|
|
||||||
#include "../player_graphics_item.h"
|
#include "../player_graphics_item.h"
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QKeySequence>
|
#include <QKeySequence>
|
||||||
|
#include <libcockatrice/game/player/player_actions.h>
|
||||||
|
#include <libcockatrice/game/player/player_info.h>
|
||||||
|
#include <libcockatrice/game/player/player_logic.h>
|
||||||
|
|
||||||
SideboardMenu::SideboardMenu(PlayerGraphicsItem *player, QMenu *playerMenu) : QMenu(playerMenu)
|
SideboardMenu::SideboardMenu(PlayerGraphicsItem *player, QMenu *playerMenu) : QMenu(playerMenu)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,6 @@
|
||||||
|
|
||||||
#include "../../../client/settings/cache_settings.h"
|
#include "../../../client/settings/cache_settings.h"
|
||||||
#include "../../../client/settings/shortcuts_settings.h"
|
#include "../../../client/settings/shortcuts_settings.h"
|
||||||
#include "../../../game/player/player_info.h"
|
|
||||||
#include "../../game/player/player_actions.h"
|
|
||||||
#include "../../game/player/player_logic.h"
|
|
||||||
#include "../../game_scene.h"
|
#include "../../game_scene.h"
|
||||||
#include "../player_graphics_item.h"
|
#include "../player_graphics_item.h"
|
||||||
#include "libcockatrice/card/card_info.h"
|
#include "libcockatrice/card/card_info.h"
|
||||||
|
|
@ -14,6 +11,9 @@
|
||||||
#include <QSet>
|
#include <QSet>
|
||||||
#include <libcockatrice/deck_list/tree/deck_list_card_node.h>
|
#include <libcockatrice/deck_list/tree/deck_list_card_node.h>
|
||||||
#include <libcockatrice/deck_list/tree/inner_deck_list_node.h>
|
#include <libcockatrice/deck_list/tree/inner_deck_list_node.h>
|
||||||
|
#include <libcockatrice/game/player/player_actions.h>
|
||||||
|
#include <libcockatrice/game/player/player_info.h>
|
||||||
|
#include <libcockatrice/game/player/player_logic.h>
|
||||||
|
|
||||||
UtilityMenu::UtilityMenu(PlayerGraphicsItem *_player, QMenu *playerMenu) : QMenu(playerMenu), player(_player)
|
UtilityMenu::UtilityMenu(PlayerGraphicsItem *_player, QMenu *playerMenu) : QMenu(playerMenu), player(_player)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
#include "../../client/settings/cache_settings.h"
|
#include "../../client/settings/cache_settings.h"
|
||||||
#include "../../client/settings/card_counter_settings.h"
|
#include "../../client/settings/card_counter_settings.h"
|
||||||
#include "../../game/player/player_actions.h"
|
|
||||||
#include "../../game/player/player_logic.h"
|
|
||||||
#include "../../interface/widgets/utility/get_text_with_max.h"
|
#include "../../interface/widgets/utility/get_text_with_max.h"
|
||||||
#include "../board/abstract_counter.h"
|
#include "../board/abstract_counter.h"
|
||||||
#include "../board/card_item.h"
|
#include "../board/card_item.h"
|
||||||
|
|
@ -18,6 +16,8 @@
|
||||||
#include <QInputDialog>
|
#include <QInputDialog>
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
#include <libcockatrice/card/relation/card_relation.h>
|
#include <libcockatrice/card/relation/card_relation.h>
|
||||||
|
#include <libcockatrice/game/player/player_actions.h>
|
||||||
|
#include <libcockatrice/game/player/player_logic.h>
|
||||||
#include <libcockatrice/utility/string_limits.h>
|
#include <libcockatrice/utility/string_limits.h>
|
||||||
|
|
||||||
PlayerDialogs::PlayerDialogs(PlayerGraphicsItem *_player, PlayerActions *_playerActions)
|
PlayerDialogs::PlayerDialogs(PlayerGraphicsItem *_player, PlayerActions *_playerActions)
|
||||||
|
|
@ -35,7 +35,7 @@ PlayerDialogs::PlayerDialogs(PlayerGraphicsItem *_player, PlayerActions *_player
|
||||||
&PlayerDialogs::onShuffleBottomDialogRequested);
|
&PlayerDialogs::onShuffleBottomDialogRequested);
|
||||||
|
|
||||||
connect(playerActions, &PlayerActions::requestMulliganDialog, this, &PlayerDialogs::onMulliganDialogRequested);
|
connect(playerActions, &PlayerActions::requestMulliganDialog, this, &PlayerDialogs::onMulliganDialogRequested);
|
||||||
|
connect(playerActions, &PlayerActions::startingHandSizeChosen, this, &PlayerDialogs::onStartingHandSizeChosen);
|
||||||
connect(playerActions, &PlayerActions::requestDrawCardsDialog, this, &PlayerDialogs::onDrawCardsDialogRequested);
|
connect(playerActions, &PlayerActions::requestDrawCardsDialog, this, &PlayerDialogs::onDrawCardsDialogRequested);
|
||||||
|
|
||||||
connect(playerActions, &PlayerActions::requestMoveTopCardsToDialog, this,
|
connect(playerActions, &PlayerActions::requestMoveTopCardsToDialog, this,
|
||||||
|
|
@ -127,6 +127,11 @@ void PlayerDialogs::onMulliganDialogRequested(int startSize, int handSize, int d
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PlayerDialogs::onStartingHandSizeChosen(int number)
|
||||||
|
{
|
||||||
|
SettingsCache::instance().userInterface().setStartingHandSize(number);
|
||||||
|
}
|
||||||
|
|
||||||
void PlayerDialogs::onDrawCardsDialogRequested(int defaultNumberTopCards, int deckSize)
|
void PlayerDialogs::onDrawCardsDialogRequested(int defaultNumberTopCards, int deckSize)
|
||||||
{
|
{
|
||||||
bool ok;
|
bool ok;
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
class CardItem;
|
class CardItem;
|
||||||
class CardRelation;
|
class CardRelation;
|
||||||
|
class CardState;
|
||||||
class PlayerActions;
|
class PlayerActions;
|
||||||
class QWidget;
|
class QWidget;
|
||||||
struct MoveTopCardsUntilOptions;
|
struct MoveTopCardsUntilOptions;
|
||||||
|
|
@ -58,6 +59,7 @@ public slots:
|
||||||
void onSetPTDialogRequested(const QString &oldPT);
|
void onSetPTDialogRequested(const QString &oldPT);
|
||||||
void onSetAnnotationDialogRequested(const QString &oldAnnotation);
|
void onSetAnnotationDialogRequested(const QString &oldAnnotation);
|
||||||
void onSetCardCounterDialogRequested(int counterId, const QString &oldValueForDlg);
|
void onSetCardCounterDialogRequested(int counterId, const QString &oldValueForDlg);
|
||||||
|
void onStartingHandSizeChosen(int number);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
PlayerGraphicsItem *player;
|
PlayerGraphicsItem *player;
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,6 @@
|
||||||
#include "player_graphics_item.h"
|
#include "player_graphics_item.h"
|
||||||
|
|
||||||
#include "../../client/settings/cache_settings.h"
|
#include "../../client/settings/cache_settings.h"
|
||||||
#include "../../game/board/counter_state.h"
|
|
||||||
#include "../../game/player/player_actions.h"
|
|
||||||
#include "../../game/player/player_info.h"
|
|
||||||
#include "../../game/player/player_logic.h"
|
|
||||||
#include "../../game/zones/card_zone_logic.h"
|
|
||||||
#include "../../game/zones/hand_zone_logic.h"
|
|
||||||
#include "../../game/zones/pile_zone_logic.h"
|
|
||||||
#include "../../game/zones/stack_zone_logic.h"
|
|
||||||
#include "../../game/zones/table_zone_logic.h"
|
|
||||||
#include "../../interface/card_picture_loader/card_picture_loader.h"
|
#include "../../interface/card_picture_loader/card_picture_loader.h"
|
||||||
#include "../../interface/widgets/cards/art_crop_attribution.h"
|
#include "../../interface/widgets/cards/art_crop_attribution.h"
|
||||||
#include "../../interface/widgets/cards/card_art_utils.h"
|
#include "../../interface/widgets/cards/card_art_utils.h"
|
||||||
|
|
@ -45,6 +36,15 @@
|
||||||
#include <libcockatrice/card/database/card_database_manager.h>
|
#include <libcockatrice/card/database/card_database_manager.h>
|
||||||
#include <libcockatrice/deck_list/deck_list.h>
|
#include <libcockatrice/deck_list/deck_list.h>
|
||||||
#include <libcockatrice/deck_list/playmat_resolver.h>
|
#include <libcockatrice/deck_list/playmat_resolver.h>
|
||||||
|
#include <libcockatrice/game/board/counter_state.h>
|
||||||
|
#include <libcockatrice/game/player/player_actions.h>
|
||||||
|
#include <libcockatrice/game/player/player_info.h>
|
||||||
|
#include <libcockatrice/game/player/player_logic.h>
|
||||||
|
#include <libcockatrice/game/zones/card_zone_logic.h>
|
||||||
|
#include <libcockatrice/game/zones/hand_zone_logic.h>
|
||||||
|
#include <libcockatrice/game/zones/pile_zone_logic.h>
|
||||||
|
#include <libcockatrice/game/zones/stack_zone_logic.h>
|
||||||
|
#include <libcockatrice/game/zones/table_zone_logic.h>
|
||||||
#include <libcockatrice/settings/interface_settings.h>
|
#include <libcockatrice/settings/interface_settings.h>
|
||||||
#include <qnamespace.h>
|
#include <qnamespace.h>
|
||||||
#include <qnumeric.h>
|
#include <qnumeric.h>
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
#include "player_target.h"
|
#include "player_target.h"
|
||||||
|
|
||||||
#include "../../client/settings/cache_settings.h"
|
#include "../../client/settings/cache_settings.h"
|
||||||
#include "../../game/player/player_info.h"
|
|
||||||
#include "../../game/player/player_logic.h"
|
|
||||||
#include "../../interface/pixel_map_generator.h"
|
#include "../../interface/pixel_map_generator.h"
|
||||||
#include "../board/abstract_counter.h"
|
#include "../board/abstract_counter.h"
|
||||||
#include "../board/abstract_graphics_item.h"
|
#include "../board/abstract_graphics_item.h"
|
||||||
|
|
@ -30,6 +28,8 @@
|
||||||
#include <QTransform>
|
#include <QTransform>
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
#include <QtMath>
|
#include <QtMath>
|
||||||
|
#include <libcockatrice/game/player/player_info.h>
|
||||||
|
#include <libcockatrice/game/player/player_logic.h>
|
||||||
#include <libcockatrice/protocol/pb/serverinfo_user.pb.h>
|
#include <libcockatrice/protocol/pb/serverinfo_user.pb.h>
|
||||||
#include <qnamespace.h>
|
#include <qnamespace.h>
|
||||||
#include <qnumeric.h>
|
#include <qnumeric.h>
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
#include "card_zone.h"
|
#include "card_zone.h"
|
||||||
|
|
||||||
#include "../../game/board/card_list.h"
|
|
||||||
#include "../../game/zones/card_zone_logic.h"
|
|
||||||
#include "../board/abstract_graphics_item.h"
|
#include "../board/abstract_graphics_item.h"
|
||||||
#include "../board/card_item.h"
|
#include "../board/card_item.h"
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QGraphicsSceneMouseEvent>
|
#include <QGraphicsSceneMouseEvent>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
|
#include <libcockatrice/game/board/card_list.h>
|
||||||
|
#include <libcockatrice/game/zones/card_zone_logic.h>
|
||||||
#include <qnamespace.h>
|
#include <qnamespace.h>
|
||||||
|
|
||||||
class QGraphicsItem;
|
class QGraphicsItem;
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,6 @@
|
||||||
#include "hand_zone.h"
|
#include "hand_zone.h"
|
||||||
|
|
||||||
#include "../../client/settings/cache_settings.h"
|
#include "../../client/settings/cache_settings.h"
|
||||||
#include "../../game/player/player_actions.h"
|
|
||||||
#include "../../game/player/player_info.h"
|
|
||||||
#include "../../game/player/player_logic.h"
|
|
||||||
#include "../../game/zones/card_zone_logic.h"
|
|
||||||
#include "../../game/zones/hand_zone_logic.h"
|
|
||||||
#include "../../interface/theme_manager.h"
|
#include "../../interface/theme_manager.h"
|
||||||
#include "../board/card_drag_item.h"
|
#include "../board/card_drag_item.h"
|
||||||
#include "../board/card_item.h"
|
#include "../board/card_item.h"
|
||||||
|
|
@ -18,6 +13,11 @@
|
||||||
#include <QPointF>
|
#include <QPointF>
|
||||||
#include <QRectF>
|
#include <QRectF>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
#include <libcockatrice/game/player/player_actions.h>
|
||||||
|
#include <libcockatrice/game/player/player_info.h>
|
||||||
|
#include <libcockatrice/game/player/player_logic.h>
|
||||||
|
#include <libcockatrice/game/zones/card_zone_logic.h>
|
||||||
|
#include <libcockatrice/game/zones/hand_zone_logic.h>
|
||||||
#include <libcockatrice/settings/interface_settings.h>
|
#include <libcockatrice/settings/interface_settings.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,10 @@
|
||||||
#ifndef HANDZONE_H
|
#ifndef HANDZONE_H
|
||||||
#define HANDZONE_H
|
#define HANDZONE_H
|
||||||
|
|
||||||
#include "../../game/board/card_list.h"
|
|
||||||
#include "select_zone.h"
|
#include "select_zone.h"
|
||||||
|
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
#include <libcockatrice/game/board/card_list.h>
|
||||||
#include <qtmetamacros.h>
|
#include <qtmetamacros.h>
|
||||||
|
|
||||||
class HandZoneLogic;
|
class HandZoneLogic;
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,6 @@
|
||||||
#include "pile_zone.h"
|
#include "pile_zone.h"
|
||||||
|
|
||||||
#include "../../client/settings/cache_settings.h"
|
#include "../../client/settings/cache_settings.h"
|
||||||
#include "../../game/board/card_list.h"
|
|
||||||
#include "../../game/player/player_actions.h"
|
|
||||||
#include "../../game/player/player_info.h"
|
|
||||||
#include "../../game/player/player_logic.h"
|
|
||||||
#include "../../game/zones/card_zone_logic.h"
|
|
||||||
#include "../../game/zones/pile_zone_logic.h"
|
|
||||||
#include "../board/card_drag_item.h"
|
#include "../board/card_drag_item.h"
|
||||||
#include "../board/card_item.h"
|
#include "../board/card_item.h"
|
||||||
#include "../card_dimensions.h"
|
#include "../card_dimensions.h"
|
||||||
|
|
@ -24,6 +18,12 @@
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QTransform>
|
#include <QTransform>
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
#include <libcockatrice/game/board/card_list.h>
|
||||||
|
#include <libcockatrice/game/player/player_actions.h>
|
||||||
|
#include <libcockatrice/game/player/player_info.h>
|
||||||
|
#include <libcockatrice/game/player/player_logic.h>
|
||||||
|
#include <libcockatrice/game/zones/card_zone_logic.h>
|
||||||
|
#include <libcockatrice/game/zones/pile_zone_logic.h>
|
||||||
#include <libcockatrice/settings/cards_display_settings.h>
|
#include <libcockatrice/settings/cards_display_settings.h>
|
||||||
#include <qnamespace.h>
|
#include <qnamespace.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
#include "select_zone.h"
|
#include "select_zone.h"
|
||||||
|
|
||||||
#include "../../client/settings/cache_settings.h"
|
#include "../../client/settings/cache_settings.h"
|
||||||
#include "../../game/board/card_list.h"
|
|
||||||
#include "../../game/zones/card_zone_logic.h"
|
|
||||||
#include "../board/card_item.h"
|
#include "../board/card_item.h"
|
||||||
#include "../game_scene.h"
|
#include "../game_scene.h"
|
||||||
|
|
||||||
|
|
@ -17,6 +15,8 @@
|
||||||
#include <QTransform>
|
#include <QTransform>
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
#include <QtMath>
|
#include <QtMath>
|
||||||
|
#include <libcockatrice/game/board/card_list.h>
|
||||||
|
#include <libcockatrice/game/zones/card_zone_logic.h>
|
||||||
#include <libcockatrice/settings/cards_display_settings.h>
|
#include <libcockatrice/settings/cards_display_settings.h>
|
||||||
#include <qnamespace.h>
|
#include <qnamespace.h>
|
||||||
#include <qnumeric.h>
|
#include <qnumeric.h>
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,5 @@
|
||||||
#include "stack_zone.h"
|
#include "stack_zone.h"
|
||||||
|
|
||||||
#include "../../game/board/card_list.h"
|
|
||||||
#include "../../game/player/player_actions.h"
|
|
||||||
#include "../../game/player/player_info.h"
|
|
||||||
#include "../../game/player/player_logic.h"
|
|
||||||
#include "../../game/zones/card_zone_logic.h"
|
|
||||||
#include "../../game/zones/stack_zone_logic.h"
|
|
||||||
#include "../../interface/theme_manager.h"
|
#include "../../interface/theme_manager.h"
|
||||||
#include "../board/card_drag_item.h"
|
#include "../board/card_drag_item.h"
|
||||||
#include "../board/card_item.h"
|
#include "../board/card_item.h"
|
||||||
|
|
@ -19,6 +13,12 @@
|
||||||
#include <QPoint>
|
#include <QPoint>
|
||||||
#include <QRectF>
|
#include <QRectF>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
#include <libcockatrice/game/board/card_list.h>
|
||||||
|
#include <libcockatrice/game/player/player_actions.h>
|
||||||
|
#include <libcockatrice/game/player/player_info.h>
|
||||||
|
#include <libcockatrice/game/player/player_logic.h>
|
||||||
|
#include <libcockatrice/game/zones/card_zone_logic.h>
|
||||||
|
#include <libcockatrice/game/zones/stack_zone_logic.h>
|
||||||
#include <qnumeric.h>
|
#include <qnumeric.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,6 @@
|
||||||
#include "table_zone.h"
|
#include "table_zone.h"
|
||||||
|
|
||||||
#include "../../client/settings/cache_settings.h"
|
#include "../../client/settings/cache_settings.h"
|
||||||
#include "../../game/board/card_list.h"
|
|
||||||
#include "../../game/player/player_actions.h"
|
|
||||||
#include "../../game/player/player_info.h"
|
|
||||||
#include "../../game/player/player_logic.h"
|
|
||||||
#include "../../game/zones/card_zone_logic.h"
|
|
||||||
#include "../../game/zones/table_zone_logic.h"
|
|
||||||
#include "../../interface/theme_manager.h"
|
#include "../../interface/theme_manager.h"
|
||||||
#include "../board/abstract_card_item.h"
|
#include "../board/abstract_card_item.h"
|
||||||
#include "../board/card_drag_item.h"
|
#include "../board/card_drag_item.h"
|
||||||
|
|
@ -32,6 +26,12 @@
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <libcockatrice/card/card_info.h>
|
#include <libcockatrice/card/card_info.h>
|
||||||
|
#include <libcockatrice/game/board/card_list.h>
|
||||||
|
#include <libcockatrice/game/player/player_actions.h>
|
||||||
|
#include <libcockatrice/game/player/player_info.h>
|
||||||
|
#include <libcockatrice/game/player/player_logic.h>
|
||||||
|
#include <libcockatrice/game/zones/card_zone_logic.h>
|
||||||
|
#include <libcockatrice/game/zones/table_zone_logic.h>
|
||||||
#include <libcockatrice/settings/interface_settings.h>
|
#include <libcockatrice/settings/interface_settings.h>
|
||||||
#include <libcockatrice/utility/zone_names.h>
|
#include <libcockatrice/utility/zone_names.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@
|
||||||
#ifndef TABLEZONE_H
|
#ifndef TABLEZONE_H
|
||||||
#define TABLEZONE_H
|
#define TABLEZONE_H
|
||||||
|
|
||||||
#include "../../game/zones/table_zone_logic.h"
|
|
||||||
#include "../animated_item.h"
|
#include "../animated_item.h"
|
||||||
#include "../card_dimensions.h"
|
#include "../card_dimensions.h"
|
||||||
#include "select_zone.h"
|
#include "select_zone.h"
|
||||||
|
|
@ -18,6 +17,7 @@
|
||||||
#include <QPoint>
|
#include <QPoint>
|
||||||
#include <QPointF>
|
#include <QPointF>
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
#include <libcockatrice/game/zones/table_zone_logic.h>
|
||||||
#include <qtmetamacros.h>
|
#include <qtmetamacros.h>
|
||||||
|
|
||||||
class CardDragItem;
|
class CardDragItem;
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,6 @@
|
||||||
#include "view_zone.h"
|
#include "view_zone.h"
|
||||||
|
|
||||||
#include "../../client/settings/cache_settings.h"
|
#include "../../client/settings/cache_settings.h"
|
||||||
#include "../../game/player/player_actions.h"
|
|
||||||
#include "../../game/player/player_info.h"
|
|
||||||
#include "../../game/player/player_logic.h"
|
|
||||||
#include "../../game/zones/card_zone_logic.h"
|
|
||||||
#include "../../game/zones/view_zone_logic.h"
|
|
||||||
#include "../board/card_drag_item.h"
|
#include "../board/card_drag_item.h"
|
||||||
#include "../board/card_item.h"
|
#include "../board/card_item.h"
|
||||||
#include "../card_dimensions.h"
|
#include "../card_dimensions.h"
|
||||||
|
|
@ -26,6 +21,11 @@
|
||||||
#include <QtMath>
|
#include <QtMath>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <libcockatrice/card/card_localization.h>
|
#include <libcockatrice/card/card_localization.h>
|
||||||
|
#include <libcockatrice/game/player/player_actions.h>
|
||||||
|
#include <libcockatrice/game/player/player_info.h>
|
||||||
|
#include <libcockatrice/game/player/player_logic.h>
|
||||||
|
#include <libcockatrice/game/zones/card_zone_logic.h>
|
||||||
|
#include <libcockatrice/game/zones/view_zone_logic.h>
|
||||||
#include <libcockatrice/protocol/pb/response_dump_zone.pb.h>
|
#include <libcockatrice/protocol/pb/response_dump_zone.pb.h>
|
||||||
#include <libcockatrice/protocol/pb/serverinfo_card.pb.h>
|
#include <libcockatrice/protocol/pb/serverinfo_card.pb.h>
|
||||||
#include <libcockatrice/protocol/pending_command.h>
|
#include <libcockatrice/protocol/pending_command.h>
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@
|
||||||
#ifndef ZONEVIEWERZONE_H
|
#ifndef ZONEVIEWERZONE_H
|
||||||
#define ZONEVIEWERZONE_H
|
#define ZONEVIEWERZONE_H
|
||||||
|
|
||||||
#include "../../game/board/card_list.h"
|
|
||||||
#include "select_zone.h"
|
#include "select_zone.h"
|
||||||
|
|
||||||
#include <QGraphicsLayoutItem>
|
#include <QGraphicsLayoutItem>
|
||||||
|
|
@ -17,6 +16,7 @@
|
||||||
#include <QSizeF>
|
#include <QSizeF>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <libcockatrice/filters/filter_string.h>
|
#include <libcockatrice/filters/filter_string.h>
|
||||||
|
#include <libcockatrice/game/board/card_list.h>
|
||||||
#include <qnamespace.h>
|
#include <qnamespace.h>
|
||||||
#include <qtmetamacros.h>
|
#include <qtmetamacros.h>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,7 @@
|
||||||
#include "view_zone_widget.h"
|
#include "view_zone_widget.h"
|
||||||
|
|
||||||
#include "../../client/settings/cache_settings.h"
|
#include "../../client/settings/cache_settings.h"
|
||||||
#include "../../client/translation.h"
|
|
||||||
#include "../../filters/syntax_help.h"
|
#include "../../filters/syntax_help.h"
|
||||||
#include "../../game/board/card_list.h"
|
|
||||||
#include "../../game/player/player_actions.h"
|
|
||||||
#include "../../game/player/player_logic.h"
|
|
||||||
#include "../../game/zones/card_zone_logic.h"
|
|
||||||
#include "../../game/zones/view_zone_logic.h"
|
|
||||||
#include "../../interface/pixel_map_generator.h"
|
#include "../../interface/pixel_map_generator.h"
|
||||||
#include "../card_dimensions.h"
|
#include "../card_dimensions.h"
|
||||||
#include "../z_values.h"
|
#include "../z_values.h"
|
||||||
|
|
@ -45,6 +39,12 @@
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
#include <libcockatrice/game/board/card_list.h>
|
||||||
|
#include <libcockatrice/game/player/player_actions.h>
|
||||||
|
#include <libcockatrice/game/player/player_logic.h>
|
||||||
|
#include <libcockatrice/game/translation.h>
|
||||||
|
#include <libcockatrice/game/zones/card_zone_logic.h>
|
||||||
|
#include <libcockatrice/game/zones/view_zone_logic.h>
|
||||||
#include <libcockatrice/settings/cards_display_settings.h>
|
#include <libcockatrice/settings/cards_display_settings.h>
|
||||||
#include <libcockatrice/settings/interface_settings.h>
|
#include <libcockatrice/settings/interface_settings.h>
|
||||||
#include <qnamespace.h>
|
#include <qnamespace.h>
|
||||||
|
|
@ -177,9 +177,10 @@ ZoneViewWidget::ZoneViewWidget(PlayerLogic *_player,
|
||||||
|
|
||||||
vbox->addItem(zoneHBox);
|
vbox->addItem(zoneHBox);
|
||||||
|
|
||||||
zone = new ZoneViewZone(new ZoneViewZoneLogic(player, _origZone, numberCards, _revealZone, _writeableRevealZone,
|
zone =
|
||||||
_isReversed, zoneContainer),
|
new ZoneViewZone(new ZoneViewZoneLogic(player, _origZone, numberCards, _revealZone, _writeableRevealZone,
|
||||||
zoneContainer);
|
_isReversed, &SettingsCache::instance().userInterface(), zoneContainer),
|
||||||
|
zoneContainer);
|
||||||
connect(zone, &ZoneViewZone::wheelEventReceived, scrollBarProxy, &ScrollableGraphicsProxyWidget::recieveWheelEvent);
|
connect(zone, &ZoneViewZone::wheelEventReceived, scrollBarProxy, &ScrollableGraphicsProxyWidget::recieveWheelEvent);
|
||||||
|
|
||||||
retranslateUi();
|
retranslateUi();
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
#include "replay_manager.h"
|
#include "replay_manager.h"
|
||||||
|
|
||||||
#include "../../../client/settings/cache_settings.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.pb.h"
|
||||||
#include "libcockatrice/protocol/pb/game_event_container.pb.h"
|
#include "libcockatrice/protocol/pb/game_event_container.pb.h"
|
||||||
#include "libcockatrice/protocol/pb/game_replay.pb.h"
|
#include "libcockatrice/protocol/pb/game_replay.pb.h"
|
||||||
|
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <libcockatrice/game/player/event_processing_options.h>
|
||||||
#include <libcockatrice/protocol/get_pb_extension.h>
|
#include <libcockatrice/protocol/get_pb_extension.h>
|
||||||
#include <libcockatrice/settings/interface_settings.h>
|
#include <libcockatrice/settings/interface_settings.h>
|
||||||
#include <qnumeric.h>
|
#include <qnumeric.h>
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,10 @@
|
||||||
#ifndef COCKATRICE_REPLAY_MANAGER_H
|
#ifndef COCKATRICE_REPLAY_MANAGER_H
|
||||||
#define COCKATRICE_REPLAY_MANAGER_H
|
#define COCKATRICE_REPLAY_MANAGER_H
|
||||||
|
|
||||||
#include "../../../game/player/event_processing_options.h"
|
|
||||||
|
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
#include <libcockatrice/game/player/event_processing_options.h>
|
||||||
#include <qtmetamacros.h>
|
#include <qtmetamacros.h>
|
||||||
|
|
||||||
class GameReplay;
|
class GameReplay;
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,8 @@
|
||||||
#ifndef REPLAY_WIDGET_H
|
#ifndef REPLAY_WIDGET_H
|
||||||
#define REPLAY_WIDGET_H
|
#define REPLAY_WIDGET_H
|
||||||
|
|
||||||
#include "../../../game/player/event_processing_options.h"
|
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
#include <libcockatrice/game/player/event_processing_options.h>
|
||||||
#include <qtmetamacros.h>
|
#include <qtmetamacros.h>
|
||||||
|
|
||||||
class ReplayManager;
|
class ReplayManager;
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,5 @@
|
||||||
#include "user_context_menu.h"
|
#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 "../../dialogs/dlg_report_user.h"
|
||||||
#include "../../interface/widgets/tabs/tab_supervisor.h"
|
#include "../../interface/widgets/tabs/tab_supervisor.h"
|
||||||
#include "../chat_view/chat_view.h"
|
#include "../chat_view/chat_view.h"
|
||||||
|
|
@ -37,6 +34,9 @@
|
||||||
#include <QTableWidget>
|
#include <QTableWidget>
|
||||||
#include <QTableWidgetItem>
|
#include <QTableWidgetItem>
|
||||||
#include <QWidget>
|
#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/network/client/abstract/abstract_client.h>
|
||||||
#include <libcockatrice/protocol/pb/command_kick_from_game.pb.h>
|
#include <libcockatrice/protocol/pb/command_kick_from_game.pb.h>
|
||||||
#include <libcockatrice/protocol/pb/commands.pb.h>
|
#include <libcockatrice/protocol/pb/commands.pb.h>
|
||||||
|
|
|
||||||
|
|
@ -2,16 +2,10 @@
|
||||||
|
|
||||||
#include "../../../client/settings/cache_settings.h"
|
#include "../../../client/settings/cache_settings.h"
|
||||||
#include "../../../client/settings/shortcuts_settings.h"
|
#include "../../../client/settings/shortcuts_settings.h"
|
||||||
#include "../../../game/abstract_game.h"
|
#include "../../../database/interface/settings_card_preference_provider.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 "../../../game_graphics/board/abstract_card_item.h"
|
#include "../../../game_graphics/board/abstract_card_item.h"
|
||||||
#include "../game/game.h"
|
#include "../game_graphics/board/arrow_item.h"
|
||||||
#include "../game/player/player_logic.h"
|
#include "../game_graphics/board/card_item.h"
|
||||||
#include "../game/replay.h"
|
|
||||||
#include "../game_graphics/deckview/deck_view_container.h"
|
#include "../game_graphics/deckview/deck_view_container.h"
|
||||||
#include "../game_graphics/deckview/tabbed_deck_view_container.h"
|
#include "../game_graphics/deckview/tabbed_deck_view_container.h"
|
||||||
#include "../game_graphics/game_scene.h"
|
#include "../game_graphics/game_scene.h"
|
||||||
|
|
@ -71,6 +65,15 @@
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
#include <libcockatrice/card/database/card_database_manager.h>
|
#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/network/client/abstract/abstract_client.h>
|
||||||
#include <libcockatrice/protocol/pb/serverinfo_player.pb.h>
|
#include <libcockatrice/protocol/pb/serverinfo_player.pb.h>
|
||||||
#include <libcockatrice/protocol/pb/serverinfo_user.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)
|
: Tab(_tabSupervisor), sayLabel(nullptr), sayEdit(nullptr)
|
||||||
{
|
{
|
||||||
// THIS CTOR IS USED ON REPLAY
|
// 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);
|
createCardInfoDock(true);
|
||||||
createPlayerListDock(true);
|
createPlayerListDock(true);
|
||||||
|
|
@ -141,7 +145,8 @@ TabGame::TabGame(TabSupervisor *_tabSupervisor,
|
||||||
: Tab(_tabSupervisor), userListProxy(_tabSupervisor->getUserListManager())
|
: Tab(_tabSupervisor), userListProxy(_tabSupervisor->getUserListManager())
|
||||||
{
|
{
|
||||||
// THIS CTOR IS USED ON GAMES
|
// 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();
|
createCardInfoDock();
|
||||||
createPlayerListDock();
|
createPlayerListDock();
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,6 @@
|
||||||
|
|
||||||
#include "../../../client/settings/cache_settings.h"
|
#include "../../../client/settings/cache_settings.h"
|
||||||
#include "../../../client/settings/shortcuts_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_connect_to_server.h"
|
||||||
#include "../../intents/contexts/context_join_game.h"
|
#include "../../intents/contexts/context_join_game.h"
|
||||||
#include "../../intents/contexts/context_join_room.h"
|
#include "../../intents/contexts/context_join_room.h"
|
||||||
|
|
@ -63,6 +60,9 @@
|
||||||
#include <QSystemTrayIcon>
|
#include <QSystemTrayIcon>
|
||||||
#include <QTabBar>
|
#include <QTabBar>
|
||||||
#include <libcockatrice/deck_list/loaded_deck.h>
|
#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/abstract/abstract_client.h>
|
||||||
#include <libcockatrice/network/client/remote/remote_client.h>
|
#include <libcockatrice/network/client/remote/remote_client.h>
|
||||||
#include <libcockatrice/protocol/pb/event_game_joined.pb.h>
|
#include <libcockatrice/protocol/pb/event_game_joined.pb.h>
|
||||||
|
|
|
||||||
81
libcockatrice_game/CMakeLists.txt
Normal file
81
libcockatrice_game/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,81 @@
|
||||||
|
set(CMAKE_AUTOMOC ON)
|
||||||
|
set(CMAKE_AUTOUIC ON)
|
||||||
|
set(CMAKE_AUTORCC ON)
|
||||||
|
|
||||||
|
set(HEADERS
|
||||||
|
libcockatrice/game/abstract_game.h
|
||||||
|
libcockatrice/game/board/arrow_data.h
|
||||||
|
libcockatrice/game/board/card_list.h
|
||||||
|
libcockatrice/game/board/card_state.h
|
||||||
|
libcockatrice/game/board/counter_state.h
|
||||||
|
libcockatrice/game/game.h
|
||||||
|
libcockatrice/game/game_event_handler.h
|
||||||
|
libcockatrice/game/game_meta_info.h
|
||||||
|
libcockatrice/game/game_state.h
|
||||||
|
libcockatrice/game/phase.h
|
||||||
|
libcockatrice/game/player/card_menu_action_type.h
|
||||||
|
libcockatrice/game/player/card_move_request.h
|
||||||
|
libcockatrice/game/player/event_processing_options.h
|
||||||
|
libcockatrice/game/player/move_top_cards_until_options.h
|
||||||
|
libcockatrice/game/player/player_actions.h
|
||||||
|
libcockatrice/game/player/player_event_handler.h
|
||||||
|
libcockatrice/game/player/player_info.h
|
||||||
|
libcockatrice/game/player/player_logic.h
|
||||||
|
libcockatrice/game/player/player_manager.h
|
||||||
|
libcockatrice/game/player/token_info.h
|
||||||
|
libcockatrice/game/replay.h
|
||||||
|
libcockatrice/game/translation.h
|
||||||
|
libcockatrice/game/zones/card_zone_algorithms.h
|
||||||
|
libcockatrice/game/zones/card_zone_logic.h
|
||||||
|
libcockatrice/game/zones/hand_zone_logic.h
|
||||||
|
libcockatrice/game/zones/pile_zone_logic.h
|
||||||
|
libcockatrice/game/zones/stack_zone_logic.h
|
||||||
|
libcockatrice/game/zones/table_zone_logic.h
|
||||||
|
libcockatrice/game/zones/view_zone_logic.h
|
||||||
|
)
|
||||||
|
|
||||||
|
qt6_wrap_cpp(MOC_SOURCES ${HEADERS})
|
||||||
|
|
||||||
|
add_library(
|
||||||
|
libcockatrice_game STATIC
|
||||||
|
${MOC_SOURCES}
|
||||||
|
libcockatrice/game/abstract_game.cpp
|
||||||
|
libcockatrice/game/board/arrow_data.cpp
|
||||||
|
libcockatrice/game/board/card_list.cpp
|
||||||
|
libcockatrice/game/board/card_state.cpp
|
||||||
|
libcockatrice/game/board/counter_state.cpp
|
||||||
|
libcockatrice/game/game.cpp
|
||||||
|
libcockatrice/game/game_event_handler.cpp
|
||||||
|
libcockatrice/game/game_meta_info.cpp
|
||||||
|
libcockatrice/game/game_state.cpp
|
||||||
|
libcockatrice/game/phase.cpp
|
||||||
|
libcockatrice/game/player/player_actions.cpp
|
||||||
|
libcockatrice/game/player/player_event_handler.cpp
|
||||||
|
libcockatrice/game/player/player_info.cpp
|
||||||
|
libcockatrice/game/player/player_logic.cpp
|
||||||
|
libcockatrice/game/player/player_manager.cpp
|
||||||
|
libcockatrice/game/replay.cpp
|
||||||
|
libcockatrice/game/zones/card_zone_logic.cpp
|
||||||
|
libcockatrice/game/zones/hand_zone_logic.cpp
|
||||||
|
libcockatrice/game/zones/pile_zone_logic.cpp
|
||||||
|
libcockatrice/game/zones/stack_zone_logic.cpp
|
||||||
|
libcockatrice/game/zones/table_zone_logic.cpp
|
||||||
|
libcockatrice/game/zones/view_zone_logic.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
target_include_directories(libcockatrice_game PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
|
target_link_libraries(
|
||||||
|
libcockatrice_game
|
||||||
|
PUBLIC libcockatrice_card
|
||||||
|
libcockatrice_deck_list
|
||||||
|
libcockatrice_filters
|
||||||
|
libcockatrice_interfaces
|
||||||
|
libcockatrice_network
|
||||||
|
libcockatrice_protocol
|
||||||
|
libcockatrice_settings
|
||||||
|
libcockatrice_utility
|
||||||
|
${QT_CORE_MODULE}
|
||||||
|
${COCKATRICE_QT_VERSION_NAME}::Concurrent
|
||||||
|
${COCKATRICE_QT_VERSION_NAME}::Gui
|
||||||
|
)
|
||||||
|
|
@ -16,13 +16,16 @@ Game::Game(QObject *_parent,
|
||||||
bool isLocalGame,
|
bool isLocalGame,
|
||||||
QList<AbstractClient *> &_clients,
|
QList<AbstractClient *> &_clients,
|
||||||
const Event_GameJoined &event,
|
const Event_GameJoined &event,
|
||||||
const QMap<int, QString> &_roomGameTypes)
|
const QMap<int, QString> &_roomGameTypes,
|
||||||
|
IInterfaceSettingsProvider *interfaceSettings,
|
||||||
|
ICardPreferenceProvider *cardPreferences)
|
||||||
: AbstractGame(_parent)
|
: AbstractGame(_parent)
|
||||||
{
|
{
|
||||||
gameMetaInfo->setFromProto(event.game_info());
|
gameMetaInfo->setFromProto(event.game_info());
|
||||||
gameMetaInfo->setRoomGameTypes(_roomGameTypes);
|
gameMetaInfo->setRoomGameTypes(_roomGameTypes);
|
||||||
gameState = new GameState(this, 0, event.host_id(), isLocalGame, _clients, false, event.resuming(), -1, false);
|
gameState = new GameState(this, 0, event.host_id(), isLocalGame, _clients, false, event.resuming(), -1, false);
|
||||||
connect(gameMetaInfo, &GameMetaInfo::startedChanged, gameState, &GameState::onStartedChanged);
|
connect(gameMetaInfo, &GameMetaInfo::startedChanged, gameState, &GameState::onStartedChanged);
|
||||||
playerManager = new PlayerManager(this, event.player_id(), event.judge(), event.spectator());
|
playerManager = new PlayerManager(this, event.player_id(), event.judge(), event.spectator(), interfaceSettings,
|
||||||
|
cardPreferences);
|
||||||
gameMetaInfo->setStarted(false);
|
gameMetaInfo->setStarted(false);
|
||||||
}
|
}
|
||||||
|
|
@ -18,6 +18,9 @@ class QString;
|
||||||
template <class Key, class T> class QMap;
|
template <class Key, class T> class QMap;
|
||||||
template <typename T> class QList;
|
template <typename T> class QList;
|
||||||
|
|
||||||
|
class ICardPreferenceProvider;
|
||||||
|
class IInterfaceSettingsProvider;
|
||||||
|
|
||||||
class Game : public AbstractGame
|
class Game : public AbstractGame
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
@ -27,7 +30,9 @@ public:
|
||||||
bool isLocalGame,
|
bool isLocalGame,
|
||||||
QList<AbstractClient *> &_clients,
|
QList<AbstractClient *> &_clients,
|
||||||
const Event_GameJoined &event,
|
const Event_GameJoined &event,
|
||||||
const QMap<int, QString> &_roomGameTypes);
|
const QMap<int, QString> &_roomGameTypes,
|
||||||
|
IInterfaceSettingsProvider *interfaceSettings = nullptr,
|
||||||
|
ICardPreferenceProvider *cardPreferences = nullptr);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // COCKATRICE_GAME_H
|
#endif // COCKATRICE_GAME_H
|
||||||
|
|
@ -37,7 +37,6 @@
|
||||||
class AbstractClient;
|
class AbstractClient;
|
||||||
class AbstractGame;
|
class AbstractGame;
|
||||||
class GameEventContainer;
|
class GameEventContainer;
|
||||||
class GameEventContext;
|
|
||||||
class PendingCommand;
|
class PendingCommand;
|
||||||
class PlayerLogic;
|
class PlayerLogic;
|
||||||
class Response;
|
class Response;
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
#include "player_actions.h"
|
#include "player_actions.h"
|
||||||
|
|
||||||
#include "../../client/settings/cache_settings.h"
|
|
||||||
#include "../../game_graphics/dialogs/dlg_create_token.h"
|
|
||||||
#include "../abstract_game.h"
|
#include "../abstract_game.h"
|
||||||
#include "../board/arrow_data.h"
|
#include "../board/arrow_data.h"
|
||||||
#include "../board/card_state.h"
|
#include "../board/card_state.h"
|
||||||
|
|
@ -47,6 +45,8 @@
|
||||||
#include <libcockatrice/card/database/card_database_manager.h>
|
#include <libcockatrice/card/database/card_database_manager.h>
|
||||||
#include <libcockatrice/card/relation/card_relation.h>
|
#include <libcockatrice/card/relation/card_relation.h>
|
||||||
#include <libcockatrice/deck_list/loaded_deck.h>
|
#include <libcockatrice/deck_list/loaded_deck.h>
|
||||||
|
#include <libcockatrice/interfaces/interface_card_preference_provider.h>
|
||||||
|
#include <libcockatrice/interfaces/interface_interface_settings_provider.h>
|
||||||
#include <libcockatrice/protocol/pb/command_attach_card.pb.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_change_zone_properties.pb.h>
|
||||||
#include <libcockatrice/protocol/pb/command_create_arrow.pb.h>
|
#include <libcockatrice/protocol/pb/command_create_arrow.pb.h>
|
||||||
|
|
@ -65,8 +65,7 @@
|
||||||
#include <libcockatrice/protocol/pb/command_set_counter.pb.h>
|
#include <libcockatrice/protocol/pb/command_set_counter.pb.h>
|
||||||
#include <libcockatrice/protocol/pb/command_shuffle.pb.h>
|
#include <libcockatrice/protocol/pb/command_shuffle.pb.h>
|
||||||
#include <libcockatrice/protocol/pb/command_undo_draw.pb.h>
|
#include <libcockatrice/protocol/pb/command_undo_draw.pb.h>
|
||||||
#include <libcockatrice/settings/card_override_settings.h>
|
#include <libcockatrice/protocol/pb/context_move_card.pb.h>
|
||||||
#include <libcockatrice/settings/interface_settings.h>
|
|
||||||
#include <libcockatrice/utility/clamped_arithmetic.h>
|
#include <libcockatrice/utility/clamped_arithmetic.h>
|
||||||
#include <libcockatrice/utility/color.h>
|
#include <libcockatrice/utility/color.h>
|
||||||
#include <libcockatrice/utility/counter_limits.h>
|
#include <libcockatrice/utility/counter_limits.h>
|
||||||
|
|
@ -80,8 +79,11 @@
|
||||||
// milliseconds in between triggers of the move top cards until action
|
// milliseconds in between triggers of the move top cards until action
|
||||||
static constexpr int MOVE_TOP_CARD_UNTIL_INTERVAL = 100;
|
static constexpr int MOVE_TOP_CARD_UNTIL_INTERVAL = 100;
|
||||||
|
|
||||||
PlayerActions::PlayerActions(PlayerLogic *_player)
|
PlayerActions::PlayerActions(PlayerLogic *_player,
|
||||||
: QObject(_player), player(_player), lastTokenTableRow(0), movingCardsUntil(false)
|
IInterfaceSettingsProvider *_interfaceSettings,
|
||||||
|
ICardPreferenceProvider *_cardPreferences)
|
||||||
|
: QObject(_player), player(_player), interfaceSettings(_interfaceSettings), cardPreferences(_cardPreferences),
|
||||||
|
lastTokenTableRow(0), movingCardsUntil(false)
|
||||||
{
|
{
|
||||||
connect(this, &PlayerActions::requestZoneViewToggle, player, &PlayerLogic::onRequestZoneViewToggle);
|
connect(this, &PlayerActions::requestZoneViewToggle, player, &PlayerLogic::onRequestZoneViewToggle);
|
||||||
|
|
||||||
|
|
@ -91,6 +93,26 @@ PlayerActions::PlayerActions(PlayerLogic *_player)
|
||||||
connect(moveTopCardTimer, &QTimer::timeout, [this]() { actMoveTopCardToPlay(); });
|
connect(moveTopCardTimer, &QTimer::timeout, [this]() { actMoveTopCardToPlay(); });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool PlayerActions::getPlayToStack() const
|
||||||
|
{
|
||||||
|
return interfaceSettings ? interfaceSettings->getPlayToStack() : true;
|
||||||
|
}
|
||||||
|
|
||||||
|
int PlayerActions::getStartingHandSize() const
|
||||||
|
{
|
||||||
|
return interfaceSettings ? interfaceSettings->getStartingHandSize() : 7;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool PlayerActions::getAnnotateTokens() const
|
||||||
|
{
|
||||||
|
return interfaceSettings ? interfaceSettings->getAnnotateTokens() : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString PlayerActions::getCardPreferenceOverride(const QString &cardName) const
|
||||||
|
{
|
||||||
|
return cardPreferences ? cardPreferences->getCardPreferenceOverride(cardName) : QString();
|
||||||
|
}
|
||||||
|
|
||||||
void PlayerActions::playCard(CardState *card, bool faceDown)
|
void PlayerActions::playCard(CardState *card, bool faceDown)
|
||||||
{
|
{
|
||||||
if (card == nullptr) {
|
if (card == nullptr) {
|
||||||
|
|
@ -112,7 +134,7 @@ void PlayerActions::playCard(CardState *card, bool faceDown)
|
||||||
const CardInfo &info = exactCard.getInfo();
|
const CardInfo &info = exactCard.getInfo();
|
||||||
|
|
||||||
int tableRow = info.getUiAttributes().tableRow;
|
int tableRow = info.getUiAttributes().tableRow;
|
||||||
bool playToStack = SettingsCache::instance().userInterface().getPlayToStack();
|
bool playToStack = getPlayToStack();
|
||||||
QString currentZone = card->getZone()->getName();
|
QString currentZone = card->getZone()->getName();
|
||||||
if (!faceDown && currentZone == ZoneNames::STACK && tableRow == 3) {
|
if (!faceDown && currentZone == ZoneNames::STACK && tableRow == 3) {
|
||||||
cmd.set_target_zone(ZoneNames::GRAVE);
|
cmd.set_target_zone(ZoneNames::GRAVE);
|
||||||
|
|
@ -214,7 +236,7 @@ void PlayerActions::createArrow(CardState *startCard, const ArrowData &arrow, in
|
||||||
// if the card is in hand then it has just been moved to the stack or table as part of drawing the arrow
|
// if the card is in hand then it has just been moved to the stack or table as part of drawing the arrow
|
||||||
if (arrow.startZone == ZoneNames::HAND) {
|
if (arrow.startZone == ZoneNames::HAND) {
|
||||||
CardInfoPtr ci = startCard->getCard().getCardPtr();
|
CardInfoPtr ci = startCard->getCard().getCardPtr();
|
||||||
bool playToStack = SettingsCache::instance().userInterface().getPlayToStack();
|
bool playToStack = getPlayToStack();
|
||||||
if (ci && ((!playToStack && ci->getUiAttributes().tableRow == 3) ||
|
if (ci && ((!playToStack && ci->getUiAttributes().tableRow == 3) ||
|
||||||
(playToStack && ci->getUiAttributes().tableRow != 0 &&
|
(playToStack && ci->getUiAttributes().tableRow != 0 &&
|
||||||
startCard->getZone()->getName() != ZoneNames::STACK))) {
|
startCard->getZone()->getName() != ZoneNames::STACK))) {
|
||||||
|
|
@ -409,7 +431,7 @@ void PlayerActions::actDrawCard()
|
||||||
|
|
||||||
void PlayerActions::actRequestMulliganDialog()
|
void PlayerActions::actRequestMulliganDialog()
|
||||||
{
|
{
|
||||||
int startSize = SettingsCache::instance().userInterface().getStartingHandSize();
|
int startSize = getStartingHandSize();
|
||||||
int handSize = player->getHandZone()->getCards().size();
|
int handSize = player->getHandZone()->getCards().size();
|
||||||
int deckSize = player->getDeckZone()->getCards().size() + handSize;
|
int deckSize = player->getDeckZone()->getCards().size() + handSize;
|
||||||
|
|
||||||
|
|
@ -425,7 +447,7 @@ void PlayerActions::actMulligan(int number)
|
||||||
}
|
}
|
||||||
|
|
||||||
doMulligan(number);
|
doMulligan(number);
|
||||||
SettingsCache::instance().userInterface().setStartingHandSize(number);
|
emit startingHandSizeChosen(number);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlayerActions::actMulliganSameSize()
|
void PlayerActions::actMulliganSameSize()
|
||||||
|
|
@ -974,13 +996,12 @@ void PlayerActions::setLastTokenInfo(CardInfoPtr cardInfo)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
lastTokenInfo = {
|
lastTokenInfo = {.name = cardInfo->getName(),
|
||||||
.name = cardInfo->getName(),
|
.color = cardInfo->getColors().isEmpty() ? QString() : cardInfo->getColors().left(1).toLower(),
|
||||||
.color = cardInfo->getColors().isEmpty() ? QString() : cardInfo->getColors().left(1).toLower(),
|
.pt = cardInfo->getPowTough(),
|
||||||
.pt = cardInfo->getPowTough(),
|
.annotation = getAnnotateTokens() ? cardInfo->getText() : "",
|
||||||
.annotation = SettingsCache::instance().userInterface().getAnnotateTokens() ? cardInfo->getText() : "",
|
.destroy = true,
|
||||||
.destroy = true,
|
.providerId = getCardPreferenceOverride(cardInfo->getName())};
|
||||||
.providerId = SettingsCache::instance().cardOverrides().getCardPreferenceOverride(cardInfo->getName())};
|
|
||||||
|
|
||||||
lastTokenTableRow = TableZoneLogic::tableRowToGridY(cardInfo->getUiAttributes().tableRow);
|
lastTokenTableRow = TableZoneLogic::tableRowToGridY(cardInfo->getUiAttributes().tableRow);
|
||||||
|
|
||||||
|
|
@ -1208,7 +1229,7 @@ void PlayerActions::createCard(const CardState *sourceCard,
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd.set_pt(cardInfo->getPowTough().toStdString());
|
cmd.set_pt(cardInfo->getPowTough().toStdString());
|
||||||
if (SettingsCache::instance().userInterface().getAnnotateTokens()) {
|
if (getAnnotateTokens()) {
|
||||||
cmd.set_annotation(cardInfo->getText().toStdString());
|
cmd.set_annotation(cardInfo->getText().toStdString());
|
||||||
} else {
|
} else {
|
||||||
cmd.set_annotation("");
|
cmd.set_annotation("");
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
#define COCKATRICE_PLAYER_ACTIONS_H
|
#define COCKATRICE_PLAYER_ACTIONS_H
|
||||||
|
|
||||||
#include "../board/card_list.h"
|
#include "../board/card_list.h"
|
||||||
|
#include "../board/card_state.h"
|
||||||
#include "card_menu_action_type.h"
|
#include "card_menu_action_type.h"
|
||||||
#include "card_move_request.h"
|
#include "card_move_request.h"
|
||||||
#include "libcockatrice/card/card_info.h"
|
#include "libcockatrice/card/card_info.h"
|
||||||
|
|
@ -22,7 +23,6 @@
|
||||||
#include <libcockatrice/filters/filter_string.h>
|
#include <libcockatrice/filters/filter_string.h>
|
||||||
#include <qtmetamacros.h>
|
#include <qtmetamacros.h>
|
||||||
|
|
||||||
class CardItem;
|
|
||||||
class CardRelation;
|
class CardRelation;
|
||||||
class QAction;
|
class QAction;
|
||||||
class QTimer;
|
class QTimer;
|
||||||
|
|
@ -39,8 +39,12 @@ class Message;
|
||||||
class CardState;
|
class CardState;
|
||||||
class CardZoneLogic;
|
class CardZoneLogic;
|
||||||
class Command_MoveCard;
|
class Command_MoveCard;
|
||||||
|
class GameEventContext;
|
||||||
|
class ICardPreferenceProvider;
|
||||||
|
class IInterfaceSettingsProvider;
|
||||||
class PendingCommand;
|
class PendingCommand;
|
||||||
class PlayerLogic;
|
class PlayerLogic;
|
||||||
|
class QAction;
|
||||||
struct ArrowData;
|
struct ArrowData;
|
||||||
class PlayerActions : public QObject
|
class PlayerActions : public QObject
|
||||||
{
|
{
|
||||||
|
|
@ -52,7 +56,9 @@ public:
|
||||||
RANDOM_CARD_FROM_ZONE = -2
|
RANDOM_CARD_FROM_ZONE = -2
|
||||||
};
|
};
|
||||||
|
|
||||||
explicit PlayerActions(PlayerLogic *player);
|
explicit PlayerActions(PlayerLogic *player,
|
||||||
|
IInterfaceSettingsProvider *interfaceSettings = nullptr,
|
||||||
|
ICardPreferenceProvider *cardPreferences = nullptr);
|
||||||
|
|
||||||
void sendGameCommand(PendingCommand *pend);
|
void sendGameCommand(PendingCommand *pend);
|
||||||
void sendGameCommand(const google::protobuf::Message &command);
|
void sendGameCommand(const google::protobuf::Message &command);
|
||||||
|
|
@ -143,6 +149,12 @@ signals:
|
||||||
void requestSortHand(const QList<CardList::SortOption> &options);
|
void requestSortHand(const QList<CardList::SortOption> &options);
|
||||||
void requestEnableAndSetCreateAnotherTokenAction(const QString &lastTokenName);
|
void requestEnableAndSetCreateAnotherTokenAction(const QString &lastTokenName);
|
||||||
void requestSetLastToken(CardInfoPtr lastToken);
|
void requestSetLastToken(CardInfoPtr lastToken);
|
||||||
|
/**
|
||||||
|
* @brief The player chose a mulligan size to remember as the starting hand size.
|
||||||
|
*
|
||||||
|
* Game logic must not write client settings itself, so persistence is left to the application.
|
||||||
|
*/
|
||||||
|
void startingHandSizeChosen(int number);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void setLastToken(CardInfoPtr cardInfo);
|
void setLastToken(CardInfoPtr cardInfo);
|
||||||
|
|
@ -275,6 +287,10 @@ public slots:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
PlayerLogic *player;
|
PlayerLogic *player;
|
||||||
|
// Borrowed settings providers (owned by the application). Null outside the client, in which case the compiled-in
|
||||||
|
// defaults below apply.
|
||||||
|
IInterfaceSettingsProvider *interfaceSettings;
|
||||||
|
ICardPreferenceProvider *cardPreferences;
|
||||||
|
|
||||||
int defaultNumberTopCards = 1;
|
int defaultNumberTopCards = 1;
|
||||||
int defaultNumberTopCardsToPlaceBelow = 1;
|
int defaultNumberTopCardsToPlaceBelow = 1;
|
||||||
|
|
@ -292,6 +308,11 @@ private:
|
||||||
|
|
||||||
bool lastRelatedCreationSucceeded = false;
|
bool lastRelatedCreationSucceeded = false;
|
||||||
|
|
||||||
|
[[nodiscard]] bool getPlayToStack() const;
|
||||||
|
[[nodiscard]] int getStartingHandSize() const;
|
||||||
|
[[nodiscard]] bool getAnnotateTokens() const;
|
||||||
|
[[nodiscard]] QString getCardPreferenceOverride(const QString &cardName) const;
|
||||||
|
|
||||||
void createCard(const CardState *sourceCard,
|
void createCard(const CardState *sourceCard,
|
||||||
const QString &dbCardName,
|
const QString &dbCardName,
|
||||||
CardRelationType attach = CardRelationType::DoesNotAttach,
|
CardRelationType attach = CardRelationType::DoesNotAttach,
|
||||||
|
|
@ -34,10 +34,17 @@
|
||||||
#include <qalgorithms.h>
|
#include <qalgorithms.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
PlayerLogic::PlayerLogic(const ServerInfo_User &info, int _id, bool _local, bool _judge, AbstractGame *_parent)
|
PlayerLogic::PlayerLogic(const ServerInfo_User &info,
|
||||||
|
int _id,
|
||||||
|
bool _local,
|
||||||
|
bool _judge,
|
||||||
|
AbstractGame *_parent,
|
||||||
|
IInterfaceSettingsProvider *interfaceSettings,
|
||||||
|
ICardPreferenceProvider *cardPreferences)
|
||||||
: QObject(_parent), game(_parent), playerInfo(new PlayerInfo(info, _id, _local, _judge)),
|
: QObject(_parent), game(_parent), playerInfo(new PlayerInfo(info, _id, _local, _judge)),
|
||||||
playerEventHandler(new PlayerEventHandler(this)), playerActions(new PlayerActions(this)), active(false),
|
playerEventHandler(new PlayerEventHandler(this)),
|
||||||
conceded(false), zoneId(0), dialogSemaphore(false)
|
playerActions(new PlayerActions(this, interfaceSettings, cardPreferences)), active(false), conceded(false),
|
||||||
|
zoneId(0), dialogSemaphore(false)
|
||||||
{
|
{
|
||||||
initializeZones();
|
initializeZones();
|
||||||
}
|
}
|
||||||
|
|
@ -37,7 +37,6 @@
|
||||||
// signatures, which the moc-generated code needs to be complete.
|
// signatures, which the moc-generated code needs to be complete.
|
||||||
#include <libcockatrice/protocol/pb/serverinfo_card.pb.h>
|
#include <libcockatrice/protocol/pb/serverinfo_card.pb.h>
|
||||||
|
|
||||||
class CardItem;
|
|
||||||
class CounterState;
|
class CounterState;
|
||||||
class QWidget;
|
class QWidget;
|
||||||
class ServerInfo_PlayerProperties;
|
class ServerInfo_PlayerProperties;
|
||||||
|
|
@ -48,6 +47,8 @@ template <class T> class QSharedPointer;
|
||||||
inline Q_LOGGING_CATEGORY(PlayerLog, "player");
|
inline Q_LOGGING_CATEGORY(PlayerLog, "player");
|
||||||
class AbstractCardItem;
|
class AbstractCardItem;
|
||||||
class AbstractGame;
|
class AbstractGame;
|
||||||
|
class ICardPreferenceProvider;
|
||||||
|
class IInterfaceSettingsProvider;
|
||||||
class PlayerInfo;
|
class PlayerInfo;
|
||||||
class PlayerEventHandler;
|
class PlayerEventHandler;
|
||||||
class PlayerActions;
|
class PlayerActions;
|
||||||
|
|
@ -93,7 +94,13 @@ public slots:
|
||||||
void onRequestZoneViewToggle(const QString &zoneName, int numberCards, bool isReversed);
|
void onRequestZoneViewToggle(const QString &zoneName, int numberCards, bool isReversed);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PlayerLogic(const ServerInfo_User &info, int _id, bool _local, bool _judge, AbstractGame *_parent);
|
PlayerLogic(const ServerInfo_User &info,
|
||||||
|
int _id,
|
||||||
|
bool _local,
|
||||||
|
bool _judge,
|
||||||
|
AbstractGame *_parent,
|
||||||
|
IInterfaceSettingsProvider *interfaceSettings = nullptr,
|
||||||
|
ICardPreferenceProvider *cardPreferences = nullptr);
|
||||||
~PlayerLogic() override;
|
~PlayerLogic() override;
|
||||||
|
|
||||||
void initializeZones();
|
void initializeZones();
|
||||||
|
|
@ -12,9 +12,12 @@
|
||||||
PlayerManager::PlayerManager(AbstractGame *_game,
|
PlayerManager::PlayerManager(AbstractGame *_game,
|
||||||
int _localPlayerId,
|
int _localPlayerId,
|
||||||
bool _localPlayerIsJudge,
|
bool _localPlayerIsJudge,
|
||||||
bool localPlayerIsSpectator)
|
bool localPlayerIsSpectator,
|
||||||
|
IInterfaceSettingsProvider *_interfaceSettings,
|
||||||
|
ICardPreferenceProvider *_cardPreferences)
|
||||||
: QObject(_game), game(_game), players(QMap<int, PlayerLogic *>()), localPlayerId(_localPlayerId),
|
: QObject(_game), game(_game), players(QMap<int, PlayerLogic *>()), localPlayerId(_localPlayerId),
|
||||||
localPlayerIsJudge(_localPlayerIsJudge), localPlayerIsSpectator(localPlayerIsSpectator)
|
localPlayerIsJudge(_localPlayerIsJudge), localPlayerIsSpectator(localPlayerIsSpectator),
|
||||||
|
interfaceSettings(_interfaceSettings), cardPreferences(_cardPreferences)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -52,7 +55,7 @@ bool PlayerManager::isLocalPlayer(int playerId)
|
||||||
PlayerLogic *PlayerManager::addPlayer(int playerId, const ServerInfo_User &info)
|
PlayerLogic *PlayerManager::addPlayer(int playerId, const ServerInfo_User &info)
|
||||||
{
|
{
|
||||||
auto *newPlayer = new PlayerLogic(info, playerId, isLocalPlayer(playerId) || game->getGameState()->getIsLocalGame(),
|
auto *newPlayer = new PlayerLogic(info, playerId, isLocalPlayer(playerId) || game->getGameState()->getIsLocalGame(),
|
||||||
isJudge(), getGame());
|
isJudge(), getGame(), interfaceSettings, cardPreferences);
|
||||||
connect(newPlayer, &PlayerLogic::concededChanged, this, &PlayerManager::onPlayerConceded);
|
connect(newPlayer, &PlayerLogic::concededChanged, this, &PlayerManager::onPlayerConceded);
|
||||||
players.insert(playerId, newPlayer);
|
players.insert(playerId, newPlayer);
|
||||||
emit playerAdded(newPlayer);
|
emit playerAdded(newPlayer);
|
||||||
|
|
@ -16,6 +16,8 @@
|
||||||
#include <qtmetamacros.h>
|
#include <qtmetamacros.h>
|
||||||
|
|
||||||
class AbstractGame;
|
class AbstractGame;
|
||||||
|
class ICardPreferenceProvider;
|
||||||
|
class IInterfaceSettingsProvider;
|
||||||
class PlayerLogic;
|
class PlayerLogic;
|
||||||
|
|
||||||
class PlayerManager : public QObject
|
class PlayerManager : public QObject
|
||||||
|
|
@ -23,7 +25,12 @@ class PlayerManager : public QObject
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PlayerManager(AbstractGame *_game, int _localPlayerId, bool _localPlayerIsJudge, bool localPlayerIsSpectator);
|
PlayerManager(AbstractGame *_game,
|
||||||
|
int _localPlayerId,
|
||||||
|
bool _localPlayerIsJudge,
|
||||||
|
bool localPlayerIsSpectator,
|
||||||
|
IInterfaceSettingsProvider *interfaceSettings = nullptr,
|
||||||
|
ICardPreferenceProvider *cardPreferences = nullptr);
|
||||||
|
|
||||||
AbstractGame *game;
|
AbstractGame *game;
|
||||||
QMap<int, PlayerLogic *> players;
|
QMap<int, PlayerLogic *> players;
|
||||||
|
|
@ -31,6 +38,9 @@ public:
|
||||||
bool localPlayerIsJudge;
|
bool localPlayerIsJudge;
|
||||||
bool localPlayerIsSpectator;
|
bool localPlayerIsSpectator;
|
||||||
QMap<int, ServerInfo_User> spectators;
|
QMap<int, ServerInfo_User> spectators;
|
||||||
|
// Borrowed settings providers forwarded to each PlayerLogic (owned by the application).
|
||||||
|
IInterfaceSettingsProvider *interfaceSettings;
|
||||||
|
ICardPreferenceProvider *cardPreferences;
|
||||||
|
|
||||||
[[nodiscard]] bool isSpectator() const
|
[[nodiscard]] bool isSpectator() const
|
||||||
{
|
{
|
||||||
|
|
@ -9,10 +9,15 @@
|
||||||
class GameReplay;
|
class GameReplay;
|
||||||
class QObject;
|
class QObject;
|
||||||
|
|
||||||
Replay::Replay(QObject *_parent, const GameReplay *_replay, bool isLocalGame) : AbstractGame(_parent)
|
Replay::Replay(QObject *_parent,
|
||||||
|
const GameReplay *_replay,
|
||||||
|
bool isLocalGame,
|
||||||
|
IInterfaceSettingsProvider *interfaceSettings,
|
||||||
|
ICardPreferenceProvider *cardPreferences)
|
||||||
|
: AbstractGame(_parent)
|
||||||
{
|
{
|
||||||
gameState = new GameState(this, 0, -1, isLocalGame, {}, false, false, -1, false);
|
gameState = new GameState(this, 0, -1, isLocalGame, {}, false, false, -1, false);
|
||||||
connect(gameMetaInfo, &GameMetaInfo::startedChanged, gameState, &GameState::onStartedChanged);
|
connect(gameMetaInfo, &GameMetaInfo::startedChanged, gameState, &GameState::onStartedChanged);
|
||||||
playerManager = new PlayerManager(this, -1, false, true);
|
playerManager = new PlayerManager(this, -1, false, true, interfaceSettings, cardPreferences);
|
||||||
loadReplay(_replay);
|
loadReplay(_replay);
|
||||||
}
|
}
|
||||||
32
libcockatrice_game/libcockatrice/game/replay.h
Normal file
32
libcockatrice_game/libcockatrice/game/replay.h
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
/**
|
||||||
|
* @file replay.h
|
||||||
|
* @ingroup GameLogic
|
||||||
|
* @ingroup Replay
|
||||||
|
*/
|
||||||
|
//! \todo Document this file.
|
||||||
|
|
||||||
|
#ifndef COCKATRICE_REPLAY_H
|
||||||
|
#define COCKATRICE_REPLAY_H
|
||||||
|
|
||||||
|
#include "abstract_game.h"
|
||||||
|
|
||||||
|
#include <qtmetamacros.h>
|
||||||
|
|
||||||
|
class GameReplay;
|
||||||
|
class QObject;
|
||||||
|
class ICardPreferenceProvider;
|
||||||
|
class IInterfaceSettingsProvider;
|
||||||
|
|
||||||
|
class Replay : public AbstractGame
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit Replay(QObject *_parent,
|
||||||
|
const GameReplay *_replay,
|
||||||
|
bool isLocalGame,
|
||||||
|
IInterfaceSettingsProvider *interfaceSettings = nullptr,
|
||||||
|
ICardPreferenceProvider *cardPreferences = nullptr);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // COCKATRICE_REPLAY_H
|
||||||
|
|
@ -1,12 +1,11 @@
|
||||||
#include "card_zone_logic.h"
|
#include "card_zone_logic.h"
|
||||||
|
|
||||||
#include "../../client/translation.h"
|
|
||||||
#include "../../game_graphics/zones/card_zone.h"
|
|
||||||
#include "../board/card_list.h"
|
#include "../board/card_list.h"
|
||||||
#include "../board/card_state.h"
|
#include "../board/card_state.h"
|
||||||
#include "../player/player_actions.h"
|
#include "../player/player_actions.h"
|
||||||
#include "../player/player_info.h"
|
#include "../player/player_info.h"
|
||||||
#include "../player/player_logic.h"
|
#include "../player/player_logic.h"
|
||||||
|
#include "../translation.h"
|
||||||
#include "libcockatrice/card/database/card_database.h"
|
#include "libcockatrice/card/database/card_database.h"
|
||||||
#include "view_zone_logic.h"
|
#include "view_zone_logic.h"
|
||||||
|
|
||||||
|
|
@ -7,8 +7,8 @@
|
||||||
#ifndef COCKATRICE_CARD_ZONE_LOGIC_H
|
#ifndef COCKATRICE_CARD_ZONE_LOGIC_H
|
||||||
#define COCKATRICE_CARD_ZONE_LOGIC_H
|
#define COCKATRICE_CARD_ZONE_LOGIC_H
|
||||||
|
|
||||||
#include "../../client/translation.h"
|
|
||||||
#include "../board/card_list.h"
|
#include "../board/card_list.h"
|
||||||
|
#include "../translation.h"
|
||||||
|
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QLoggingCategory>
|
#include <QLoggingCategory>
|
||||||
|
|
@ -21,9 +21,6 @@ inline Q_LOGGING_CATEGORY(CardZoneLogicLog, "card_zone_logic");
|
||||||
|
|
||||||
class PlayerLogic;
|
class PlayerLogic;
|
||||||
class ZoneViewZoneLogic;
|
class ZoneViewZoneLogic;
|
||||||
class QMenu;
|
|
||||||
class QAction;
|
|
||||||
class QPainter;
|
|
||||||
class CardDragItem;
|
class CardDragItem;
|
||||||
|
|
||||||
class CardZoneLogic : public QObject
|
class CardZoneLogic : public QObject
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue