From 1ef07309d6ccc1ba7ada8b93a55440acf381ce4a Mon Sep 17 00:00:00 2001 From: BruebachL <44814898+BruebachL@users.noreply.github.com> Date: Thu, 9 Oct 2025 07:36:12 +0200 Subject: [PATCH] Turn Card, Deck_List, Protocol, RNG, Network (Client, Server), Settings and Utility into libraries and remove cockatrice_common. (#6212) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --------- Co-authored-by: Lukas Brübach Co-authored-by: ebbit1q --- .github/workflows/translations-push.yml | 8 +- CMakeLists.txt | 8 +- cockatrice/CMakeLists.txt | 96 +- cockatrice/cockatrice_en@source.ts | 3597 +++++++++-------- cockatrice/src/client/deck_editor_menu.cpp | 4 +- cockatrice/src/client/get_text_with_max.h | 3 +- .../client/network/client_update_checker.cpp | 3 +- .../client/network/replay_timeline_widget.cpp | 3 +- cockatrice/src/client/network/sets_model.h | 3 +- .../network/spoiler_background_updater.cpp | 6 +- cockatrice/src/client/replay_manager.h | 2 +- cockatrice/src/client/sound_engine.cpp | 3 +- .../src/client/tapped_out_interface.cpp | 5 +- cockatrice/src/client/tapped_out_interface.h | 5 +- cockatrice/src/deck/custom_line_edit.cpp | 5 +- cockatrice/src/deck/deck_list_model.cpp | 4 +- cockatrice/src/deck/deck_list_model.h | 9 +- cockatrice/src/deck/deck_loader.cpp | 8 +- cockatrice/src/deck/deck_loader.h | 3 +- cockatrice/src/deck/deck_stats_interface.cpp | 5 +- cockatrice/src/deck/deck_stats_interface.h | 5 +- cockatrice/src/dialogs/dlg_connect.cpp | 5 +- cockatrice/src/dialogs/dlg_connect.h | 2 +- cockatrice/src/dialogs/dlg_create_game.cpp | 8 +- cockatrice/src/dialogs/dlg_create_game.h | 3 +- .../src/dialogs/dlg_default_tags_editor.cpp | 3 +- cockatrice/src/dialogs/dlg_edit_avatar.cpp | 3 +- cockatrice/src/dialogs/dlg_edit_password.cpp | 5 +- cockatrice/src/dialogs/dlg_edit_tokens.cpp | 10 +- cockatrice/src/dialogs/dlg_edit_tokens.h | 3 +- cockatrice/src/dialogs/dlg_edit_user.cpp | 5 +- .../dialogs/dlg_forgot_password_challenge.cpp | 5 +- .../dialogs/dlg_forgot_password_request.cpp | 5 +- .../src/dialogs/dlg_forgot_password_reset.cpp | 5 +- cockatrice/src/dialogs/dlg_load_deck.cpp | 3 +- .../dialogs/dlg_load_deck_from_clipboard.cpp | 2 +- cockatrice/src/dialogs/dlg_manage_sets.cpp | 8 +- cockatrice/src/dialogs/dlg_register.cpp | 7 +- .../src/dialogs/dlg_select_set_for_cards.cpp | 2 +- cockatrice/src/dialogs/dlg_settings.cpp | 20 +- cockatrice/src/dialogs/dlg_settings.h | 3 +- .../src/dialogs/dlg_startup_card_check.cpp | 3 +- cockatrice/src/dialogs/dlg_tip_of_the_day.cpp | 2 +- cockatrice/src/dialogs/dlg_update.cpp | 2 +- cockatrice/src/dialogs/dlg_view_log.cpp | 5 +- cockatrice/src/filters/deck_filter_string.cpp | 5 +- cockatrice/src/filters/filter_string.cpp | 3 +- cockatrice/src/filters/filter_string.h | 2 +- cockatrice/src/filters/filter_tree.h | 2 +- cockatrice/src/game/abstract_game.h | 2 +- .../game/board/abstract_card_drag_item.cpp | 3 +- .../src/game/board/abstract_card_item.cpp | 12 +- .../src/game/board/abstract_card_item.h | 5 +- .../src/game/board/abstract_counter.cpp | 8 +- cockatrice/src/game/board/arrow_item.cpp | 12 +- cockatrice/src/game/board/card_item.cpp | 8 +- cockatrice/src/game/board/card_item.h | 3 +- cockatrice/src/game/board/card_list.cpp | 2 +- cockatrice/src/game/deckview/deck_view.cpp | 8 +- cockatrice/src/game/deckview/deck_view.h | 2 +- .../src/game/deckview/deck_view_container.cpp | 24 +- .../src/game/dialogs/dlg_create_token.cpp | 12 +- .../game/dialogs/dlg_move_top_cards_until.cpp | 4 +- cockatrice/src/game/dialogs/dlg_roll_dice.cpp | 3 +- cockatrice/src/game/game.cpp | 3 +- cockatrice/src/game/game_event_handler.cpp | 51 +- cockatrice/src/game/game_event_handler.h | 4 +- cockatrice/src/game/game_meta_info.h | 3 +- cockatrice/src/game/game_scene.cpp | 2 +- cockatrice/src/game/game_state.h | 5 +- cockatrice/src/game/game_view.cpp | 2 +- .../src/game/log/message_log_widget.cpp | 8 +- cockatrice/src/game/log/message_log_widget.h | 3 +- cockatrice/src/game/phases_toolbar.cpp | 8 +- cockatrice/src/game/player/menu/card_menu.cpp | 7 +- cockatrice/src/game/player/menu/hand_menu.cpp | 4 +- .../src/game/player/menu/library_menu.cpp | 4 +- .../src/game/player/menu/player_menu.cpp | 5 +- cockatrice/src/game/player/menu/say_menu.cpp | 3 +- cockatrice/src/game/player/player.cpp | 18 +- cockatrice/src/game/player/player.h | 6 +- cockatrice/src/game/player/player_actions.cpp | 39 +- cockatrice/src/game/player/player_actions.h | 3 +- .../src/game/player/player_event_handler.cpp | 45 +- .../src/game/player/player_event_handler.h | 4 +- cockatrice/src/game/player/player_info.h | 2 +- .../src/game/player/player_list_widget.cpp | 8 +- cockatrice/src/game/player/player_manager.h | 3 +- cockatrice/src/game/player/player_target.cpp | 2 +- cockatrice/src/game/zones/hand_zone.cpp | 4 +- .../src/game/zones/logic/card_zone_logic.cpp | 6 +- .../src/game/zones/logic/view_zone_logic.cpp | 3 +- cockatrice/src/game/zones/pile_zone.cpp | 2 +- cockatrice/src/game/zones/select_zone.cpp | 2 +- cockatrice/src/game/zones/stack_zone.cpp | 4 +- cockatrice/src/game/zones/table_zone.cpp | 8 +- cockatrice/src/game/zones/view_zone.cpp | 12 +- cockatrice/src/game/zones/view_zone.h | 2 +- .../src/game/zones/view_zone_widget.cpp | 4 +- cockatrice/src/game/zones/view_zone_widget.h | 2 +- .../card_picture_loader.cpp} | 80 +- .../card_picture_loader.h} | 34 +- .../card_picture_loader_local.cpp} | 39 +- .../card_picture_loader_local.h} | 11 +- ..._loader_request_status_display_widget.cpp} | 10 +- ...re_loader_request_status_display_widget.h} | 14 +- .../card_picture_loader_status_bar.cpp} | 24 +- .../card_picture_loader_status_bar.h} | 10 +- .../card_picture_loader_worker.cpp} | 56 +- .../card_picture_loader_worker.h} | 32 +- .../card_picture_loader_worker_work.cpp} | 59 +- .../card_picture_loader_worker_work.h} | 18 +- .../card_picture_to_load.cpp} | 29 +- .../card_picture_to_load.h} | 11 +- .../src/interface/pixel_map_generator.cpp | 3 +- .../src/interface/pixel_map_generator.h | 3 +- cockatrice/src/interface/tearoff_menu.h | 3 +- cockatrice/src/interface/theme_manager.cpp | 3 +- .../deck_list_sort_filter_proxy_model.cpp | 2 +- .../deck_list_sort_filter_proxy_model.h | 3 +- .../{ => interface}/utility/sequence_edit.cpp | 3 +- .../{ => interface}/utility/sequence_edit.h | 0 .../additional_info/color_identity_widget.cpp | 2 +- .../additional_info/color_identity_widget.h | 3 +- .../cards/additional_info/mana_cost_widget.h | 3 +- .../additional_info/mana_symbol_widget.cpp | 3 +- .../card_group_display_widget.cpp | 6 +- .../card_group_display_widget.h | 2 +- .../flat_card_group_display_widget.cpp | 4 +- .../overlapped_card_group_display_widget.cpp | 4 +- .../cards/card_info_display_widget.cpp | 2 +- .../widgets/cards/card_info_display_widget.h | 5 +- .../widgets/cards/card_info_frame_widget.cpp | 6 +- .../widgets/cards/card_info_frame_widget.h | 5 +- .../card_info_picture_art_crop_widget.cpp | 6 +- .../card_info_picture_enlarged_widget.cpp | 8 +- .../cards/card_info_picture_enlarged_widget.h | 3 +- .../cards/card_info_picture_widget.cpp | 14 +- .../widgets/cards/card_info_picture_widget.h | 2 +- .../widgets/cards/card_info_text_widget.cpp | 4 +- .../widgets/cards/card_info_text_widget.h | 3 +- .../widgets/cards/card_size_widget.cpp | 3 +- .../cards/deck_card_zone_display_widget.cpp | 2 +- .../cards/deck_card_zone_display_widget.h | 2 +- .../deck_preview_card_picture_widget.cpp | 3 +- .../deck_analytics/deck_analytics_widget.h | 2 +- .../deck_analytics/mana_base_widget.cpp | 6 +- .../widgets/deck_analytics/mana_base_widget.h | 2 +- .../deck_analytics/mana_curve_widget.cpp | 6 +- .../deck_analytics/mana_devotion_widget.cpp | 6 +- .../deck_analytics/mana_devotion_widget.h | 2 +- .../deck_editor_database_display_widget.cpp | 6 +- .../deck_editor_database_display_widget.h | 6 +- .../deck_editor_deck_dock_widget.cpp | 7 +- .../deck_editor_deck_dock_widget.h | 4 +- .../deck_editor_filter_dock_widget.cpp | 4 +- .../deck_editor_filter_dock_widget.h | 2 +- .../interface/widgets/general/home_widget.cpp | 6 +- .../interface/widgets/general/home_widget.h | 2 +- .../printing_selector/card_amount_widget.h | 2 +- .../printing_selector/printing_selector.cpp | 4 +- .../printing_selector/printing_selector.h | 2 +- .../printing_selector_card_display_widget.h | 2 +- .../printing_selector_card_overlay_widget.cpp | 6 +- .../printing_selector_card_overlay_widget.h | 3 +- .../printing_selector_card_sorting_widget.cpp | 4 +- ...tabase_display_filter_save_load_widget.cpp | 2 +- ...tabase_display_main_type_filter_widget.cpp | 2 +- ...ual_database_display_set_filter_widget.cpp | 4 +- ...atabase_display_sub_type_filter_widget.cpp | 2 +- .../visual_database_display_widget.cpp | 8 +- .../visual_database_display_widget.h | 6 +- .../visual_database_filter_display_widget.cpp | 3 +- .../visual_deck_editor_sample_hand_widget.cpp | 4 +- .../visual_deck_editor_widget.cpp | 12 +- .../visual_deck_editor_widget.h | 8 +- .../deck_preview_deck_tags_display_widget.cpp | 2 +- .../deck_preview_tag_addition_widget.cpp | 2 +- .../deck_preview/deck_preview_tag_dialog.cpp | 2 +- .../deck_preview/deck_preview_widget.cpp | 4 +- ...ual_deck_storage_folder_display_widget.cpp | 2 +- ...ual_deck_storage_quick_settings_widget.cpp | 2 +- .../visual_deck_storage_search_widget.cpp | 2 +- .../visual_deck_storage_sort_widget.cpp | 2 +- .../visual_deck_storage_widget.cpp | 4 +- cockatrice/src/interface/window_main.cpp | 24 +- cockatrice/src/interface/window_main.h | 5 +- cockatrice/src/main.cpp | 8 +- cockatrice/src/main.h | 3 +- cockatrice/src/server/chat_view/chat_view.cpp | 4 +- cockatrice/src/server/chat_view/chat_view.h | 4 +- cockatrice/src/server/game_selector.cpp | 10 +- cockatrice/src/server/game_selector.h | 6 +- cockatrice/src/server/games_model.cpp | 4 +- cockatrice/src/server/games_model.h | 2 +- .../src/server/handle_public_servers.cpp | 3 +- .../remote/remote_decklist_tree_widget.cpp | 11 +- .../remote/remote_replay_list_tree_widget.cpp | 11 +- .../remote/remote_replay_list_tree_widget.h | 5 +- .../src/server/user/user_context_menu.cpp | 24 +- .../src/server/user/user_context_menu.h | 3 +- cockatrice/src/server/user/user_info_box.cpp | 12 +- .../src/server/user/user_info_connection.cpp | 3 +- .../src/server/user/user_list_manager.cpp | 17 +- .../src/server/user/user_list_manager.h | 2 +- .../src/server/user/user_list_widget.cpp | 14 +- cockatrice/src/server/user/user_list_widget.h | 5 +- .../src/tabs/abstract_tab_deck_editor.cpp | 20 +- .../src/tabs/abstract_tab_deck_editor.h | 2 +- ...i_response_card_details_display_widget.cpp | 3 +- ...ponse_commander_details_display_widget.cpp | 3 +- cockatrice/src/tabs/api/edhrec/tab_edhrec.h | 2 +- .../src/tabs/api/edhrec/tab_edhrec_main.cpp | 6 +- .../src/tabs/api/edhrec/tab_edhrec_main.h | 2 +- cockatrice/src/tabs/tab.h | 3 +- cockatrice/src/tabs/tab_account.cpp | 18 +- cockatrice/src/tabs/tab_account.h | 3 +- cockatrice/src/tabs/tab_admin.cpp | 13 +- cockatrice/src/tabs/tab_admin.h | 4 +- cockatrice/src/tabs/tab_deck_editor.cpp | 12 +- cockatrice/src/tabs/tab_deck_editor.h | 5 +- cockatrice/src/tabs/tab_deck_storage.cpp | 22 +- cockatrice/src/tabs/tab_deck_storage.h | 3 +- cockatrice/src/tabs/tab_game.cpp | 22 +- cockatrice/src/tabs/tab_game.h | 2 +- cockatrice/src/tabs/tab_home.h | 2 +- cockatrice/src/tabs/tab_logs.cpp | 10 +- cockatrice/src/tabs/tab_message.cpp | 14 +- cockatrice/src/tabs/tab_replays.cpp | 26 +- cockatrice/src/tabs/tab_replays.h | 3 +- cockatrice/src/tabs/tab_room.cpp | 24 +- cockatrice/src/tabs/tab_server.cpp | 12 +- cockatrice/src/tabs/tab_supervisor.cpp | 22 +- .../tab_deck_editor_visual.cpp | 10 +- .../tab_deck_storage_visual.cpp | 4 +- common/CMakeLists.txt | 50 - dbconverter/CMakeLists.txt | 99 +- dbconverter/src/main.h | 4 +- dbconverter/src/mocks.cpp | 2 +- dbconverter/src/mocks.h | 8 +- format.sh | 22 +- libcockatrice_card/CMakeLists.txt | 68 + .../card/card_database}/card_database.cpp | 5 +- .../card/card_database}/card_database.h | 5 +- .../card_database}/card_database_loader.cpp | 2 +- .../card_database}/card_database_loader.h | 0 .../card_database}/card_database_manager.cpp | 0 .../card_database}/card_database_manager.h | 0 .../card_database}/card_database_querier.cpp | 4 +- .../card_database}/card_database_querier.h | 5 +- .../model/card/card_completer_proxy_model.cpp | 0 .../model/card/card_completer_proxy_model.h | 0 .../model/card/card_search_model.cpp | 3 +- .../model/card/card_search_model.h | 0 .../model/card_database_display_model.cpp | 0 .../model/card_database_display_model.h | 2 +- .../model/card_database_model.cpp | 2 + .../model/card_database_model.h | 0 .../model/token/token_display_model.cpp | 0 .../model/token/token_display_model.h | 0 .../model/token/token_edit_model.cpp | 4 +- .../model/token/token_edit_model.h | 0 .../parser/card_database_parser.cpp | 0 .../parser/card_database_parser.h | 2 +- .../parser/cockatrice_xml_3.cpp | 4 +- .../card_database}/parser/cockatrice_xml_3.h | 1 - .../parser/cockatrice_xml_4.cpp | 4 +- .../card_database}/parser/cockatrice_xml_4.h | 1 - .../libcockatrice}/card/card_info.cpp | 8 +- .../libcockatrice}/card/card_info.h | 2 +- .../card}/card_info_comparator.cpp | 0 .../card}/card_info_comparator.h | 2 +- .../card/card_printing}/exact_card.cpp | 3 + .../card/card_printing}/exact_card.h | 2 +- .../card/card_printing}/printing_info.cpp | 2 + .../card/card_printing}/printing_info.h | 2 +- .../card/card_relation}/card_relation.cpp | 2 + .../card/card_relation}/card_relation.h | 0 .../card/card_relation}/card_relation_type.h | 0 .../libcockatrice/card/card_set}/card_set.cpp | 2 +- .../libcockatrice/card/card_set}/card_set.h | 0 .../card/card_set}/card_set_comparator.h | 2 +- .../card/card_set}/card_set_list.cpp | 0 .../card/card_set}/card_set_list.h | 0 .../libcockatrice}/card/game_specific_terms.h | 0 libcockatrice_deck_list/CMakeLists.txt | 30 + .../abstract_deck_list_card_node.cpp | 0 .../deck_list}/abstract_deck_list_card_node.h | 0 .../deck_list}/abstract_deck_list_node.cpp | 0 .../deck_list}/abstract_deck_list_node.h | 0 .../libcockatrice/deck_list}/deck_list.cpp | 0 .../libcockatrice/deck_list}/deck_list.h | 4 +- .../deck_list}/deck_list_card_node.cpp | 0 .../deck_list}/deck_list_card_node.h | 3 +- .../deck_list}/inner_deck_list_node.cpp | 0 .../deck_list}/inner_deck_list_node.h | 0 libcockatrice_network/CMakeLists.txt | 14 + .../network/client/CMakeLists.txt | 16 + .../network/client/abstract/CMakeLists.txt | 24 + .../client/abstract}/abstract_client.cpp | 37 +- .../client/abstract}/abstract_client.h | 5 +- .../network/client/local/CMakeLists.txt | 23 + .../network/client/local}/local_client.cpp | 7 +- .../network/client/local}/local_client.h | 2 +- .../network/client/remote/CMakeLists.txt | 24 + .../network/client}/remote/remote_client.cpp | 26 +- .../network/client}/remote/remote_client.h | 4 +- .../network/server/CMakeLists.txt | 15 + .../network/server/local/CMakeLists.txt | 21 + .../network/server/local}/local_server.cpp | 3 +- .../network/server/local}/local_server.h | 4 +- .../server/local}/local_server_interface.cpp | 0 .../server/local}/local_server_interface.h | 2 +- .../network/server/remote/CMakeLists.txt | 63 + .../game/server_abstract_participant.cpp | 144 +- .../game/server_abstract_participant.h | 6 +- .../remote}/game/server_abstract_player.cpp | 81 +- .../remote}/game/server_abstract_player.h | 2 +- .../server/remote}/game/server_arrow.cpp | 3 +- .../server/remote}/game/server_arrow.h | 2 +- .../remote}/game/server_arrowtarget.cpp | 0 .../server/remote}/game/server_arrowtarget.h | 0 .../server/remote}/game/server_card.cpp | 6 +- .../network/server/remote}/game/server_card.h | 6 +- .../server/remote}/game/server_cardzone.cpp | 4 +- .../server/remote}/game/server_cardzone.h | 3 +- .../server/remote}/game/server_counter.cpp | 2 +- .../server/remote}/game/server_counter.h | 3 +- .../server/remote}/game/server_game.cpp | 36 +- .../network/server/remote}/game/server_game.h | 6 +- .../remote}/game/server_move_card_struct.h | 0 .../server/remote}/game/server_player.cpp | 110 +- .../server/remote}/game/server_player.h | 0 .../server/remote}/game/server_spectator.cpp | 0 .../server/remote}/game/server_spectator.h | 0 .../server/remote}/room_message_type.h | 3 +- .../network/server/remote}/server.cpp | 16 +- .../network/server/remote}/server.h | 10 +- .../remote}/server_abstractuserinterface.cpp | 4 +- .../remote}/server_abstractuserinterface.h | 6 +- .../remote}/server_database_interface.cpp | 0 .../remote}/server_database_interface.h | 0 .../server/remote}/server_player_reference.h | 0 .../server/remote}/server_protocolhandler.cpp | 36 +- .../server/remote}/server_protocolhandler.h | 4 +- .../remote}/server_remoteuserinterface.cpp | 3 +- .../remote}/server_remoteuserinterface.h | 0 .../remote}/server_response_containers.cpp | 0 .../remote}/server_response_containers.h | 3 +- .../network/server/remote}/server_room.cpp | 20 +- .../network/server/remote}/server_room.h | 6 +- .../remote}/serverinfo_user_container.cpp | 2 +- .../remote}/serverinfo_user_container.h | 0 .../network/server/remote}/user_level.h | 3 +- libcockatrice_protocol/CMakeLists.txt | 28 + .../protocol}/debug_pb_message.cpp | 3 +- .../protocol}/debug_pb_message.h | 0 .../libcockatrice/protocol}/featureset.cpp | 0 .../libcockatrice/protocol}/featureset.h | 3 +- .../protocol}/get_pb_extension.cpp | 0 .../protocol}/get_pb_extension.h | 0 .../libcockatrice/protocol}/pb/CMakeLists.txt | 18 +- .../protocol}/pb/admin_commands.proto | 0 .../protocol}/pb/card_attributes.proto | 0 .../libcockatrice/protocol}/pb/color.proto | 0 .../protocol}/pb/command_attach_card.proto | 0 .../pb/command_change_zone_properties.proto | 0 .../protocol}/pb/command_concede.proto | 0 .../protocol}/pb/command_create_arrow.proto | 0 .../protocol}/pb/command_create_counter.proto | 0 .../protocol}/pb/command_create_token.proto | 0 .../protocol}/pb/command_deck_del.proto | 0 .../protocol}/pb/command_deck_del_dir.proto | 0 .../protocol}/pb/command_deck_download.proto | 0 .../protocol}/pb/command_deck_list.proto | 0 .../protocol}/pb/command_deck_new_dir.proto | 0 .../protocol}/pb/command_deck_select.proto | 0 .../protocol}/pb/command_deck_upload.proto | 0 .../protocol}/pb/command_del_counter.proto | 0 .../protocol}/pb/command_delete_arrow.proto | 0 .../protocol}/pb/command_draw_cards.proto | 0 .../protocol}/pb/command_dump_zone.proto | 0 .../protocol}/pb/command_flip_card.proto | 0 .../protocol}/pb/command_game_say.proto | 0 .../pb/command_inc_card_counter.proto | 0 .../protocol}/pb/command_inc_counter.proto | 0 .../protocol}/pb/command_kick_from_game.proto | 0 .../protocol}/pb/command_leave_game.proto | 0 .../protocol}/pb/command_move_card.proto | 0 .../protocol}/pb/command_mulligan.proto | 0 .../protocol}/pb/command_next_turn.proto | 0 .../protocol}/pb/command_ready_start.proto | 0 .../pb/command_replay_delete_match.proto | 0 .../pb/command_replay_download.proto | 0 .../pb/command_replay_get_code.proto | 0 .../protocol}/pb/command_replay_list.proto | 0 .../pb/command_replay_modify_match.proto | 0 .../pb/command_replay_submit_code.proto | 0 .../protocol}/pb/command_reveal_cards.proto | 0 .../protocol}/pb/command_reverse_turn.proto | 0 .../protocol}/pb/command_roll_die.proto | 0 .../pb/command_set_active_phase.proto | 0 .../protocol}/pb/command_set_card_attr.proto | 0 .../pb/command_set_card_counter.proto | 0 .../protocol}/pb/command_set_counter.proto | 0 .../pb/command_set_sideboard_lock.proto | 0 .../pb/command_set_sideboard_plan.proto | 0 .../protocol}/pb/command_shuffle.proto | 0 .../protocol}/pb/command_undo_draw.proto | 0 .../libcockatrice/protocol}/pb/commands.proto | 0 .../protocol}/pb/context_concede.proto | 0 .../pb/context_connection_state_changed.proto | 0 .../protocol}/pb/context_deck_select.proto | 0 .../protocol}/pb/context_move_card.proto | 0 .../protocol}/pb/context_mulligan.proto | 0 .../protocol}/pb/context_ping_changed.proto | 0 .../protocol}/pb/context_ready_start.proto | 0 .../pb/context_set_sideboard_lock.proto | 0 .../protocol}/pb/context_undo_draw.proto | 0 .../protocol}/pb/event_add_to_list.proto | 0 .../protocol}/pb/event_attach_card.proto | 0 .../pb/event_change_zone_properties.proto | 0 .../pb/event_connection_closed.proto | 0 .../protocol}/pb/event_create_arrow.proto | 0 .../protocol}/pb/event_create_counter.proto | 0 .../protocol}/pb/event_create_token.proto | 0 .../protocol}/pb/event_del_counter.proto | 0 .../protocol}/pb/event_delete_arrow.proto | 0 .../protocol}/pb/event_destroy_card.proto | 0 .../protocol}/pb/event_draw_cards.proto | 0 .../protocol}/pb/event_dump_zone.proto | 0 .../protocol}/pb/event_flip_card.proto | 0 .../protocol}/pb/event_game_closed.proto | 0 .../pb/event_game_host_changed.proto | 0 .../protocol}/pb/event_game_joined.proto | 0 .../protocol}/pb/event_game_say.proto | 0 .../pb/event_game_state_changed.proto | 0 .../protocol}/pb/event_join.proto | 0 .../protocol}/pb/event_join_room.proto | 0 .../protocol}/pb/event_kicked.proto | 0 .../protocol}/pb/event_leave.proto | 0 .../protocol}/pb/event_leave_room.proto | 0 .../protocol}/pb/event_list_games.proto | 0 .../protocol}/pb/event_list_rooms.proto | 0 .../protocol}/pb/event_move_card.proto | 0 .../protocol}/pb/event_notify_user.proto | 0 .../pb/event_player_properties_changed.proto | 0 .../protocol}/pb/event_remove_from_list.proto | 0 .../protocol}/pb/event_remove_messages.proto | 0 .../protocol}/pb/event_replay_added.proto | 0 .../protocol}/pb/event_reveal_cards.proto | 0 .../protocol}/pb/event_reverse_turn.proto | 0 .../protocol}/pb/event_roll_die.proto | 0 .../protocol}/pb/event_room_say.proto | 0 .../pb/event_server_complete_list.proto | 0 .../pb/event_server_identification.proto | 0 .../protocol}/pb/event_server_message.proto | 0 .../protocol}/pb/event_server_shutdown.proto | 0 .../protocol}/pb/event_set_active_phase.proto | 0 .../pb/event_set_active_player.proto | 0 .../protocol}/pb/event_set_card_attr.proto | 0 .../protocol}/pb/event_set_card_counter.proto | 0 .../protocol}/pb/event_set_counter.proto | 0 .../protocol}/pb/event_shuffle.proto | 0 .../protocol}/pb/event_user_joined.proto | 0 .../protocol}/pb/event_user_left.proto | 0 .../protocol}/pb/event_user_message.proto | 0 .../protocol}/pb/game_commands.proto | 0 .../protocol}/pb/game_event.proto | 0 .../protocol}/pb/game_event_container.proto | 0 .../protocol}/pb/game_event_context.proto | 0 .../protocol}/pb/game_replay.proto | 0 .../protocol}/pb/isl_message.proto | 0 .../protocol}/pb/moderator_commands.proto | 0 .../protocol}/pb/move_card_to_zone.proto | 0 .../libcockatrice/protocol}/pb/response.proto | 0 .../protocol}/pb/response_activate.proto | 0 .../protocol}/pb/response_adjust_mod.proto | 0 .../protocol}/pb/response_ban_history.proto | 0 .../protocol}/pb/response_deck_download.proto | 0 .../protocol}/pb/response_deck_list.proto | 0 .../protocol}/pb/response_deck_upload.proto | 0 .../protocol}/pb/response_dump_zone.proto | 0 .../pb/response_forgotpasswordrequest.proto | 0 .../pb/response_get_admin_notes.proto | 0 .../pb/response_get_games_of_user.proto | 0 .../protocol}/pb/response_get_user_info.proto | 0 .../protocol}/pb/response_join_room.proto | 0 .../protocol}/pb/response_list_users.proto | 0 .../protocol}/pb/response_login.proto | 0 .../protocol}/pb/response_password_salt.proto | 0 .../protocol}/pb/response_register.proto | 0 .../pb/response_replay_download.proto | 0 .../pb/response_replay_get_code.proto | 0 .../protocol}/pb/response_replay_list.proto | 0 .../pb/response_viewlog_history.proto | 0 .../protocol}/pb/response_warn_history.proto | 0 .../protocol}/pb/response_warn_list.proto | 0 .../protocol}/pb/room_commands.proto | 0 .../protocol}/pb/room_event.proto | 0 .../protocol}/pb/server_message.proto | 0 .../protocol}/pb/serverinfo_arrow.proto | 0 .../protocol}/pb/serverinfo_ban.proto | 0 .../protocol}/pb/serverinfo_card.proto | 0 .../protocol}/pb/serverinfo_cardcounter.proto | 0 .../pb/serverinfo_chat_message.proto | 0 .../protocol}/pb/serverinfo_counter.proto | 0 .../protocol}/pb/serverinfo_deckstorage.proto | 0 .../protocol}/pb/serverinfo_game.proto | 0 .../protocol}/pb/serverinfo_gametype.proto | 0 .../protocol}/pb/serverinfo_player.proto | 0 .../protocol}/pb/serverinfo_playerping.proto | 0 .../pb/serverinfo_playerproperties.proto | 0 .../protocol}/pb/serverinfo_replay.proto | 0 .../pb/serverinfo_replay_match.proto | 0 .../protocol}/pb/serverinfo_room.proto | 0 .../protocol}/pb/serverinfo_user.proto | 0 .../protocol}/pb/serverinfo_warning.proto | 0 .../protocol}/pb/serverinfo_zone.proto | 0 .../protocol}/pb/session_commands.proto | 0 .../protocol}/pb/session_event.proto | 0 .../protocol}/pending_command.cpp | 0 .../libcockatrice/protocol}/pending_command.h | 5 +- libcockatrice_rng/CMakeLists.txt | 20 + .../libcockatrice/rng}/rng_abstract.cpp | 0 .../libcockatrice/rng}/rng_abstract.h | 0 .../libcockatrice/rng}/rng_sfmt.cpp | 0 .../libcockatrice/rng}/rng_sfmt.h | 0 .../libcockatrice/rng}/sfmt/LICENSE.txt | 0 .../libcockatrice/rng}/sfmt/SFMT-common.h | 0 .../libcockatrice/rng}/sfmt/SFMT-params.h | 0 .../rng}/sfmt/SFMT-params19937.h | 0 .../libcockatrice/rng}/sfmt/SFMT.c | 0 .../libcockatrice/rng}/sfmt/SFMT.h | 0 libcockatrice_settings/CMakeLists.txt | 53 + .../settings/cache_settings.cpp | 2 +- .../libcockatrice}/settings/cache_settings.h | 2 +- .../settings/card_counter_settings.cpp | 0 .../settings/card_counter_settings.h | 0 .../settings/card_database_settings.cpp | 0 .../settings/card_database_settings.h | 0 .../settings/card_override_settings.cpp | 0 .../settings/card_override_settings.h | 2 +- .../settings/debug_settings.cpp | 0 .../libcockatrice}/settings/debug_settings.h | 0 .../settings/download_settings.cpp | 0 .../settings/download_settings.h | 0 .../settings/game_filters_settings.cpp | 0 .../settings/game_filters_settings.h | 0 .../settings/layouts_settings.cpp | 0 .../settings/layouts_settings.h | 0 .../settings/message_settings.cpp | 0 .../settings/message_settings.h | 0 .../settings/recents_settings.cpp | 0 .../settings/recents_settings.h | 0 .../settings/servers_settings.cpp | 0 .../settings/servers_settings.h | 0 .../settings/settings_manager.cpp | 0 .../settings/settings_manager.h | 0 .../settings/shortcut_treeview.cpp | 0 .../settings/shortcut_treeview.h | 0 .../settings/shortcuts_settings.cpp | 0 .../settings/shortcuts_settings.h | 0 libcockatrice_utility/CMakeLists.txt | 32 + .../libcockatrice/utility}/card_ref.h | 0 .../libcockatrice/utility}/color.h | 2 +- .../libcockatrice/utility}/expression.cpp | 2 +- .../libcockatrice/utility}/expression.h | 0 .../libcockatrice}/utility/key_signals.cpp | 0 .../libcockatrice}/utility/key_signals.h | 0 .../libcockatrice}/utility/levenshtein.cpp | 0 .../libcockatrice}/utility/levenshtein.h | 0 .../libcockatrice}/utility/logger.cpp | 0 .../libcockatrice}/utility/logger.h | 0 .../libcockatrice}/utility/macros.h | 0 .../libcockatrice/utility}/passwordhasher.cpp | 3 +- .../libcockatrice/utility}/passwordhasher.h | 0 .../libcockatrice/utility}/peglib.h | 0 .../libcockatrice/utility}/trice_limits.h | 0 oracle/CMakeLists.txt | 85 +- oracle/src/main.cpp | 2 +- oracle/src/oracleimporter.cpp | 4 +- oracle/src/oracleimporter.h | 2 +- oracle/src/oraclewizard.cpp | 2 +- servatrice/CMakeLists.txt | 15 +- servatrice/src/isl_interface.cpp | 30 +- servatrice/src/isl_interface.h | 6 +- servatrice/src/main.cpp | 4 +- servatrice/src/servatrice.cpp | 12 +- servatrice/src/servatrice.h | 3 +- .../src/servatrice_database_interface.cpp | 6 +- .../src/servatrice_database_interface.h | 5 +- servatrice/src/serversocketinterface.cpp | 90 +- servatrice/src/serversocketinterface.h | 3 +- tests/CMakeLists.txt | 6 +- tests/carddatabase/CMakeLists.txt | 87 +- tests/carddatabase/filter_string_test.cpp | 2 +- tests/carddatabase/mocks.cpp | 2 +- tests/carddatabase/mocks.h | 8 +- tests/expression_test.cpp | 3 +- tests/loading_from_clipboard/CMakeLists.txt | 6 +- .../clipboard_testing.cpp | 3 +- .../clipboard_testing.h | 3 +- tests/oracle/CMakeLists.txt | 2 +- tests/password_hash_test.cpp | 7 +- 605 files changed, 3812 insertions(+), 3408 deletions(-) rename cockatrice/src/{picture_loader/picture_loader.cpp => interface/card_picture_loader/card_picture_loader.cpp} (65%) rename cockatrice/src/{picture_loader/picture_loader.h => interface/card_picture_loader/card_picture_loader.h} (53%) rename cockatrice/src/{picture_loader/picture_loader_local.cpp => interface/card_picture_loader/card_picture_loader_local.cpp} (77%) rename cockatrice/src/{picture_loader/picture_loader_local.h => interface/card_picture_loader/card_picture_loader_local.h} (78%) rename cockatrice/src/{picture_loader/picture_loader_request_status_display_widget.cpp => interface/card_picture_loader/card_picture_loader_request_status_display_widget.cpp} (74%) rename cockatrice/src/{picture_loader/picture_loader_request_status_display_widget.h => interface/card_picture_loader/card_picture_loader_request_status_display_widget.h} (75%) rename cockatrice/src/{picture_loader/picture_loader_status_bar.cpp => interface/card_picture_loader/card_picture_loader_status_bar.cpp} (54%) rename cockatrice/src/{picture_loader/picture_loader_status_bar.h => interface/card_picture_loader/card_picture_loader_status_bar.h} (68%) rename cockatrice/src/{picture_loader/picture_loader_worker.cpp => interface/card_picture_loader/card_picture_loader_worker.cpp} (78%) rename cockatrice/src/{picture_loader/picture_loader_worker.h => interface/card_picture_loader/card_picture_loader_worker.h} (67%) rename cockatrice/src/{picture_loader/picture_loader_worker_work.cpp => interface/card_picture_loader/card_picture_loader_worker_work.cpp} (75%) rename cockatrice/src/{picture_loader/picture_loader_worker_work.h => interface/card_picture_loader/card_picture_loader_worker_work.h} (74%) rename cockatrice/src/{picture_loader/picture_to_load.cpp => interface/card_picture_loader/card_picture_to_load.cpp} (93%) rename cockatrice/src/{picture_loader/picture_to_load.h => interface/card_picture_loader/card_picture_to_load.h} (76%) rename cockatrice/src/{ => interface}/utility/deck_list_sort_filter_proxy_model.cpp (98%) rename cockatrice/src/{ => interface}/utility/deck_list_sort_filter_proxy_model.h (92%) rename cockatrice/src/{ => interface}/utility/sequence_edit.cpp (99%) rename cockatrice/src/{ => interface}/utility/sequence_edit.h (100%) delete mode 100644 common/CMakeLists.txt create mode 100644 libcockatrice_card/CMakeLists.txt rename {cockatrice/src/database => libcockatrice_card/libcockatrice/card/card_database}/card_database.cpp (97%) rename {cockatrice/src/database => libcockatrice_card/libcockatrice/card/card_database}/card_database.h (95%) rename {cockatrice/src/database => libcockatrice_card/libcockatrice/card/card_database}/card_database_loader.cpp (98%) rename {cockatrice/src/database => libcockatrice_card/libcockatrice/card/card_database}/card_database_loader.h (100%) rename {cockatrice/src/database => libcockatrice_card/libcockatrice/card/card_database}/card_database_manager.cpp (100%) rename {cockatrice/src/database => libcockatrice_card/libcockatrice/card/card_database}/card_database_manager.h (100%) rename {cockatrice/src/database => libcockatrice_card/libcockatrice/card/card_database}/card_database_querier.cpp (98%) rename {cockatrice/src/database => libcockatrice_card/libcockatrice/card/card_database}/card_database_querier.h (95%) rename {cockatrice/src/database => libcockatrice_card/libcockatrice/card/card_database}/model/card/card_completer_proxy_model.cpp (100%) rename {cockatrice/src/database => libcockatrice_card/libcockatrice/card/card_database}/model/card/card_completer_proxy_model.h (100%) rename {cockatrice/src/database => libcockatrice_card/libcockatrice/card/card_database}/model/card/card_search_model.cpp (95%) rename {cockatrice/src/database => libcockatrice_card/libcockatrice/card/card_database}/model/card/card_search_model.h (100%) rename {cockatrice/src/database => libcockatrice_card/libcockatrice/card/card_database}/model/card_database_display_model.cpp (100%) rename {cockatrice/src/database => libcockatrice_card/libcockatrice/card/card_database}/model/card_database_display_model.h (98%) rename {cockatrice/src/database => libcockatrice_card/libcockatrice/card/card_database}/model/card_database_model.cpp (99%) rename {cockatrice/src/database => libcockatrice_card/libcockatrice/card/card_database}/model/card_database_model.h (100%) rename {cockatrice/src/database => libcockatrice_card/libcockatrice/card/card_database}/model/token/token_display_model.cpp (100%) rename {cockatrice/src/database => libcockatrice_card/libcockatrice/card/card_database}/model/token/token_display_model.h (100%) rename {cockatrice/src/database => libcockatrice_card/libcockatrice/card/card_database}/model/token/token_edit_model.cpp (83%) rename {cockatrice/src/database => libcockatrice_card/libcockatrice/card/card_database}/model/token/token_edit_model.h (100%) rename {cockatrice/src/database => libcockatrice_card/libcockatrice/card/card_database}/parser/card_database_parser.cpp (100%) rename {cockatrice/src/database => libcockatrice_card/libcockatrice/card/card_database}/parser/card_database_parser.h (97%) rename {cockatrice/src/database => libcockatrice_card/libcockatrice/card/card_database}/parser/cockatrice_xml_3.cpp (99%) rename {cockatrice/src/database => libcockatrice_card/libcockatrice/card/card_database}/parser/cockatrice_xml_3.h (96%) rename {cockatrice/src/database => libcockatrice_card/libcockatrice/card/card_database}/parser/cockatrice_xml_4.cpp (99%) rename {cockatrice/src/database => libcockatrice_card/libcockatrice/card/card_database}/parser/cockatrice_xml_4.h (96%) rename {cockatrice/src => libcockatrice_card/libcockatrice}/card/card_info.cpp (97%) rename {cockatrice/src => libcockatrice_card/libcockatrice}/card/card_info.h (99%) rename {cockatrice/src/utility => libcockatrice_card/libcockatrice/card}/card_info_comparator.cpp (100%) rename {cockatrice/src/utility => libcockatrice_card/libcockatrice/card}/card_info_comparator.h (95%) rename {cockatrice/src/card => libcockatrice_card/libcockatrice/card/card_printing}/exact_card.cpp (96%) rename {cockatrice/src/card => libcockatrice_card/libcockatrice/card/card_printing}/exact_card.h (97%) rename {cockatrice/src/card => libcockatrice_card/libcockatrice/card/card_printing}/printing_info.cpp (88%) rename {cockatrice/src/card => libcockatrice_card/libcockatrice/card/card_printing}/printing_info.h (97%) rename {cockatrice/src/card => libcockatrice_card/libcockatrice/card/card_relation}/card_relation.cpp (93%) rename {cockatrice/src/card => libcockatrice_card/libcockatrice/card/card_relation}/card_relation.h (100%) rename {cockatrice/src/card => libcockatrice_card/libcockatrice/card/card_relation}/card_relation_type.h (100%) rename {cockatrice/src/card => libcockatrice_card/libcockatrice/card/card_set}/card_set.cpp (97%) rename {cockatrice/src/card => libcockatrice_card/libcockatrice/card/card_set}/card_set.h (100%) rename {cockatrice/src/utility => libcockatrice_card/libcockatrice/card/card_set}/card_set_comparator.h (96%) rename {cockatrice/src/card => libcockatrice_card/libcockatrice/card/card_set}/card_set_list.cpp (100%) rename {cockatrice/src/card => libcockatrice_card/libcockatrice/card/card_set}/card_set_list.h (100%) rename {cockatrice/src => libcockatrice_card/libcockatrice}/card/game_specific_terms.h (100%) create mode 100644 libcockatrice_deck_list/CMakeLists.txt rename {common => libcockatrice_deck_list/libcockatrice/deck_list}/abstract_deck_list_card_node.cpp (100%) rename {common => libcockatrice_deck_list/libcockatrice/deck_list}/abstract_deck_list_card_node.h (100%) rename {common => libcockatrice_deck_list/libcockatrice/deck_list}/abstract_deck_list_node.cpp (100%) rename {common => libcockatrice_deck_list/libcockatrice/deck_list}/abstract_deck_list_node.h (100%) rename {common => libcockatrice_deck_list/libcockatrice/deck_list}/deck_list.cpp (100%) rename {common => libcockatrice_deck_list/libcockatrice/deck_list}/deck_list.h (98%) rename {common => libcockatrice_deck_list/libcockatrice/deck_list}/deck_list_card_node.cpp (100%) rename {common => libcockatrice_deck_list/libcockatrice/deck_list}/deck_list_card_node.h (99%) rename {common => libcockatrice_deck_list/libcockatrice/deck_list}/inner_deck_list_node.cpp (100%) rename {common => libcockatrice_deck_list/libcockatrice/deck_list}/inner_deck_list_node.h (100%) create mode 100644 libcockatrice_network/CMakeLists.txt create mode 100644 libcockatrice_network/libcockatrice/network/client/CMakeLists.txt create mode 100644 libcockatrice_network/libcockatrice/network/client/abstract/CMakeLists.txt rename {cockatrice/src/server => libcockatrice_network/libcockatrice/network/client/abstract}/abstract_client.cpp (87%) rename {cockatrice/src/server => libcockatrice_network/libcockatrice/network/client/abstract}/abstract_client.h (97%) create mode 100644 libcockatrice_network/libcockatrice/network/client/local/CMakeLists.txt rename {cockatrice/src/server => libcockatrice_network/libcockatrice/network/client/local}/local_client.cpp (86%) rename {cockatrice/src/server => libcockatrice_network/libcockatrice/network/client/local}/local_client.h (94%) create mode 100644 libcockatrice_network/libcockatrice/network/client/remote/CMakeLists.txt rename {cockatrice/src/server => libcockatrice_network/libcockatrice/network/client}/remote/remote_client.cpp (97%) rename {cockatrice/src/server => libcockatrice_network/libcockatrice/network/client}/remote/remote_client.h (98%) create mode 100644 libcockatrice_network/libcockatrice/network/server/CMakeLists.txt create mode 100644 libcockatrice_network/libcockatrice/network/server/local/CMakeLists.txt rename {cockatrice/src/server => libcockatrice_network/libcockatrice/network/server/local}/local_server.cpp (98%) rename {cockatrice/src/server => libcockatrice_network/libcockatrice/network/server/local}/local_server.h (94%) rename {cockatrice/src/server => libcockatrice_network/libcockatrice/network/server/local}/local_server_interface.cpp (100%) rename {cockatrice/src/server => libcockatrice_network/libcockatrice/network/server/local}/local_server_interface.h (94%) create mode 100644 libcockatrice_network/libcockatrice/network/server/remote/CMakeLists.txt rename {common/server => libcockatrice_network/libcockatrice/network/server/remote}/game/server_abstract_participant.cpp (83%) rename {common/server => libcockatrice_network/libcockatrice/network/server/remote}/game/server_abstract_participant.h (98%) rename {common/server => libcockatrice_network/libcockatrice/network/server/remote}/game/server_abstract_player.cpp (96%) rename {common/server => libcockatrice_network/libcockatrice/network/server/remote}/game/server_abstract_player.h (99%) rename {common/server => libcockatrice_network/libcockatrice/network/server/remote}/game/server_arrow.cpp (94%) rename {common/server => libcockatrice_network/libcockatrice/network/server/remote}/game/server_arrow.h (95%) rename {common/server => libcockatrice_network/libcockatrice/network/server/remote}/game/server_arrowtarget.cpp (100%) rename {common/server => libcockatrice_network/libcockatrice/network/server/remote}/game/server_arrowtarget.h (100%) rename {common/server => libcockatrice_network/libcockatrice/network/server/remote}/game/server_card.cpp (96%) rename {common/server => libcockatrice_network/libcockatrice/network/server/remote}/game/server_card.h (97%) rename {common/server => libcockatrice_network/libcockatrice/network/server/remote}/game/server_cardzone.cpp (99%) rename {common/server => libcockatrice_network/libcockatrice/network/server/remote}/game/server_cardzone.h (98%) rename {common/server => libcockatrice_network/libcockatrice/network/server/remote}/game/server_counter.cpp (88%) rename {common/server => libcockatrice_network/libcockatrice/network/server/remote}/game/server_counter.h (97%) rename {common/server => libcockatrice_network/libcockatrice/network/server/remote}/game/server_game.cpp (96%) rename {common/server => libcockatrice_network/libcockatrice/network/server/remote}/game/server_game.h (97%) rename {common/server => libcockatrice_network/libcockatrice/network/server/remote}/game/server_move_card_struct.h (100%) rename {common/server => libcockatrice_network/libcockatrice/network/server/remote}/game/server_player.cpp (80%) rename {common/server => libcockatrice_network/libcockatrice/network/server/remote}/game/server_player.h (100%) rename {common/server => libcockatrice_network/libcockatrice/network/server/remote}/game/server_spectator.cpp (100%) rename {common/server => libcockatrice_network/libcockatrice/network/server/remote}/game/server_spectator.h (100%) rename {common => libcockatrice_network/libcockatrice/network/server/remote}/room_message_type.h (86%) rename {common/server => libcockatrice_network/libcockatrice/network/server/remote}/server.cpp (98%) rename {common/server => libcockatrice_network/libcockatrice/network/server/remote}/server.h (96%) rename {common/server => libcockatrice_network/libcockatrice/network/server/remote}/server_abstractuserinterface.cpp (97%) rename {common/server => libcockatrice_network/libcockatrice/network/server/remote}/server_abstractuserinterface.h (92%) rename {common/server => libcockatrice_network/libcockatrice/network/server/remote}/server_database_interface.cpp (100%) rename {common/server => libcockatrice_network/libcockatrice/network/server/remote}/server_database_interface.h (100%) rename {common/server => libcockatrice_network/libcockatrice/network/server/remote}/server_player_reference.h (100%) rename {common/server => libcockatrice_network/libcockatrice/network/server/remote}/server_protocolhandler.cpp (96%) rename {common/server => libcockatrice_network/libcockatrice/network/server/remote}/server_protocolhandler.h (97%) rename {common/server => libcockatrice_network/libcockatrice/network/server/remote}/server_remoteuserinterface.cpp (92%) rename {common/server => libcockatrice_network/libcockatrice/network/server/remote}/server_remoteuserinterface.h (100%) rename {common/server => libcockatrice_network/libcockatrice/network/server/remote}/server_response_containers.cpp (100%) rename {common/server => libcockatrice_network/libcockatrice/network/server/remote}/server_response_containers.h (98%) rename {common/server => libcockatrice_network/libcockatrice/network/server/remote}/server_room.cpp (96%) rename {common/server => libcockatrice_network/libcockatrice/network/server/remote}/server_room.h (96%) rename {common => libcockatrice_network/libcockatrice/network/server/remote}/serverinfo_user_container.cpp (96%) rename {common => libcockatrice_network/libcockatrice/network/server/remote}/serverinfo_user_container.h (100%) rename {common => libcockatrice_network/libcockatrice/network/server/remote}/user_level.h (85%) create mode 100644 libcockatrice_protocol/CMakeLists.txt rename {common => libcockatrice_protocol/libcockatrice/protocol}/debug_pb_message.cpp (98%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/debug_pb_message.h (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/featureset.cpp (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/featureset.h (94%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/get_pb_extension.cpp (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/get_pb_extension.h (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/CMakeLists.txt (90%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/admin_commands.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/card_attributes.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/color.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/command_attach_card.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/command_change_zone_properties.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/command_concede.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/command_create_arrow.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/command_create_counter.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/command_create_token.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/command_deck_del.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/command_deck_del_dir.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/command_deck_download.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/command_deck_list.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/command_deck_new_dir.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/command_deck_select.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/command_deck_upload.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/command_del_counter.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/command_delete_arrow.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/command_draw_cards.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/command_dump_zone.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/command_flip_card.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/command_game_say.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/command_inc_card_counter.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/command_inc_counter.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/command_kick_from_game.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/command_leave_game.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/command_move_card.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/command_mulligan.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/command_next_turn.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/command_ready_start.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/command_replay_delete_match.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/command_replay_download.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/command_replay_get_code.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/command_replay_list.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/command_replay_modify_match.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/command_replay_submit_code.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/command_reveal_cards.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/command_reverse_turn.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/command_roll_die.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/command_set_active_phase.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/command_set_card_attr.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/command_set_card_counter.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/command_set_counter.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/command_set_sideboard_lock.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/command_set_sideboard_plan.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/command_shuffle.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/command_undo_draw.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/commands.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/context_concede.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/context_connection_state_changed.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/context_deck_select.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/context_move_card.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/context_mulligan.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/context_ping_changed.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/context_ready_start.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/context_set_sideboard_lock.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/context_undo_draw.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_add_to_list.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_attach_card.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_change_zone_properties.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_connection_closed.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_create_arrow.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_create_counter.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_create_token.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_del_counter.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_delete_arrow.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_destroy_card.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_draw_cards.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_dump_zone.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_flip_card.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_game_closed.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_game_host_changed.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_game_joined.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_game_say.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_game_state_changed.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_join.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_join_room.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_kicked.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_leave.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_leave_room.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_list_games.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_list_rooms.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_move_card.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_notify_user.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_player_properties_changed.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_remove_from_list.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_remove_messages.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_replay_added.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_reveal_cards.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_reverse_turn.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_roll_die.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_room_say.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_server_complete_list.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_server_identification.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_server_message.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_server_shutdown.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_set_active_phase.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_set_active_player.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_set_card_attr.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_set_card_counter.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_set_counter.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_shuffle.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_user_joined.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_user_left.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/event_user_message.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/game_commands.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/game_event.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/game_event_container.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/game_event_context.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/game_replay.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/isl_message.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/moderator_commands.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/move_card_to_zone.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/response.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/response_activate.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/response_adjust_mod.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/response_ban_history.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/response_deck_download.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/response_deck_list.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/response_deck_upload.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/response_dump_zone.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/response_forgotpasswordrequest.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/response_get_admin_notes.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/response_get_games_of_user.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/response_get_user_info.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/response_join_room.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/response_list_users.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/response_login.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/response_password_salt.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/response_register.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/response_replay_download.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/response_replay_get_code.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/response_replay_list.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/response_viewlog_history.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/response_warn_history.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/response_warn_list.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/room_commands.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/room_event.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/server_message.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/serverinfo_arrow.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/serverinfo_ban.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/serverinfo_card.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/serverinfo_cardcounter.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/serverinfo_chat_message.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/serverinfo_counter.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/serverinfo_deckstorage.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/serverinfo_game.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/serverinfo_gametype.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/serverinfo_player.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/serverinfo_playerping.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/serverinfo_playerproperties.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/serverinfo_replay.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/serverinfo_replay_match.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/serverinfo_room.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/serverinfo_user.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/serverinfo_warning.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/serverinfo_zone.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/session_commands.proto (100%) rename {common => libcockatrice_protocol/libcockatrice/protocol}/pb/session_event.proto (100%) rename {cockatrice/src/server => libcockatrice_protocol/libcockatrice/protocol}/pending_command.cpp (100%) rename {cockatrice/src/server => libcockatrice_protocol/libcockatrice/protocol}/pending_command.h (88%) create mode 100644 libcockatrice_rng/CMakeLists.txt rename {common => libcockatrice_rng/libcockatrice/rng}/rng_abstract.cpp (100%) rename {common => libcockatrice_rng/libcockatrice/rng}/rng_abstract.h (100%) rename {common => libcockatrice_rng/libcockatrice/rng}/rng_sfmt.cpp (100%) rename {common => libcockatrice_rng/libcockatrice/rng}/rng_sfmt.h (100%) rename {common => libcockatrice_rng/libcockatrice/rng}/sfmt/LICENSE.txt (100%) rename {common => libcockatrice_rng/libcockatrice/rng}/sfmt/SFMT-common.h (100%) rename {common => libcockatrice_rng/libcockatrice/rng}/sfmt/SFMT-params.h (100%) rename {common => libcockatrice_rng/libcockatrice/rng}/sfmt/SFMT-params19937.h (100%) rename {common => libcockatrice_rng/libcockatrice/rng}/sfmt/SFMT.c (100%) rename {common => libcockatrice_rng/libcockatrice/rng}/sfmt/SFMT.h (100%) create mode 100644 libcockatrice_settings/CMakeLists.txt rename {cockatrice/src => libcockatrice_settings/libcockatrice}/settings/cache_settings.cpp (99%) rename {cockatrice/src => libcockatrice_settings/libcockatrice}/settings/cache_settings.h (99%) rename {cockatrice/src => libcockatrice_settings/libcockatrice}/settings/card_counter_settings.cpp (100%) rename {cockatrice/src => libcockatrice_settings/libcockatrice}/settings/card_counter_settings.h (100%) rename {cockatrice/src => libcockatrice_settings/libcockatrice}/settings/card_database_settings.cpp (100%) rename {cockatrice/src => libcockatrice_settings/libcockatrice}/settings/card_database_settings.h (100%) rename {cockatrice/src => libcockatrice_settings/libcockatrice}/settings/card_override_settings.cpp (100%) rename {cockatrice/src => libcockatrice_settings/libcockatrice}/settings/card_override_settings.h (94%) rename {cockatrice/src => libcockatrice_settings/libcockatrice}/settings/debug_settings.cpp (100%) rename {cockatrice/src => libcockatrice_settings/libcockatrice}/settings/debug_settings.h (100%) rename {cockatrice/src => libcockatrice_settings/libcockatrice}/settings/download_settings.cpp (100%) rename {cockatrice/src => libcockatrice_settings/libcockatrice}/settings/download_settings.h (100%) rename {cockatrice/src => libcockatrice_settings/libcockatrice}/settings/game_filters_settings.cpp (100%) rename {cockatrice/src => libcockatrice_settings/libcockatrice}/settings/game_filters_settings.h (100%) rename {cockatrice/src => libcockatrice_settings/libcockatrice}/settings/layouts_settings.cpp (100%) rename {cockatrice/src => libcockatrice_settings/libcockatrice}/settings/layouts_settings.h (100%) rename {cockatrice/src => libcockatrice_settings/libcockatrice}/settings/message_settings.cpp (100%) rename {cockatrice/src => libcockatrice_settings/libcockatrice}/settings/message_settings.h (100%) rename {cockatrice/src => libcockatrice_settings/libcockatrice}/settings/recents_settings.cpp (100%) rename {cockatrice/src => libcockatrice_settings/libcockatrice}/settings/recents_settings.h (100%) rename {cockatrice/src => libcockatrice_settings/libcockatrice}/settings/servers_settings.cpp (100%) rename {cockatrice/src => libcockatrice_settings/libcockatrice}/settings/servers_settings.h (100%) rename {cockatrice/src => libcockatrice_settings/libcockatrice}/settings/settings_manager.cpp (100%) rename {cockatrice/src => libcockatrice_settings/libcockatrice}/settings/settings_manager.h (100%) rename {cockatrice/src => libcockatrice_settings/libcockatrice}/settings/shortcut_treeview.cpp (100%) rename {cockatrice/src => libcockatrice_settings/libcockatrice}/settings/shortcut_treeview.h (100%) rename {cockatrice/src => libcockatrice_settings/libcockatrice}/settings/shortcuts_settings.cpp (100%) rename {cockatrice/src => libcockatrice_settings/libcockatrice}/settings/shortcuts_settings.h (100%) create mode 100644 libcockatrice_utility/CMakeLists.txt rename {common => libcockatrice_utility/libcockatrice/utility}/card_ref.h (100%) rename {common => libcockatrice_utility/libcockatrice/utility}/color.h (91%) rename {common => libcockatrice_utility/libcockatrice/utility}/expression.cpp (99%) rename {common => libcockatrice_utility/libcockatrice/utility}/expression.h (100%) rename {cockatrice/src => libcockatrice_utility/libcockatrice}/utility/key_signals.cpp (100%) rename {cockatrice/src => libcockatrice_utility/libcockatrice}/utility/key_signals.h (100%) rename {cockatrice/src => libcockatrice_utility/libcockatrice}/utility/levenshtein.cpp (100%) rename {cockatrice/src => libcockatrice_utility/libcockatrice}/utility/levenshtein.h (100%) rename {cockatrice/src => libcockatrice_utility/libcockatrice}/utility/logger.cpp (100%) rename {cockatrice/src => libcockatrice_utility/libcockatrice}/utility/logger.h (100%) rename {cockatrice/src => libcockatrice_utility/libcockatrice}/utility/macros.h (100%) rename {common => libcockatrice_utility/libcockatrice/utility}/passwordhasher.cpp (96%) rename {common => libcockatrice_utility/libcockatrice/utility}/passwordhasher.h (100%) rename {common/lib => libcockatrice_utility/libcockatrice/utility}/peglib.h (100%) rename {common => libcockatrice_utility/libcockatrice/utility}/trice_limits.h (100%) diff --git a/.github/workflows/translations-push.yml b/.github/workflows/translations-push.yml index 927b3d5a1..602845a49 100644 --- a/.github/workflows/translations-push.yml +++ b/.github/workflows/translations-push.yml @@ -31,10 +31,10 @@ jobs: - name: Update Cockatrice translation source id: cockatrice shell: bash - env: - FILE: 'cockatrice/cockatrice_en@source.ts' - DIRS: 'cockatrice/src common' - run: .ci/update_translation_source_strings.sh + run: | + FILE="cockatrice/cockatrice_en@source.ts" + export DIRS="cockatrice/src $(find . -maxdepth 1 -type d -name 'libcockatrice_*')" + FILE="$FILE" DIRS="$DIRS" .ci/update_translation_source_strings.sh - name: Update Oracle translation source id: oracle diff --git a/CMakeLists.txt b/CMakeLists.txt index 4d2e4b145..b4e1c4c71 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -328,7 +328,13 @@ endif() include(CPack) -add_subdirectory(common) +add_subdirectory(${CMAKE_SOURCE_DIR}/libcockatrice_protocol ${CMAKE_BINARY_DIR}/libcockatrice_protocol) +add_subdirectory(${CMAKE_SOURCE_DIR}/libcockatrice_network ${CMAKE_BINARY_DIR}/libcockatrice_network) +add_subdirectory(${CMAKE_SOURCE_DIR}/libcockatrice_deck_list ${CMAKE_BINARY_DIR}/libcockatrice_deck_list) +add_subdirectory(${CMAKE_SOURCE_DIR}/libcockatrice_rng ${CMAKE_BINARY_DIR}/libcockatrice_rng) +add_subdirectory(${CMAKE_SOURCE_DIR}/libcockatrice_settings ${CMAKE_BINARY_DIR}/libcockatrice_settings) +add_subdirectory(${CMAKE_SOURCE_DIR}/libcockatrice_card ${CMAKE_BINARY_DIR}/libcockatrice_card) +add_subdirectory(${CMAKE_SOURCE_DIR}/libcockatrice_utility ${CMAKE_BINARY_DIR}/libcockatrice_utility) if(WITH_SERVER) add_subdirectory(servatrice) set(CPACK_INSTALL_CMAKE_PROJECTS "Servatrice;Servatrice;ALL;/" ${CPACK_INSTALL_CMAKE_PROJECTS}) diff --git a/cockatrice/CMakeLists.txt b/cockatrice/CMakeLists.txt index d2d76bbe5..b9c3d87dd 100644 --- a/cockatrice/CMakeLists.txt +++ b/cockatrice/CMakeLists.txt @@ -7,12 +7,6 @@ project(Cockatrice VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${ set(cockatrice_SOURCES ${VERSION_STRING_CPP} # sort by alphabetical order, so that there is no debate about where to add new sources to the list - src/card/card_info.cpp - src/card/card_relation.cpp - src/card/card_set.cpp - src/card/card_set_list.cpp - src/card/exact_card.cpp - src/card/printing_info.cpp src/client/deck_editor_menu.cpp src/client/get_text_with_max.cpp src/client/network/client_update_checker.cpp @@ -25,19 +19,6 @@ set(cockatrice_SOURCES src/client/sound_engine.cpp src/client/tapped_out_interface.cpp src/client/update_downloader.cpp - src/database/card_database.cpp - src/database/card_database_loader.cpp - src/database/card_database_manager.cpp - src/database/card_database_querier.cpp - src/database/model/card_database_model.cpp - src/database/model/card_database_display_model.cpp - src/database/model/card/card_completer_proxy_model.cpp - src/database/model/card/card_search_model.cpp - src/database/model/token/token_display_model.cpp - src/database/model/token/token_edit_model.cpp - src/database/parser/card_database_parser.cpp - src/database/parser/cockatrice_xml_3.cpp - src/database/parser/cockatrice_xml_4.cpp src/deck/custom_line_edit.cpp src/deck/deck_list_model.cpp src/deck/deck_loader.cpp @@ -138,6 +119,13 @@ set(cockatrice_SOURCES src/game/zones/table_zone.cpp src/game/zones/view_zone.cpp src/game/zones/view_zone_widget.cpp + src/interface/card_picture_loader/card_picture_loader.cpp + src/interface/card_picture_loader/card_picture_loader_local.cpp + src/interface/card_picture_loader/card_picture_loader_request_status_display_widget.cpp + src/interface/card_picture_loader/card_picture_loader_status_bar.cpp + src/interface/card_picture_loader/card_picture_loader_worker.cpp + src/interface/card_picture_loader/card_picture_loader_worker_work.cpp + src/interface/card_picture_loader/card_picture_to_load.cpp src/interface/layouts/flow_layout.cpp src/interface/layouts/overlap_layout.cpp src/interface/line_edit_completer.cpp @@ -217,23 +205,10 @@ set(cockatrice_SOURCES src/interface/widgets/visual_deck_storage/visual_deck_storage_widget.cpp src/interface/window_main.cpp src/main.cpp - src/picture_loader/picture_loader.cpp - src/picture_loader/picture_loader_local.cpp - src/picture_loader/picture_loader_request_status_display_widget.cpp - src/picture_loader/picture_loader_status_bar.cpp - src/picture_loader/picture_loader_worker.cpp - src/picture_loader/picture_loader_worker_work.cpp - src/picture_loader/picture_to_load.cpp - src/server/abstract_client.cpp src/server/chat_view/chat_view.cpp src/server/game_selector.cpp src/server/games_model.cpp src/server/handle_public_servers.cpp - src/server/local_client.cpp - src/server/local_server.cpp - src/server/local_server_interface.cpp - src/server/pending_command.cpp - src/server/remote/remote_client.cpp src/server/remote/remote_decklist_tree_widget.cpp src/server/remote/remote_replay_list_tree_widget.cpp src/server/user/user_context_menu.cpp @@ -241,20 +216,6 @@ set(cockatrice_SOURCES src/server/user/user_info_connection.cpp src/server/user/user_list_manager.cpp src/server/user/user_list_widget.cpp - src/settings/cache_settings.cpp - src/settings/card_counter_settings.cpp - src/settings/card_database_settings.cpp - src/settings/card_override_settings.cpp - src/settings/debug_settings.cpp - src/settings/download_settings.cpp - src/settings/game_filters_settings.cpp - src/settings/layouts_settings.cpp - src/settings/message_settings.cpp - src/settings/recents_settings.cpp - src/settings/servers_settings.cpp - src/settings/settings_manager.cpp - src/settings/shortcut_treeview.cpp - src/settings/shortcuts_settings.cpp src/tabs/abstract_tab_deck_editor.cpp src/tabs/api/edhrec/api_response/archidekt_links/edhrec_api_response_archidekt_links.cpp src/tabs/api/edhrec/api_response/average_deck/edhrec_average_deck_api_response.cpp @@ -299,12 +260,8 @@ set(cockatrice_SOURCES src/tabs/visual_deck_editor/tab_deck_editor_visual.cpp src/tabs/visual_deck_editor/tab_deck_editor_visual_tab_widget.cpp src/tabs/visual_deck_storage/tab_deck_storage_visual.cpp - src/utility/card_info_comparator.cpp - src/utility/deck_list_sort_filter_proxy_model.cpp - src/utility/key_signals.cpp - src/utility/levenshtein.cpp - src/utility/logger.cpp - src/utility/sequence_edit.cpp + src/interface/utility/deck_list_sort_filter_proxy_model.cpp + src/interface/utility/sequence_edit.cpp ) add_subdirectory(sounds) @@ -316,15 +273,23 @@ configure_file( set(cockatrice_RESOURCES cockatrice.qrc) if(UPDATE_TRANSLATIONS) + # Cockatrice main sources file(GLOB_RECURSE translate_cockatrice_SRCS ${CMAKE_SOURCE_DIR}/cockatrice/src/*.cpp ${CMAKE_SOURCE_DIR}/cockatrice/src/*.h ) - file(GLOB_RECURSE translate_common_SRCS ${CMAKE_SOURCE_DIR}/common/*.cpp ${CMAKE_SOURCE_DIR}/common/*.h) - set(translate_SRCS ${translate_cockatrice_SRCS} ${translate_common_SRCS}) + + # All libcockatrice_* libraries (recursively) + file(GLOB_RECURSE translate_lib_SRCS ${CMAKE_SOURCE_DIR}/libcockatrice_*/**/*.cpp + ${CMAKE_SOURCE_DIR}/libcockatrice_*/**/*.h + ) + + # Combine all sources for translation + set(translate_SRCS ${translate_cockatrice_SRCS} ${translate_lib_SRCS}) + set(cockatrice_TS "${CMAKE_CURRENT_SOURCE_DIR}/cockatrice_en@source.ts") else() file(GLOB cockatrice_TS "${CMAKE_CURRENT_SOURCE_DIR}/translations/*.ts") -endif(UPDATE_TRANSLATIONS) +endif() if(WIN32) set(cockatrice_SOURCES ${cockatrice_SOURCES} cockatrice.rc) @@ -354,12 +319,6 @@ set(DESKTOPDIR CACHE STRING "desktop file destination" ) -# Include directories -include_directories(../common) -include_directories(${PROTOBUF_INCLUDE_DIR}) -include_directories(${CMAKE_BINARY_DIR}/common) -include_directories(${CMAKE_CURRENT_BINARY_DIR}) - set(COCKATRICE_MAC_QM_INSTALL_DIR "cockatrice.app/Contents/Resources/translations") set(COCKATRICE_UNIX_QM_INSTALL_DIR "share/cockatrice/translations") set(COCKATRICE_WIN32_QM_INSTALL_DIR "translations") @@ -399,9 +358,20 @@ elseif(Qt5_FOUND) endif() if(Qt5_FOUND) - target_link_libraries(cockatrice cockatrice_common ${COCKATRICE_QT_MODULES}) + target_link_libraries( + cockatrice + libcockatrice_card + libcockatrice_deck_list + libcockatrice_utility + libcockatrice_network + libcockatrice_rng + ${COCKATRICE_QT_MODULES} + ) else() - target_link_libraries(cockatrice PUBLIC cockatrice_common ${COCKATRICE_QT_MODULES}) + target_link_libraries( + cockatrice PUBLIC libcockatrice_card libcockatrice_deck_list libcockatrice_utility libcockatrice_network + libcockatrice_rng ${COCKATRICE_QT_MODULES} + ) endif() if(UNIX) diff --git a/cockatrice/cockatrice_en@source.ts b/cockatrice/cockatrice_en@source.ts index 5a3b88d09..c4589d071 100644 --- a/cockatrice/cockatrice_en@source.ts +++ b/cockatrice/cockatrice_en@source.ts @@ -38,66 +38,66 @@ AbstractTabDeckEditor - + Open in new tab - + Are you sure? - + The decklist has been modified. Do you want to save the changes? - - - - - - - + + + + + + + Error - + Could not open deck at %1 - + Could not save remote deck - - + + The deck could not be saved. Please check that the directory is writable and try again. - + Save deck - + The deck could not be saved. - + There are no cards in your deck to be exported - + No deck was selected to be exported. @@ -118,12 +118,12 @@ Please check that the directory is writable and try again. AllZonesCardAmountWidget - + Mainboard - + Sideboard @@ -146,143 +146,170 @@ Please check that the directory is writable and try again. - - Theme settings + + Enabling this feature will disable the use of the Printing Selector. + +You will not be able to manage printing preferences on a per-deck basis, or see printings other people have selected for their decks. + +You will have to use the Set Manager, available through Card Database -> Manage Sets. + +Are you sure you would like to enable this feature? - - Current theme: + + Disabling this feature will enable the Printing Selector. + +You can now choose printings on a per-deck basis in the Deck Editor and configure which printing gets added to a deck by default by pinning it in the Printing Selector. + +You can also use the Set Manager to adjust custom sort order for printings in the Printing Selector (other sort orders like alphabetical or release date are available). + +Are you sure you would like to disable this feature? - - Open themes folder - - - - - Home tab background source: - - - - - Home tab background shuffle frequency: - - - - - Disabled - - - - - Menu settings - - - - - Show keyboard shortcuts in right-click menus - - - - - Card rendering - - - - - Display card names on cards having a picture - - - - - Auto-Rotate cards with sideways layout - - - - - Override all card art with personal set preference (Pre-ProviderID change behavior) [Requires Client restart] - - - - - Bump sets that the deck contains cards from to the top in the printing selector - - - - - Scale cards on mouse over - - - - - Use rounded card corners - - - - - Minimum overlap percentage of cards on the stack and in vertical hand - - - - - Maximum initial height for card view window: - - - - - - rows - - - - - Maximum expanded height for card view window: - - - - - Card counters - - - - - Counter %1 - - - - - Hand layout - - - - - Display hand horizontally (wastes space) - - - - - Enable left justification - - - - - Table grid layout + + Confirm Change - Invert vertical coordinate + Theme settings - Minimum player count for multi-column layout: + Current theme: + Open themes folder + + + + + Home tab background source: + + + + + Home tab background shuffle frequency: + + + + + Disabled + + + + + Menu settings + + + + + Show keyboard shortcuts in right-click menus + + + + + Card rendering + + + + + Display card names on cards having a picture + + + + + Auto-Rotate cards with sideways layout + + + + + Override all card art with personal set preference (Pre-ProviderID change behavior) + + + + + Bump sets that the deck contains cards from to the top in the printing selector + + + + + Scale cards on mouse over + + + + + Use rounded card corners + + + + + Minimum overlap percentage of cards on the stack and in vertical hand + + + + + Maximum initial height for card view window: + + + + + + rows + + + + + Maximum expanded height for card view window: + + + + + Card counters + + + + + Counter %1 + + + + + Hand layout + + + + + Display hand horizontally (wastes space) + + + + + Enable left justification + + + + + Table grid layout + + + + + Invert vertical coordinate + + + + + Minimum player count for multi-column layout: + + + + Maximum font size for information displayed on cards: @@ -290,17 +317,17 @@ Please check that the directory is writable and try again. BackgroundSources - + Theme - + Art crop of random card - + Art crop of background.cod deck file @@ -443,32 +470,32 @@ This is only saved for moderators and cannot be seen by the banned person. CardDatabaseModel - + Name - + Sets - + Mana cost - + Card type - + P/T - + Color(s) @@ -573,22 +600,22 @@ This is only saved for moderators and cannot be seen by the banned person. CardInfoFrameWidget - + Image - + Description - + Both - + View transformation @@ -596,22 +623,22 @@ This is only saved for moderators and cannot be seen by the banned person. CardInfoPictureWidget - + View related cards - + Add card to deck - + Mainboard - + Sideboard @@ -619,17 +646,17 @@ This is only saved for moderators and cannot be seen by the banned person. CardInfoTextWidget - + Name: - + Related cards: - + Unknown card: @@ -637,124 +664,124 @@ This is only saved for moderators and cannot be seen by the banned person. CardMenu - + Re&veal to... - + &All players - + View related cards - + Token: - + All tokens - + &Select All - + S&elect Row - + S&elect Column - + &Play - + &Hide - + Play &Face Down - + &Tap / Untap Turn sideways or back again - + Toggle &normal untapping - + T&urn Over Turn face up/face down - + &Peek at card face - + &Clone - + Attac&h to card... - + Unattac&h - + &Draw arrow... - + &Set annotation... - + Ca&rd counters - + &Add counter (%1) - + &Remove counter (%1) - + &Set counters (%1)... @@ -762,7 +789,7 @@ This is only saved for moderators and cannot be seen by the banned person. CardSizeWidget - + Card Size @@ -905,7 +932,7 @@ This is only saved for moderators and cannot be seen by the banned person. CockatriceXml3Parser - + Parse error at line %1 col %2: @@ -913,7 +940,7 @@ This is only saved for moderators and cannot be seen by the banned person. CockatriceXml4Parser - + Parse error at line %1 col %2: @@ -935,7 +962,7 @@ This is only saved for moderators and cannot be seen by the banned person. DeckEditorCardInfoDockWidget - + Card Info @@ -943,47 +970,47 @@ This is only saved for moderators and cannot be seen by the banned person. DeckEditorDatabaseDisplayWidget - + Search by card name (or search expressions) - + Add to Deck - + Add to Sideboard - + Select Printing - + Show on EDHRec (Commander) - + Show on EDHRec (Card) - + Show Related cards - + Add card to &maindeck - + Add card to &sideboard @@ -991,87 +1018,87 @@ This is only saved for moderators and cannot be seen by the banned person. DeckEditorDeckDockWidget - + Banner Card - + Main Type - + Mana Cost - + Colors - + Select Printing - + Deck - + Deck &name: - + Banner Card/Tags Visibility Settings - + Show banner card selection menu - + Show tags selection menu - + &Comments: - + Group by: - + Hash: - + &Increment number - + &Decrement number - + &Remove row - + Swap card to/from sideboard @@ -1079,17 +1106,17 @@ This is only saved for moderators and cannot be seen by the banned person. DeckEditorFilterDockWidget - + Filters - + &Clear all filters - + Delete selected @@ -1097,114 +1124,114 @@ This is only saved for moderators and cannot be seen by the banned person. DeckEditorMenu - + &Deck Editor - + &New deck - + &Load deck... - + Load recent deck... - + Clear - + &Save deck - + Save deck &as... - + Load deck from cl&ipboard... - + Edit deck in clipboard - - + + Annotated - - + + Not Annotated - + Save deck to clipboard - + Annotated (No set info) - + Not Annotated (No set info) - + &Print deck... - + Load deck from online service... - + &Send deck to online service - + Create decklist (decklist.org) - + Create decklist (decklist.xyz) - + Analyze deck (deckstats.net) - + Analyze deck (tappedout.net) - + &Close @@ -1212,7 +1239,7 @@ This is only saved for moderators and cannot be seen by the banned person. DeckEditorPrintingSelectorDockWidget - + Printing Selector @@ -1220,166 +1247,166 @@ This is only saved for moderators and cannot be seen by the banned person. DeckEditorSettingsPage - - + + Update Spoilers - - + + Success - + Download URLs have been reset. - + Downloaded card pictures have been reset. - + Error - + One or more downloaded card pictures could not be cleared. - + Add URL - - + + URL: - - + + Edit URL - + Network Cache Size: - + Redirect Cache TTL: - + How long cached redirects for urls are valid for. - + Picture Cache Size: - + Add New URL - + Remove URL - + Day(s) - + Updating... - + Choose path - + URL Download Priority - + Spoilers - + Download Spoilers Automatically - + Spoiler Location: - + Last Change - + Spoilers download automatically on launch - + Press the button to manually update without relaunching - + Do not close settings until manual update is complete - + Download card pictures on the fly - + How to add a custom URL - + Delete Downloaded Images - + Reset Download URLs - + On-disk cache for downloaded pictures - + In-memory cache for pictures not currently on screen @@ -1428,17 +1455,17 @@ This is only saved for moderators and cannot be seen by the banned person. DeckPreviewColorIdentityFilterWidget - + Mode: Exact Match - + Mode: Includes - + Color identity filter mode (AND/OR/NOT conjunctions of filters) @@ -1446,7 +1473,7 @@ This is only saved for moderators and cannot be seen by the banned person. DeckPreviewDeckTagsDisplayWidget - + Edit tags ... @@ -1454,62 +1481,62 @@ This is only saved for moderators and cannot be seen by the banned person. DeckPreviewTagDialog - + Deck Tags Manager - + Manage your deck tags. Check or uncheck tags as needed, or add new ones: - + Add a new tag (e.g., Aggro️) - + Add Tag - + Filter tags... - + OK - + Edit default tags - + Cancel - + Invalid Input - + Tag name cannot be empty! - + Duplicate Tag - + This tag already exists. @@ -1517,94 +1544,94 @@ This is only saved for moderators and cannot be seen by the banned person. DeckPreviewWidget - + Banner Card - + Open in deck editor - + Edit Tags - + Rename Deck - + Save Deck to Clipboard - + Annotated - + Annotated (No set info) - + Not Annotated - + Not Annotated (No set info) - + Rename File - + Delete File - + Set Banner Card - - + + New name: - - + + Error - + Rename failed - + Delete file - + Are you sure you want to delete the selected file? - + Delete failed @@ -1612,13 +1639,13 @@ This is only saved for moderators and cannot be seen by the banned person. DeckStatsInterface - - + + Error - + The reply from the server could not be parsed. @@ -1648,7 +1675,6 @@ This is only saved for moderators and cannot be seen by the banned person. Unload deck - Unload deck... @@ -1722,148 +1748,148 @@ This will kick all non-ready players from the game. DlgConnect - + Downloading... - + Known Hosts - + Delete the currently selected saved server - + Refresh the server list with known public servers - + New Host - + Name: - + &Host: - + &Port: - + Player &name: - + P&assword: - + &Save password - + A&uto connect - + Automatically connect to the most recent login when Cockatrice opens - + If you have any trouble connecting or registering then contact the server staff for help! - - + + Webpage - + Reset Password - + Forgot password? - + &Connect - + Server - + Login - + Server Contact - + Connect to Server - + Server URL - + Communication Port - + Unique Server Name - + Connection Warning - + You need to name your new connection profile. - + Connect Warning - + The player name can't be empty. @@ -1961,27 +1987,27 @@ This will kick all non-ready players from the game. - + &Clear - + Create game - + Game information - + Error - + Server error. @@ -1989,97 +2015,97 @@ This will kick all non-ready players from the game. DlgCreateToken - + &Name: - + Token - + C&olor: - + white - + blue - + black - + red - + green - + multicolor - + colorless - + &P/T: - + &Annotation: - + &Destroy token when it leaves the table - + Create face-down (Only hides name) - + Token data - + Show &all tokens - + Show tokens from this &deck - + Choose token from list - + Create token @@ -2087,53 +2113,53 @@ This will kick all non-ready players from the game. DlgDefaultTagsEditor - + Edit Tags - + Add - + Confirm - + Cancel - + Enter a tag and press Enter - - + + - + Invalid Input - + Tag name cannot be empty! - + Duplicate Tag - + This tag already exists. @@ -2141,39 +2167,39 @@ This will kick all non-ready players from the game. DlgEditAvatar - - + + No image chosen. - + To change your avatar, choose a new image. To remove your current avatar, confirm without choosing a new image. - + Browse... - + Change avatar - + Open Image - + Image Files (*.png *.jpg *.bmp) - + Invalid image chosen. @@ -2199,38 +2225,38 @@ To remove your current avatar, confirm without choosing a new image. DlgEditPassword - + Old password: - + New password: - + Confirm new password: - + Change password - - + + Error - + Your password is too short. - + The new passwords don't match. @@ -2238,93 +2264,93 @@ To remove your current avatar, confirm without choosing a new image. DlgEditTokens - + &Name: - + C&olor: - + white - + blue - + black - + red - + green - + multicolor - + colorless - + &P/T: - + &Annotation: - + Token data - - + + Add token - + Remove token - + Edit custom tokens - + Please enter the name of the token: - + Error - + The chosen name conflicts with an existing card or token. Make sure to enable the 'Token' set in the "Manage sets" dialog to display them correctly. @@ -2333,27 +2359,27 @@ Make sure to enable the 'Token' set in the "Manage sets" dia DlgEditUser - + Email: - + Country: - + Undefined - + Real name: - + Edit user profile @@ -2504,52 +2530,52 @@ Make sure to enable the 'Token' set in the "Manage sets" dia DlgForgotPasswordChallenge - + Reset Password Challenge Warning - + A problem has occurred. Please try to request a new password again. - + Enter the information of the server and the account you'd like to request a new password for. - + &Host: - + &Port: - + Player &name: - + Email: - + Reset Password Challenge - + Reset Password Challenge Error - + The email address can't be empty. @@ -2557,37 +2583,37 @@ Make sure to enable the 'Token' set in the "Manage sets" dia DlgForgotPasswordRequest - + Enter the information of the server you'd like to request a new password for. - + &Host: - + &Port: - + Player &name: - + Reset Password Request - + Reset Password Error - + The player name can't be empty. @@ -2595,86 +2621,86 @@ Make sure to enable the 'Token' set in the "Manage sets" dia DlgForgotPasswordReset - + Reset Password Warning - + A problem has occurred. Please try to request a new password again. - + Enter the received token and the new password in order to set your new password. - + &Host: - + &Port: - + Player &name: - + Token: - - + + New Password: - + Reset Password - + The player name can't be empty. - - - - + + + + Reset Password Error - + The token can't be empty. - + The new password can't be empty. - + Error - + Your password is too short. - + The passwords do not match. @@ -2682,7 +2708,7 @@ Make sure to enable the 'Token' set in the "Manage sets" dia DlgLoadDeck - + Load Deck @@ -2766,37 +2792,37 @@ https://tappedout.net/mtg-decks/your-deck-name/ DlgMoveTopCardsUntil - + Card name (or search expressions): - + Number of hits: - + Auto play hits - + Put top cards on stack until... - + No cards matching the search expression exists in the card database. Proceed anyways? - + Cockatrice - + Invalid filter @@ -2804,91 +2830,91 @@ https://tappedout.net/mtg-decks/your-deck-name/ DlgRegister - + Enter your information and the information of the server you'd like to register to. Your email will be used to verify your account. - + &Host: - + &Port: - + Player &name: - + P&assword: - + Password (again): - + Email: - + Email (again): - + Country: - + Undefined - + Real name: - + Register to server - - - - + + + + Registration Warning - + Your password is too short. - + Your passwords do not match, please try again. - + Your email addresses do not match, please try again. - + The player name can't be empty. @@ -2896,17 +2922,17 @@ Your email will be used to verify your account. DlgRollDice - + Number of sides: - + Number of dice: - + Roll Dice @@ -2942,12 +2968,12 @@ Your email will be used to verify your account. DlgSettings - + Unknown Error loading card database - + Your card database is invalid. Cockatrice may not function correctly with an invalid database @@ -2958,7 +2984,7 @@ Would you like to change your database location setting? - + Your card database version is too old. This can cause problems loading card information or images @@ -2969,7 +2995,7 @@ Would you like to change your database location setting? - + Your card database did not finish loading Please file a ticket at https://github.com/Cockatrice/Cockatrice/issues with your cards.xml attached @@ -2978,21 +3004,21 @@ Would you like to change your database location setting? - + File Error loading your card database. Would you like to change your database location setting? - + Your card database was loaded but contains no cards. Would you like to change your database location setting? - + Unknown card database load status Please file a ticket at https://github.com/Cockatrice/Cockatrice/issues @@ -3001,59 +3027,59 @@ Would you like to change your database location setting? - - - + + + Error - + The path to your deck directory is invalid. Would you like to go back and set the correct path? - + The path to your card pictures directory is invalid. Would you like to go back and set the correct path? - + Settings - + General - + Appearance - + User Interface - + Card Sources - + Chat - + Sound - + Shortcuts @@ -3061,39 +3087,39 @@ Would you like to change your database location setting? DlgStartupCardCheck - + Card Update Check - + It has been more than %2 days since you last checked your card database for updates. Choose how you would like to run the card database updater. You can always change this behavior in the 'General' settings tab. - + Run in foreground - + Run in background - + Run in background and always from now on - + Don't prompt again and don't run - + Don't run this time @@ -3160,7 +3186,6 @@ Please visit the download page to update manually. Downloading update: %1 - Downloading update... @@ -3237,14 +3262,11 @@ Please visit the download page to update manually. Unfortunately, the automatic updater failed to find a compatible download. You may have to manually download the new version. - Unfortunately there are no download packages available for your operating system. -You may have to build from source yourself. Please check the <a href="%1">releases page</a> on our Github and download the build for your system. - Please check the download page manually and visit the wiki for instructions on compiling. @@ -3288,17 +3310,17 @@ You may have to build from source yourself. DlgViewLog - + Clear log when closing - + Copy to clipboard - + Debug Log @@ -3306,12 +3328,12 @@ You may have to build from source yourself. EdhrecApiResponseCardInclusionDisplayWidget - + In %1 decks - + %1% of %2 decks @@ -3319,47 +3341,47 @@ You may have to build from source yourself. EdhrecApiResponseCardPricesDisplayWidget - + Card Hoarder - + Card Kingdom - + Card Market - + Face 2-Face - + Mana Pool - + MTG Stocks - + Scg - + Tcgl - + Tcgplayer @@ -3367,7 +3389,7 @@ You may have to build from source yourself. EdhrecApiResponseCardSynergyDisplayWidget - + %1% Synergy @@ -3375,22 +3397,22 @@ You may have to build from source yourself. EdhrecCommanderApiResponseNavigationWidget - + Combos - + Average Deck - + Game Changers - + Budget @@ -3398,7 +3420,7 @@ You may have to build from source yourself. EdhrecCommanderResponseCommanderDetailsDisplayWidget - + Salt: @@ -3414,22 +3436,22 @@ You may have to build from source yourself. FilterDisplayWidget - + Confirm Delete - + Are you sure you want to delete the filter '%1'? - + Delete Failed - + Failed to delete filter '%1'. @@ -3437,22 +3459,22 @@ You may have to build from source yourself. GameEventHandler - + kicked by game host or moderator - + player left the game - + player disconnected from server - + reason unknown @@ -3460,120 +3482,120 @@ You may have to build from source yourself. GameSelector - - - - - - - - - + + + + + + + + + Error - + Please join the appropriate room first. - + Wrong password. - + Spectators are not allowed in this game. - + The game is already full. - + The game does not exist any more. - + This game is only open to registered users. - + This game is only open to its creator's buddies. - + You are being ignored by the creator of this game. - + Join Game - + Spectate Game - + Game Information - + Join game - + Password: - + Please join the respective room first. - + &Filter games - + C&lear filter - + C&reate - + &Join - + J&oin as spectator - + Games shown: %1 / %2 - + Games @@ -3581,12 +3603,12 @@ You may have to build from source yourself. GamesModel - + >1 day - + %1%2 hr short age in hours @@ -3595,12 +3617,12 @@ You may have to build from source yourself. - + new - + %1%2 min short age in minutes @@ -3609,83 +3631,83 @@ You may have to build from source yourself. - + password - + buddies only - + reg. users only - + open decklists - - + + can chat - + see hands - + can see hands - + not allowed - + Room - + Age - + Description - + Creator - + Type - + Restrictions - + Players - + Spectators @@ -3837,42 +3859,47 @@ You may have to build from source yourself. GraveyardMenu - + &Graveyard - + &View graveyard - + &Move graveyard to... - + &Top of library - + &Bottom of library - + + &All players + + + + &Hand - + &Exile - + Reveal random card to... @@ -3880,105 +3907,111 @@ You may have to build from source yourself. HandMenu - + &Hand - + &View hand - + &Sort hand - + Take &mulligan - + &Move hand to... - + &Top of library - + &Bottom of library - + &Graveyard - + &Exile - + &Reveal hand to... - + Reveal r&andom card to... + + + + &All players + + HomeWidget - + Create New Deck - + Browse Decks - + Browse Card Database - + Browse EDHRec - + View Replays - + Quit - + Connecting... - + Connect - + Play @@ -3986,238 +4019,254 @@ You may have to build from source yourself. LibraryMenu - + &Library - + &View library - + View &top cards of library... - + View bottom cards of library... - + Reveal &library to... - + Lend library to... - + Reveal &top cards to... - + &Top of library... - + &Bottom of library... - + &Always reveal top card - + &Always look at top card - + &Open deck in deck editor - + &Draw card - + D&raw cards... - + &Undo last draw - + Shuffle - + &Play top card - + Play top card &face down - + Put top card on &bottom - + Move top card to grave&yard - + Move top card to e&xile - + Move top cards to &graveyard... - + Move top cards to &exile... - + Put top cards on stack &until... - + Shuffle top cards... - + &Draw bottom card - + D&raw bottom cards... - + &Play bottom card - + Play bottom card &face down - + Move bottom card to grave&yard - + Move bottom card to e&xile - + Move bottom cards to &graveyard... - + Move bottom cards to &exile... - + Put bottom card on &top - + Shuffle bottom cards... + + + + &All players + + + + + Reveal top cards of library + + + + + Number of cards: (max. %1) + + MainWindow - - + + The server has reached its maximum user capacity, please check back later. - + There are too many concurrent connections from your address. - + Banned by moderator - + Expected end time: %1 - + This ban lasts indefinitely. - + Scheduled server shutdown. - - + + Invalid username. - + You have been logged out due to logging in at another location. - + Connection closed - + The server has terminated your connection. Reason: %1 - + The server is going to be restarted in %n minute(s). All running games will be lost. Reason for shutdown: %1 @@ -4227,602 +4276,602 @@ Reason for shutdown: %1 - + Scheduled server shutdown - - + + Success - + Registration accepted. Will now login. - + Account activation accepted. Will now login. - + Number of players - + Please enter the number of players. - - + + Player %1 - + Load replay - + About Cockatrice - + Version - + Cockatrice Webpage - + Project Manager: - + Past Project Managers: - + Developers: - + Our Developers - + Help Develop! - + Translators: - + Our Translators - + Help Translate! - + Support: - + Report an Issue - + Troubleshooting - + F.A.Q. - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + Error - + Server timeout - + Failed Login - + Your client seems to be missing features this server requires for connection. - + To update your client, go to 'Help -> Check for Client Updates'. - + Incorrect username or password. Please check your authentication information and try again. - + There is already an active session using this user name. Please close that session first and re-login. - - + + You are banned until %1. - - + + You are banned indefinitely. - + This server requires user registration. Do you want to register now? - + This server requires client IDs. Your client is either failing to generate an ID or you are running a modified client. Please close and reopen your client to try again. - + An internal error has occurred, please close and reopen Cockatrice before trying again. If the error persists, ensure you are running the latest version of the software and if needed contact the software developers. - + Account activation - + Your account has not been activated yet. You need to provide the activation token received in the activation email. - + Server Full - + Unknown login error: %1 - - + + This usually means that your client version is out of date, and the server sent a reply your client doesn't understand. - + Your username must respect these rules: - + is %1 - %2 characters long - + can %1 contain lowercase characters - - - - + + + + NOT - + can %1 contain uppercase characters - + can %1 contain numeric characters - + can contain the following punctuation: %1 - + first character can %1 be a punctuation mark - + no unacceptable language as specified by these server rules: note that the following lines will not be translated - + can not contain any of the following words: %1 - + can not match any of the following expressions: %1 - + You may only use A-Z, a-z, 0-9, _, ., and - in your username. - - - - - - + + + + + + Registration denied - + Registration is currently disabled on this server - + There is already an existing account with the same user name. - + It's mandatory to specify a valid email address when registering. - + It appears you are attempting to register a new account on this server yet you already have an account registered with the email provided. This server restricts the number of accounts a user can register per address. Please contact the server operator for further assistance or to obtain your credential information. - + Password too short. - + Registration failed for a technical problem on the server. - + The connection to the server has been lost. - + Unknown registration error: %1 - + Account activation failed - + Socket error: %1 - + You are trying to connect to an obsolete server. Please downgrade your Cockatrice version or connect to a suitable server. Local version is %1, remote version is %2. - + Your Cockatrice client is obsolete. Please update your Cockatrice version. Local version is %1, remote version is %2. - + Connecting to %1... - + Registering to %1 as %2... - + Disconnected - + Connected, logging in at %1 - - - + + + Requesting forgotten password to %1 as %2... - + &Connect... - + &Disconnect - + Start &local game... - + &Watch replay... - + &Full screen - + &Register to server... - + &Restore password... - + &Settings... - + &Exit - + A&ctions - + &Cockatrice - + C&ard Database - + &Manage sets... - + Edit custom &tokens... - + Open custom image folder - + Open custom sets folder - + Add custom sets/cards - + Reload card database - + Tabs - + &Help - + &About Cockatrice - + &Tip of the Day - + Check for Client Updates - + Check for Card Updates... - + Check for Card Updates (Automatic) - + Show Status Bar - + View &Debug Log - + Open Settings Folder - + Show/Hide - + New Version - + Congratulations on updating to Cockatrice %1! Oracle will now launch to update your card database. - + Cockatrice installed - + Congratulations on installing Cockatrice %1! Oracle will now launch to install the initial card database. - + Card database - + Cockatrice is unable to load the card database. Do you want to update your card database now? If unsure or first time user, choose "Yes" - - + + Yes - - + + No - + Open settings - + New sets found - + %n new set(s) found in the card database Set code(s): %1 Do you want to enable it/them? @@ -4832,81 +4881,81 @@ Do you want to enable it/them? - + View sets - + Welcome - + Hi! It seems like you're running this version of Cockatrice for the first time. All the sets in the card database have been enabled. Read more about changing the set order or disabling specific sets and consequent effects in the "Manage Sets" dialog. - - + + Information - + A card database update is already running. - + Unable to run the card database updater: - + Card database update running. - + Failed to start. The file might be missing, or permissions might be incorrect. - + The process crashed some time after starting successfully. - + Timed out. The process took too long to respond. The last waitFor...() function timed out. - + An error occurred when attempting to write to the process. For example, the process may not be running, or it may have closed its input channel. - + An error occurred when attempting to read from the process. For example, the process may not be running. - + Unknown error occurred. - + The card database updater exited with an error: %1 - + This server supports additional features that your client doesn't have. This is most likely not a problem, but this message might mean there is a new version of Cockatrice available or this server is running a custom or pre-release version. @@ -4914,54 +4963,54 @@ To update your client, go to Help -> Check for Updates. - - - - - + + + + + Load sets/cards - + Selected file cannot be found. - + You can only import XML databases at this time. - + The new sets/cards have been added successfully. Cockatrice will now reload the card database. - + Sets/cards failed to import. - - - + + + Reset Password - + Your password has been reset successfully, you can now log in using the new credentials. - + Failed to reset user account password, please contact the server operator to reset your password. - + Activation request received, please check your email for an activation token. @@ -4969,8 +5018,8 @@ Cockatrice will now reload the card database. ManaBaseWidget - - + + Mana Base @@ -4978,8 +5027,8 @@ Cockatrice will now reload the card database. ManaCurveWidget - - + + Mana Curve @@ -4987,8 +5036,8 @@ Cockatrice will now reload the card database. ManaDevotionWidget - - + + Mana Devotion @@ -4996,277 +5045,277 @@ Cockatrice will now reload the card database. MessageLogWidget - + from play - + from their graveyard - + from exile - + from their hand - + the top card of %1's library - + the top card of their library - + from the top of %1's library - + from the top of their library - + the bottom card of %1's library - + the bottom card of their library - + from the bottom of %1's library - + from the bottom of their library - + from %1's library - + from their library - + from sideboard - + from the stack - + from custom zone '%1' - + %1 is now keeping the top card %2 revealed. - + %1 is not revealing the top card %2 any longer. - + %1 can now look at top card %2 at any time. - + %1 no longer can look at top card %2 at any time. - + %1 attaches %2 to %3's %4. - + %1 has conceded the game. - + %1 has unconceded the game. - + %1 has restored connection to the game. - + %1 has lost connection to the game. - + %1 points from their %2 to themselves. - + %1 points from their %2 to %3. - + %1 points from %2's %3 to themselves. - + %1 points from %2's %3 to %4. - + %1 points from their %2 to their %3. - + %1 points from their %2 to %3's %4. - + %1 points from %2's %3 to their own %4. - + %1 points from %2's %3 to %4's %5. - + %1 creates a face down token. - + %1 creates token: %2%3. - + %1 has loaded a deck (%2). - + %1 has loaded a deck with %2 sideboard cards (%3). - + %1 destroys %2. - + a card - + %1 gives %2 control over %3. - + %1 puts %2 into play%3 face down. - + %1 puts %2 into play%3. - + %1 puts %2%3 into their graveyard. - + %1 exiles %2%3. - + %1 moves %2%3 to their hand. - + %1 puts %2%3 into their library. - + %1 puts %2%3 onto the bottom of their library. - + %1 puts %2%3 on top of their library. - + %1 puts %2%3 into their library %4 cards from the top. - + %1 moves %2%3 to sideboard. - + %1 plays %2%3. - + %1 moves %2%3 to custom zone '%4'. - + %1 tries to draw from an empty library - + %1 draws %2 card(s). @@ -5274,14 +5323,13 @@ Cockatrice will now reload the card database. - + %1 is looking at %2. - + %1 is looking at the %4 %3 card(s) %2. - %1 is looking at the top %3 card(s) %2. top card for singular, top %3 cards for plural @@ -5289,72 +5337,72 @@ Cockatrice will now reload the card database. - + bottom - + top - + %1 turns %2 face-down. - + %1 turns %2 face-up. - + The game has been closed. - + The game has started. - + You are flooding the game. Please wait a couple of seconds. - + %1 has joined the game. - + %1 is now watching the game. - + You have been kicked out of the game. - + %1 has left the game (%2). - + %1 is not watching the game any more (%2). - + %1 is not ready to start the game any more. - + %1 shuffles their deck and draws a new hand of %2 card(s). @@ -5362,28 +5410,28 @@ Cockatrice will now reload the card database. - + %1 shuffles their deck and draws a new hand. - + You are watching a replay of game #%1. - + %1 is ready to start the game. - + cards an unknown amount of cards - + %1 card(s) a card for singular, %1 cards for plural @@ -5392,107 +5440,107 @@ Cockatrice will now reload the card database. - + %1 lends %2 to %3. - + %1 reveals %2 to %3. - + %1 reveals %2. - + %1 randomly reveals %2%3 to %4. - + %1 randomly reveals %2%3. - + %1 peeks at face down card #%2. - + %1 peeks at face down card #%2: %3. - + %1 reveals %2%3 to %4. - + %1 reveals %2%3. - + %1 reversed turn order, now it's %2. - + reversed - + normal - + Heads - + Tails - + %1 flipped a coin. It landed as %2. - + %1 rolls a %2 with a %3-sided die. - + %1 flips %2 coins. There are %3 heads and %4 tails. - + %1 rolls a %2-sided dice %3 times: %4. - + %1's turn. - + %1 sets annotation of %2 to %3. - + %1 places %2 "%3" counter(s) on %4 (now %5). @@ -5500,7 +5548,7 @@ Cockatrice will now reload the card database. - + %1 removes %2 "%3" counter(s) from %4 (now %5). @@ -5508,97 +5556,97 @@ Cockatrice will now reload the card database. - + %1 sets counter %2 to %3 (%4%5). - + %1 sets %2 to not untap normally. - + %1 sets %2 to untap normally. - + %1 removes the PT of %2. - + %1 changes the PT of %2 from nothing to %4. - + %1 changes the PT of %2 from %3 to %4. - + %1 has locked their sideboard. - + %1 has unlocked their sideboard. - + %1 taps their permanents. - + %1 untaps their permanents. - + %1 taps %2. - + %1 untaps %2. - + %1 shuffles %2. - + %1 shuffles the bottom %3 cards of %2. - + %1 shuffles the top %3 cards of %2. - + %1 shuffles cards %3 - %4 of %2. - + %1 unattaches %2. - + %1 undoes their last draw. - + %1 undoes their last draw (%2). @@ -5606,110 +5654,110 @@ Cockatrice will now reload the card database. MessagesSettingsPage - + Word1 Word2 Word3 - + Add New Message - + Edit Message - + Remove Message - + Add message - - + + Message: - + Edit message - + Chat settings - + Custom alert words - + Enable chat mentions - + Enable mention completer - + In-game message macros - + How to use in-game message macros - + Ignore chat room messages sent by unregistered users - + Ignore private messages sent by unregistered users - - + + Invert text color - + Enable desktop notifications for private messages - + Enable desktop notification for mentions - + Enable room message history on join - - + + (Color is hexadecimal) - + Separate words with a space, alphanumeric characters only @@ -5755,52 +5803,52 @@ Cockatrice will now reload the card database. Mtg - + Card Type - + Mana Value - + Color(s) - + Loyalty - + Main Card Type - + Mana Cost - + P/T - + Side - + Layout - + Color Identity @@ -5808,17 +5856,17 @@ Cockatrice will now reload the card database. OverlapControlWidget - + Cards to overlap: - + Overlap percentage: - + Overlap direction: @@ -5889,57 +5937,57 @@ Cockatrice will now reload the card database. PhasesToolbar - + Untap step - + Upkeep step - + Draw step - + First main phase - + Beginning of combat step - + Declare attackers step - + Declare blockers step - + Combat damage step - + End of combat step - + Second main phase - + End of turn step @@ -5947,7 +5995,7 @@ Cockatrice will now reload the card database. PictureLoader - + en code for scryfall's language property, not available for all languages @@ -5956,134 +6004,134 @@ Cockatrice will now reload the card database. PlayerActions - + View top cards of library - - - - - - - - - - - + + + + + + + + + + + Number of cards: (max. %1) - + View bottom cards of library - + Shuffle top cards of library - + Shuffle bottom cards of library - + Draw hand - + 0 and lower are in comparison to current hand size - + Draw cards - + Move top cards to grave - + Move top cards to exile - + Move bottom cards to grave - + Move bottom cards to exile - + Draw bottom cards - - + + C&reate another %1 token - + Create tokens - - + + Number: - + Place card X cards from top of library - + Which position should this card be placed: - + (max. %1) - + Change power/toughness - + Change stats to: - + Set annotation - + Please enter the new annotation: - + Set counters @@ -6091,32 +6139,17 @@ Cockatrice will now reload the card database. PlayerMenu - - Reveal top cards of library - - - - - Number of cards: (max. %1) - - - - + Player "%1" - + &Counters - - &All players - - - - + S&ay @@ -6124,7 +6157,7 @@ Cockatrice will now reload the card database. PrintingSelector - + Display Navigation Buttons @@ -6132,22 +6165,22 @@ Cockatrice will now reload the card database. PrintingSelectorCardOverlayWidget - + Preference - + Pin Printing - + Unpin Printing - + Show Related cards @@ -6155,7 +6188,7 @@ Cockatrice will now reload the card database. PrintingSelectorCardSearchWidget - + Search by set name or set code @@ -6163,17 +6196,17 @@ Cockatrice will now reload the card database. PrintingSelectorCardSelectionWidget - + Previous Card in Deck - + Bulk Selection - + Next Card in Deck @@ -6181,28 +6214,28 @@ Cockatrice will now reload the card database. PrintingSelectorCardSortingWidget - + Alphabetical - + Preference - + Release Date - - + + Descending - + Ascending @@ -6268,37 +6301,37 @@ Cockatrice will now reload the card database. QMenuBar - + Services - + Hide %1 - + Hide Others - + Show All - + Preferences... - + Quit %1 - + About %1 @@ -6306,42 +6339,42 @@ Cockatrice will now reload the card database. QObject - + Cockatrice card database (*.xml) - + All files (*.*) - + Cockatrice replays (*.cor) - + Maindeck - + Sideboard - + Tokens - + Overwrite Existing File? - + A .cod version of this deck already exists. Overwrite it? @@ -6349,92 +6382,92 @@ Cockatrice will now reload the card database. QPlatformTheme - + OK - + Save - + Save All - + Open - + &Yes - + Yes to &All - + &No - + N&o to All - + Abort - + Retry - + Ignore - + Close - + Cancel - + Discard - + Help - + Apply - + Reset - + Restore Defaults @@ -6442,17 +6475,17 @@ Cockatrice will now reload the card database. RemoteDeckList_TreeModel - + Name - + ID - + Upload time @@ -6460,32 +6493,32 @@ Cockatrice will now reload the card database. RemoteReplayList_TreeModel - + ID - + Name - + Players - + Keep - + Time started - + Duration (sec) @@ -6531,37 +6564,37 @@ Cockatrice will now reload the card database. RoomSelector - + Rooms - + Joi&n - + Room - + Description - + Permissions - + Players - + Games @@ -6569,32 +6602,32 @@ Cockatrice will now reload the card database. SequenceEdit - + Choose an action from the table - + Hit the key/combination of keys you want to set for this action - + Invalid key - + Shortcut already in use by: - + Clear - + Restore default @@ -6630,53 +6663,53 @@ Cockatrice will now reload the card database. ShortcutSettingsPage - - + + Restore all default shortcuts - + Do you really want to restore all default shortcuts? - + Clear all default shortcuts - + Do you really want to clear all shortcuts? - + Section: - + Action: - + Shortcut: - + How to set custom shortcuts - + Clear all shortcuts - + Search by shortcut name @@ -6684,12 +6717,12 @@ Cockatrice will now reload the card database. ShortcutTreeView - + Action - + Shortcut @@ -6697,13 +6730,13 @@ Cockatrice will now reload the card database. ShortcutsSettings - + Your configuration file contained invalid shortcuts. Please check your shortcut settings! - + The following shortcuts have been set to default: @@ -6712,17 +6745,17 @@ Please check your shortcut settings! ShutdownDialog - + &Reason for shutdown: - + &Time until shutdown (minutes): - + Shut down server @@ -6743,27 +6776,27 @@ Please check your shortcut settings! SoundSettingsPage - + Enable &sounds - + Current sounds theme: - + Test system sound engine - + Sound settings - + Master volume @@ -6848,17 +6881,17 @@ Please check your shortcut settings! TabAccount - + Add to Buddy List - + Add to Ignore List - + Account @@ -6866,112 +6899,112 @@ Please check your shortcut settings! TabAdmin - + Administration - + Update server &message - + &Shut down server - + &Reload configuration - + Server administration functions - + Server moderator functions - + Replay ID - + Grant Replay Access - + Username to Activate - + Force Activate User - + &Unlock functions - + &Lock functions - - + + Success - + Replay access granted - - - - - + + + + + Error - + Unable to grant replay access. Replay ID invalid - + Unable to grant replay access. Internal error - + User successfully activated - + Unable to activate user. Username invalid - + Unable to activate user. User already active - + Unable to activate user. Internal error @@ -6979,53 +7012,53 @@ Please check your shortcut settings! TabDeckEditor - + Card Info - + Deck - + Filters - + &View - + Printing - - - - + + + + Visible - - - - + + + + Floating - + Reset layout - + Deck: %1 @@ -7033,61 +7066,61 @@ Please check your shortcut settings! TabDeckEditorVisual - + Visual Deck: %1 - + &Visual Deck Editor - - + + Card Info - - + + Deck - - + + Filters - + &View - + Printing - - - - + + + + Visible - - - - + + + + Floating - + Reset layout @@ -7095,22 +7128,22 @@ Please check your shortcut settings! TabDeckEditorVisualTabWidget - + Visual Deck View - + Visual Database Display - + Deck Analytics - + Sample Hand @@ -7118,138 +7151,138 @@ Please check your shortcut settings! TabDeckStorage - + Local file system - + Server deck storage - - + + Open in deck editor - + Rename deck or folder - + Upload deck - + Download deck - - - - + + + + New folder - - + + Delete - + Open decks folder - + Rename local folder - + Rename local file - + New name: - - - - + + + + Error - + Rename failed - - + + Invalid deck file - + Enter deck name - + This decklist does not have a name. Please enter a name: - + Unnamed deck - + Failed to upload deck to server - + Delete local file - + Are you sure you want to delete the selected files? - + Delete remote decks - + Are you sure you want to delete the selected decks? - - + + Name of new folder: - + Deck Storage @@ -7257,17 +7290,17 @@ Please enter a name: TabDeckStorageVisual - + Visual Deck Storage - + Error - + Could not open deck at %1 @@ -7275,7 +7308,7 @@ Please enter a name: TabEdhRec - + EDHREC: @@ -7283,229 +7316,230 @@ Please enter a name: TabEdhRecMain - + &Cards - + Top Commanders - + Tags - + Search for a card ... - + Search - + EDHRec: - EDHREC: TabGame - - - + + + Replay - - + + Game - - + + Player List - - + + Card Info - - + + Messages - - + + Replay Timeline - + &Phases - + &Game - + Next &phase - + Next phase with &action - + Next &turn - + Reverse turn order - + &Remove all local arrows - + Rotate View Cl&ockwise - + Rotate View Co&unterclockwise - + Game &information - + Un&concede - + + + &Concede - + &Leave game - + C&lose replay - + &Focus Chat - + &Say: - + Selected cards - + &View - - - - + + + + Visible - - - - + + + + Floating - + Reset layout - + Concede - + Are you sure you want to concede this game? - + Unconcede - + You have already conceded. Do you want to return to this game? - + Leave game - + Are you sure you want to leave this game? - + A player has joined game #%1 - + %1 has joined the game - + You have been kicked out of the game. @@ -7513,7 +7547,7 @@ Please enter a name: TabHome - + Home @@ -7521,157 +7555,157 @@ Please enter a name: TabLog - + Logs - - - + + + Time;SenderName;SenderIP;Message;TargetID;TargetName - + Room Logs - + Game Logs - + Chat Logs - - + + Error - + You must select at least one filter. - + You have to select a valid number of days to locate. - + Username: - + IP Address: - + Game Name: - + GameID: - + Message: - + Main Room - + Game Room - + Private Chat - + Past X Days: - + Today - + Last Hour - + Maximum Results: - + At least one filter is required. The more information you put in, the more specific your results will be. - + Get User Logs - + Clear Filters - + Filters - + Log Locations - + Date Range - + Maximum Results - - + + Message History - + Failed to collect message history information. - + There are no messages for the selected filters. @@ -7679,37 +7713,37 @@ The more information you put in, the more specific your results will be. TabMessage - + Private &chat - + &Leave - + %1 - Private chat - + This user is ignoring you, they cannot see your messages in main chat and you cannot join their games. - + Private message from - + %1 has left the server. - + %1 has joined the server. @@ -7717,185 +7751,185 @@ The more information you put in, the more specific your results will be. TabReplays - + Local file system - + Server replay storage - - + + Watch replay - + Rename - - + + New folder - - + + Delete - + Open replays folder - + Download replay - + Toggle expiration lock - + Get replay share code - - + + Look up replay by share code - + Rename local folder - + Rename local file - + New name: - + Error - + Rename failed - + Name of new folder: - + Delete local file - + Are you sure you want to delete the selected files? - + Are you sure you want to delete the selected replays? - + Failed to get code - - + + Either this server does not support replay sharing, or does not permit replay sharing for you. - - - + + + Failed - + Could not get replay code - + Replay Share Code - + Others can use this code to add the replay to their list of remote replays: %1 - + Copy to clipboard - + Replay share code - + Replay code found - + Replay was added, or you already had access to it. - + Replay code not found - + Failed to submit code - + Unexpected error - + Delete remote replay - + Game Replays @@ -7903,47 +7937,47 @@ The more information you put in, the more specific your results will be. TabRoom - + &Say: - + Chat - + &Room - + &Leave room - + &Clear chat - + Chat Settings... - + mentioned you. - + Click to view - + You are flooding the chat. Please wait a couple of seconds. @@ -7951,35 +7985,35 @@ The more information you put in, the more specific your results will be. TabServer - + Server - - - - + + + + Error - + Failed to join the server room: it doesn't exist on the server. - + The server thinks you are in the server room but your client is unable to display it. Try restarting your client. - + You do not have the required permission to join this server room. - + Failed to join the server room due to an unknown error: %1. @@ -7987,92 +8021,92 @@ The more information you put in, the more specific your results will be. TabSupervisor - + Deck Editor - + Visual Deck Editor - + EDHRec - + Home - + &Visual Deck Storage - + Visual Database Display - + Server - + Account - + Deck Storage - + Game Replays - + Administration - + Logs - + Are you sure? - + There are still open games. Are you sure you want to quit? - + Click to view - + Your buddy %1 has signed on! - + Unknown Event - + The server has sent you a message that your client does not understand. This message might mean there is a new version of Cockatrice available or this server is running a custom or pre-release version. @@ -8080,38 +8114,38 @@ To update your client, go to Help -> Check for Updates. - + Idle Timeout - + You are about to be logged out due to inactivity. - + Promotion - + You have been promoted. Please log out and back in for changes to take effect. - + Warned - + You have received a warning due to %1. Please refrain from engaging in this activity or further actions may be taken against you. If you have any questions, please private message a moderator. - + You have received the following message from the server. (custom messages like these could be untranslated) @@ -8120,7 +8154,7 @@ Please refrain from engaging in this activity or further actions may be taken ag TabVisualDatabaseDisplay - + Visual Database Display @@ -8128,13 +8162,13 @@ Please refrain from engaging in this activity or further actions may be taken ag TappedOutInterface - - + + Error - + Unable to analyze the deck. @@ -8142,13 +8176,13 @@ Please refrain from engaging in this activity or further actions may be taken ag TipsOfTheDay - + File does not exist. - + Failed to open file. @@ -8157,42 +8191,42 @@ Please refrain from engaging in this activity or further actions may be taken ag TranslateCounterName - + Life - + White - + Blue - + Black - + Red - + Green - + Colorless - + Other @@ -8595,137 +8629,137 @@ Please refrain from engaging in this activity or further actions may be taken ag UserInterfaceSettingsPage - + General interface settings - + &Double-click cards to play them (instead of single-click) - + &Clicking plays all selected cards (instead of just the clicked card) - + &Play all nonlands onto the stack (not the battlefield) by default - + Close card view window when last card is removed - + Auto focus search bar when card view window is opened - + Annotate card text on tokens - + Use tear-off menus, allowing right click menus to persist on screen - + Notifications settings - + Enable notifications in taskbar - + Notify in the taskbar for game events while you are spectating - + Notify in the taskbar when users in your buddy list connect - + Animation settings - + &Tap/untap animation - + Deck editor/storage settings - + Open deck in new tab by default - + Use visual deck storage in game lobby - + Use selection animation for Visual Deck Storage - + When adding a tag in the visual deck storage to a .txt deck: - + do nothing - + ask to convert to .cod - + always convert to .cod - + Default deck editor type - + Classic Deck Editor - + Visual Deck Editor - + Replay settings - + Buffer time for backwards skip via shortcut: @@ -8789,22 +8823,22 @@ Please refrain from engaging in this activity or further actions may be taken ag VisualDatabaseDisplayColorFilterWidget - + Mode: Exact Match - + Mode: Includes - + Mode: Include/Exclude - + Filter mode (AND/OR/NOT conjunctions of filters) @@ -8812,17 +8846,17 @@ Please refrain from engaging in this activity or further actions may be taken ag VisualDatabaseDisplayFilterSaveLoadWidget - + Save Filter - + Save all currently applied filters to a file - + Enter filename... @@ -8830,22 +8864,22 @@ Please refrain from engaging in this activity or further actions may be taken ag VisualDatabaseDisplayMainTypeFilterWidget - + Do not display card main-types with less than this amount of cards in the database - + Filter mode (AND/OR/NOT conjunctions of filters) - + Mode: Exact Match - + Mode: Includes @@ -8853,27 +8887,27 @@ Please refrain from engaging in this activity or further actions may be taken ag VisualDatabaseDisplayNameFilterWidget - + Filter by name... - + Load from Deck - + Apply all card names in currently loaded deck as exact match name filters - + Load from Clipboard - + Apply all card names in clipboard as exact match name filters @@ -8881,7 +8915,7 @@ Please refrain from engaging in this activity or further actions may be taken ag VisualDatabaseDisplayRecentSetFilterSettingsWidget - + Filter to most recent sets @@ -8889,19 +8923,19 @@ Please refrain from engaging in this activity or further actions may be taken ag VisualDatabaseDisplaySetFilterWidget - + Search sets... - - + + Mode: Exact Match - - + + Mode: Includes @@ -8909,27 +8943,27 @@ Please refrain from engaging in this activity or further actions may be taken ag VisualDatabaseDisplaySubTypeFilterWidget - + Search subtypes... - + Do not display card sub-types with less than this amount of cards in the database - + Filter mode (AND/OR/NOT conjunctions of filters) - + Mode: Exact Match - + Mode: Includes @@ -8937,37 +8971,37 @@ Please refrain from engaging in this activity or further actions may be taken ag VisualDatabaseDisplayWidget - + Search by card name (or search expressions) - + Loading database ... - + Clear all filters - + Save and load filters - + Filter by exact card name - + Filter by card sub-type - + Filter by set @@ -8975,12 +9009,12 @@ Please refrain from engaging in this activity or further actions may be taken ag VisualDeckEditorSampleHandWidget - + Draw a new sample hand - + Sample hand size @@ -8988,38 +9022,38 @@ Please refrain from engaging in this activity or further actions may be taken ag VisualDeckEditorWidget - + Click and drag to change the sort order within the groups - + Quick search and add card - + Search for closest match in the database (with auto-suggestions) and add preferred printing to the deck on pressing enter - + Configure how cards are sorted within their groups - - + + Overlap Layout - + Change how cards are displayed within zones (i.e. overlapped or fully visible.) - + Flat Layout @@ -9027,7 +9061,7 @@ Please refrain from engaging in this activity or further actions may be taken ag VisualDeckStorageFolderDisplayWidget - + Deck Storage @@ -9035,47 +9069,47 @@ Please refrain from engaging in this activity or further actions may be taken ag VisualDeckStorageQuickSettingsWidget - + Show Folders - + Show Tag Filter - + Show Tags On Deck Previews - + Show Banner Card Selection Option - + Draw unused Color Identities - + Unused Color Identities Opacity - + Deck tooltip: - + None - + Filepath @@ -9083,7 +9117,7 @@ Please refrain from engaging in this activity or further actions may be taken ag VisualDeckStorageSearchWidget - + Search by filename (or search expression) @@ -9091,22 +9125,22 @@ Please refrain from engaging in this activity or further actions may be taken ag VisualDeckStorageSortWidget - + Sort Alphabetically (Deck Name) - + Sort Alphabetically (Filename) - + Sort by Last Modified - + Sort by Last Loaded @@ -9114,17 +9148,17 @@ Please refrain from engaging in this activity or further actions may be taken ag VisualDeckStorageWidget - + Loading database ... - + Refresh loaded files - + Visual Deck Storage Settings @@ -9383,7 +9417,7 @@ Please refrain from engaging in this activity or further actions may be taken ag i18n - + English @@ -9404,1006 +9438,1005 @@ Please refrain from engaging in this activity or further actions may be taken ag shortcutsTab - + Main Window - - + + Deck Editor - + Game Lobby - + Card Counters - + Player Counters - + Power and Toughness - + Game Phases - + Playing Area - + Move Selected Card - + View - + Move Top Card - + Move Bottom Card - + Gameplay - + Drawing - + Chat Room - + Game Window - + Load Deck from Clipboard - - + + Replays - + Tabs - + Check for Card Updates... - + Connect... - + Disconnect - + Exit - + Full screen - + Register... - + Settings... - + Start a Local Game... - + Watch Replay... - + Analyze Deck (deckstats.net) - Analyze Deck - + Analyze Deck (tappedout.net) - + Clear All Filters - + Clear Selected Filter - + Close - + Remove Card - + Manage Sets... - + Edit Custom Tokens... - + Export Deck (decklist.org) - + Export Deck (decklist.xyz) - + Add Card - + Load Deck... - - + + Load Deck from Clipboard... - + Edit Deck in Clipboard, Annotated - + Edit Deck in Clipboard - + New Deck - + Open Custom Pictures Folder - + Print Deck... - + Delete Card - - + + Reset Layout - + Save Deck - + Save Deck as... - + Save Deck to Clipboard, Annotated - + Save Deck to Clipboard, Annotated (No Set Info) - + Save Deck to Clipboard - + Save Deck to Clipboard (No Set Info) - + Load Local Deck... - + Load Remote Deck... - + Set Ready to Start - + Toggle Sideboard Lock - + Add Green Counter - + Remove Green Counter - + Set Green Counters... - + Add Red Counter - + Remove Red Counter - + Set Red Counters... - + Add Life Counter - + Show Status Bar - + Unload Deck - + Force Start - + Add Card Counter (F) - + Remove Card Counter (F) - + Set Card Counters (F)... - + Add Card Counter (E) - + Remove Card Counter (E) - + Set Card Counters (E)... - + Add Card Counter(D) - + Remove Card Counter (D) - + Set Card Counters (D)... - + Add Card Counter (C) - + Remove Card Counter (C) - + Set Card Counters (C)... - + Add Card Counter (B) - + Remove Card Counter (B) - + Set Card Counters (B)... - + Add Card Counter (A) - + Remove Card Counter (A) - + Set Card Counters (A)... - + Remove Life Counter - + Set Life Counters... - + Add White Counter - + Remove White Counter - + Set White Counters... - + Add Blue Counter - + Remove Blue Counter - + Set Blue Counters... - + Add Black Counter - + Remove Black Counter - + Set Black Counters... - + Add Colorless Counter - + Remove Colorless Counter - + Set Colorless Counters... - + Add Other Counter - + Remove Other Counter - + Set Other Counters... - + Increment all card counters - + Add Power (+1/+0) - + Remove Power (-1/-0) - + Move Toughness to Power (+1/-1) - + Add Toughness (+0/+1) - + Remove Toughness (-0/-1) - + Move Power to Toughness (-1/+1) - + Add Power and Toughness (+1/+1) - + Remove Power and Toughness (-1/-1) - + Set Power and Toughness... - + Reset Power and Toughness - + Untap - + Upkeep - + Draw - + First Main Phase - + Start Combat - + Attack - + Block - + Damage - + End Combat - + Second Main Phase - + End - + Next Phase - + Next Phase Action - + Next Turn - + Hide Card in Reveal Window - + Tap / Untap Card - + Untap All - + Toggle Untap - + Turn Card Over - + Peek Card - + Play Card - + Attach Card... - + Unattach Card - + Clone Card - + Create Token... - + Create All Related Tokens - + Create Another Token - + Set Annotation... - + Select All Cards in Zone - + Select All Cards in Row - + Select All Cards in Column - - + + Bottom of Library - - - - + + + + Exile - - - - + + + + Graveyard - - + + Hand - - + + Top of Library - - - + + + Battlefield, Face Down - + Battlefield - + Sort Hand - + Library - + Sideboard - + Top Cards of Library - + Bottom Cards of Library - + Close Recent View - - + + Stack - - + + Graveyard (Multiple) - - + + Exile (Multiple) - + Stack Until Found - + Draw Bottom Card - + Draw Multiple Cards from Bottom... - + Draw Arrow... - + Remove Local Arrows - + Leave Game - + Concede - + Roll Dice... - + Shuffle Library - + Shuffle Top Cards of Library - + Shuffle Bottom Cards of Library - + Mulligan - + Draw a Card - + Draw Multiple Cards... - + Undo Draw - + Always Reveal Top Card - + Always Look At Top Card - + Rotate View Clockwise - + Rotate View Counterclockwise - + Unfocus Text Box - + Focus Chat - + Clear Chat - + Refresh - + Skip Forward - + Skip Backward - + Skip Forward by a lot - + Skip Backward by a lot - + Play/Pause - + Toggle Fast Forward - + Home - + Visual Deck Storage - + Deck Storage - + Server - + Account - + Administration - + Logs diff --git a/cockatrice/src/client/deck_editor_menu.cpp b/cockatrice/src/client/deck_editor_menu.cpp index b3c46d003..bc6337b56 100644 --- a/cockatrice/src/client/deck_editor_menu.cpp +++ b/cockatrice/src/client/deck_editor_menu.cpp @@ -1,7 +1,7 @@ #include "deck_editor_menu.h" -#include "../settings/cache_settings.h" -#include "../settings/shortcuts_settings.h" +#include +#include DeckEditorMenu::DeckEditorMenu(AbstractTabDeckEditor *parent) : QMenu(parent), deckEditor(parent) { diff --git a/cockatrice/src/client/get_text_with_max.h b/cockatrice/src/client/get_text_with_max.h index 2e633d494..894eb80f2 100644 --- a/cockatrice/src/client/get_text_with_max.h +++ b/cockatrice/src/client/get_text_with_max.h @@ -7,9 +7,8 @@ #ifndef GETTEXTWITHMAX_H #define GETTEXTWITHMAX_H -#include "trice_limits.h" - #include +#include QString getTextWithMax(QWidget *parent, const QString &title, diff --git a/cockatrice/src/client/network/client_update_checker.cpp b/cockatrice/src/client/network/client_update_checker.cpp index 23c52d08d..f965ff6dc 100644 --- a/cockatrice/src/client/network/client_update_checker.cpp +++ b/cockatrice/src/client/network/client_update_checker.cpp @@ -1,8 +1,9 @@ #include "client_update_checker.h" -#include "../../settings/cache_settings.h" #include "release_channel.h" +#include + ClientUpdateChecker::ClientUpdateChecker(QObject *parent) : QObject(parent) { } diff --git a/cockatrice/src/client/network/replay_timeline_widget.cpp b/cockatrice/src/client/network/replay_timeline_widget.cpp index 1f258bf68..2b9ab72e9 100644 --- a/cockatrice/src/client/network/replay_timeline_widget.cpp +++ b/cockatrice/src/client/network/replay_timeline_widget.cpp @@ -1,11 +1,10 @@ #include "replay_timeline_widget.h" -#include "../../settings/cache_settings.h" - #include #include #include #include +#include ReplayTimelineWidget::ReplayTimelineWidget(QWidget *parent) : QWidget(parent), maxBinValue(1), maxTime(1), timeScaleFactor(1.0), currentVisualTime(0), currentProcessedTime(0), diff --git a/cockatrice/src/client/network/sets_model.h b/cockatrice/src/client/network/sets_model.h index d341440d7..b024ccd49 100644 --- a/cockatrice/src/client/network/sets_model.h +++ b/cockatrice/src/client/network/sets_model.h @@ -7,12 +7,11 @@ #ifndef SETSMODEL_H #define SETSMODEL_H -#include "../../database/card_database.h" - #include #include #include #include +#include class SetsProxyModel; diff --git a/cockatrice/src/client/network/spoiler_background_updater.cpp b/cockatrice/src/client/network/spoiler_background_updater.cpp index 68fdc4c4c..3a35620bb 100644 --- a/cockatrice/src/client/network/spoiler_background_updater.cpp +++ b/cockatrice/src/client/network/spoiler_background_updater.cpp @@ -1,10 +1,7 @@ #include "spoiler_background_updater.h" -#include "../../database/card_database.h" -#include "../../database/card_database_manager.h" #include "../../interface/window_main.h" #include "../../main.h" -#include "../../settings/cache_settings.h" #include #include @@ -16,6 +13,9 @@ #include #include #include +#include +#include +#include #define SPOILERS_STATUS_URL "https://raw.githubusercontent.com/Cockatrice/Magic-Spoiler/files/SpoilerSeasonEnabled" #define SPOILERS_URL "https://raw.githubusercontent.com/Cockatrice/Magic-Spoiler/files/spoiler.xml" diff --git a/cockatrice/src/client/replay_manager.h b/cockatrice/src/client/replay_manager.h index 55a64768c..8b9ed4e1f 100644 --- a/cockatrice/src/client/replay_manager.h +++ b/cockatrice/src/client/replay_manager.h @@ -9,10 +9,10 @@ #define REPLAY_MANAGER_H #include "network/replay_timeline_widget.h" -#include "pb/game_replay.pb.h" #include #include +#include class TabGame; diff --git a/cockatrice/src/client/sound_engine.cpp b/cockatrice/src/client/sound_engine.cpp index fef2df093..05f2d12d8 100644 --- a/cockatrice/src/client/sound_engine.cpp +++ b/cockatrice/src/client/sound_engine.cpp @@ -1,9 +1,8 @@ #include "sound_engine.h" -#include "../settings/cache_settings.h" - #include #include +#include #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) #include diff --git a/cockatrice/src/client/tapped_out_interface.cpp b/cockatrice/src/client/tapped_out_interface.cpp index 43ceb6cdd..d18d811b0 100644 --- a/cockatrice/src/client/tapped_out_interface.cpp +++ b/cockatrice/src/client/tapped_out_interface.cpp @@ -1,8 +1,5 @@ #include "tapped_out_interface.h" -#include "deck_list.h" -#include "deck_list_card_node.h" - #include #include #include @@ -10,6 +7,8 @@ #include #include #include +#include +#include TappedOutInterface::TappedOutInterface(CardDatabase &_cardDatabase, QObject *parent) : QObject(parent), cardDatabase(_cardDatabase) diff --git a/cockatrice/src/client/tapped_out_interface.h b/cockatrice/src/client/tapped_out_interface.h index 43e5cdea3..449bdc5bb 100644 --- a/cockatrice/src/client/tapped_out_interface.h +++ b/cockatrice/src/client/tapped_out_interface.h @@ -7,11 +7,10 @@ #ifndef TAPPEDOUT_INTERFACE_H #define TAPPEDOUT_INTERFACE_H -#include "../database/card_database.h" -#include "deck_list.h" - #include #include +#include +#include inline Q_LOGGING_CATEGORY(TappedOutInterfaceLog, "tapped_out_interface"); diff --git a/cockatrice/src/deck/custom_line_edit.cpp b/cockatrice/src/deck/custom_line_edit.cpp index ba521c0fd..532afc114 100644 --- a/cockatrice/src/deck/custom_line_edit.cpp +++ b/cockatrice/src/deck/custom_line_edit.cpp @@ -1,13 +1,12 @@ #include "custom_line_edit.h" -#include "../settings/cache_settings.h" -#include "../settings/shortcuts_settings.h" - #include #include #include #include #include +#include +#include LineEditUnfocusable::LineEditUnfocusable(QWidget *parent) : QLineEdit(parent) { diff --git a/cockatrice/src/deck/deck_list_model.cpp b/cockatrice/src/deck/deck_list_model.cpp index 4ff16378c..93179d79c 100644 --- a/cockatrice/src/deck/deck_list_model.cpp +++ b/cockatrice/src/deck/deck_list_model.cpp @@ -1,8 +1,6 @@ #include "deck_list_model.h" -#include "../database/card_database_manager.h" #include "../main.h" -#include "../settings/cache_settings.h" #include "deck_loader.h" #include @@ -13,6 +11,8 @@ #include #include #include +#include +#include DeckListModel::DeckListModel(QObject *parent) : QAbstractItemModel(parent), lastKnownColumn(1), lastKnownOrder(Qt::AscendingOrder) diff --git a/cockatrice/src/deck/deck_list_model.h b/cockatrice/src/deck/deck_list_model.h index 28d95a632..a3e448de4 100644 --- a/cockatrice/src/deck/deck_list_model.h +++ b/cockatrice/src/deck/deck_list_model.h @@ -1,13 +1,12 @@ #ifndef DECKLISTMODEL_H #define DECKLISTMODEL_H -#include "../card/exact_card.h" -#include "abstract_deck_list_card_node.h" -#include "deck_list.h" -#include "deck_list_card_node.h" - #include #include +#include +#include +#include +#include class DeckLoader; class CardDatabase; diff --git a/cockatrice/src/deck/deck_loader.cpp b/cockatrice/src/deck/deck_loader.cpp index 8e98422a6..ee28ec1a6 100644 --- a/cockatrice/src/deck/deck_loader.cpp +++ b/cockatrice/src/deck/deck_loader.cpp @@ -1,10 +1,6 @@ #include "deck_loader.h" -#include "../database/card_database.h" -#include "../database/card_database_manager.h" #include "../main.h" -#include "deck_list.h" -#include "deck_list_card_node.h" #include #include @@ -16,6 +12,10 @@ #include #include #include +#include +#include +#include +#include const QStringList DeckLoader::ACCEPTED_FILE_EXTENSIONS = {"*.cod", "*.dec", "*.dek", "*.txt", "*.mwDeck"}; diff --git a/cockatrice/src/deck/deck_loader.h b/cockatrice/src/deck/deck_loader.h index 53c4ef434..f11ded444 100644 --- a/cockatrice/src/deck/deck_loader.h +++ b/cockatrice/src/deck/deck_loader.h @@ -7,9 +7,8 @@ #ifndef DECK_LOADER_H #define DECK_LOADER_H -#include "deck_list.h" - #include +#include inline Q_LOGGING_CATEGORY(DeckLoaderLog, "deck_loader") diff --git a/cockatrice/src/deck/deck_stats_interface.cpp b/cockatrice/src/deck/deck_stats_interface.cpp index 96865d9e7..a5cea5358 100644 --- a/cockatrice/src/deck/deck_stats_interface.cpp +++ b/cockatrice/src/deck/deck_stats_interface.cpp @@ -1,8 +1,5 @@ #include "deck_stats_interface.h" -#include "deck_list.h" -#include "deck_list_card_node.h" - #include #include #include @@ -10,6 +7,8 @@ #include #include #include +#include +#include DeckStatsInterface::DeckStatsInterface(CardDatabase &_cardDatabase, QObject *parent) : QObject(parent), cardDatabase(_cardDatabase) diff --git a/cockatrice/src/deck/deck_stats_interface.h b/cockatrice/src/deck/deck_stats_interface.h index 8a76b35fc..890516a58 100644 --- a/cockatrice/src/deck/deck_stats_interface.h +++ b/cockatrice/src/deck/deck_stats_interface.h @@ -7,10 +7,9 @@ #ifndef DECKSTATS_INTERFACE_H #define DECKSTATS_INTERFACE_H -#include "../database/card_database.h" -#include "deck_list.h" - #include +#include +#include class QByteArray; class QNetworkAccessManager; diff --git a/cockatrice/src/dialogs/dlg_connect.cpp b/cockatrice/src/dialogs/dlg_connect.cpp index d8cf11487..3f398218e 100644 --- a/cockatrice/src/dialogs/dlg_connect.cpp +++ b/cockatrice/src/dialogs/dlg_connect.cpp @@ -1,8 +1,5 @@ #include "dlg_connect.h" -#include "../settings/cache_settings.h" -#include "trice_limits.h" - #include #include #include @@ -15,6 +12,8 @@ #include #include #include +#include +#include DlgConnect::DlgConnect(QWidget *parent) : QDialog(parent) { diff --git a/cockatrice/src/dialogs/dlg_connect.h b/cockatrice/src/dialogs/dlg_connect.h index b2afbef4d..fd571fc30 100644 --- a/cockatrice/src/dialogs/dlg_connect.h +++ b/cockatrice/src/dialogs/dlg_connect.h @@ -9,10 +9,10 @@ #include "../server/handle_public_servers.h" #include "../server/user/user_info_connection.h" -#include "../utility/macros.h" #include #include +#include class QCheckBox; class QComboBox; diff --git a/cockatrice/src/dialogs/dlg_create_game.cpp b/cockatrice/src/dialogs/dlg_create_game.cpp index 81b233dcb..a8f07c889 100644 --- a/cockatrice/src/dialogs/dlg_create_game.cpp +++ b/cockatrice/src/dialogs/dlg_create_game.cpp @@ -1,10 +1,6 @@ #include "dlg_create_game.h" -#include "../server/pending_command.h" -#include "../settings/cache_settings.h" #include "../tabs/tab_room.h" -#include "pb/serverinfo_game.pb.h" -#include "trice_limits.h" #include #include @@ -19,6 +15,10 @@ #include #include #include +#include +#include +#include +#include void DlgCreateGame::sharedCtor() { diff --git a/cockatrice/src/dialogs/dlg_create_game.h b/cockatrice/src/dialogs/dlg_create_game.h index ac7592b94..71359a758 100644 --- a/cockatrice/src/dialogs/dlg_create_game.h +++ b/cockatrice/src/dialogs/dlg_create_game.h @@ -7,10 +7,9 @@ #ifndef DLG_CREATEGAME_H #define DLG_CREATEGAME_H -#include "../utility/macros.h" - #include #include +#include class QCheckBox; class QDialogButtonBox; diff --git a/cockatrice/src/dialogs/dlg_default_tags_editor.cpp b/cockatrice/src/dialogs/dlg_default_tags_editor.cpp index fbd737d4a..39b7333c5 100644 --- a/cockatrice/src/dialogs/dlg_default_tags_editor.cpp +++ b/cockatrice/src/dialogs/dlg_default_tags_editor.cpp @@ -1,9 +1,8 @@ #include "dlg_default_tags_editor.h" -#include "../settings/cache_settings.h" - #include #include +#include DlgDefaultTagsEditor::DlgDefaultTagsEditor(QWidget *parent) : QDialog(parent) { diff --git a/cockatrice/src/dialogs/dlg_edit_avatar.cpp b/cockatrice/src/dialogs/dlg_edit_avatar.cpp index 98a41bdfa..28be359a3 100644 --- a/cockatrice/src/dialogs/dlg_edit_avatar.cpp +++ b/cockatrice/src/dialogs/dlg_edit_avatar.cpp @@ -1,7 +1,5 @@ #include "dlg_edit_avatar.h" -#include "trice_limits.h" - #include #include #include @@ -11,6 +9,7 @@ #include #include #include +#include DlgEditAvatar::DlgEditAvatar(QWidget *parent) : QDialog(parent), image() { diff --git a/cockatrice/src/dialogs/dlg_edit_password.cpp b/cockatrice/src/dialogs/dlg_edit_password.cpp index bea94ae08..105783210 100644 --- a/cockatrice/src/dialogs/dlg_edit_password.cpp +++ b/cockatrice/src/dialogs/dlg_edit_password.cpp @@ -1,13 +1,12 @@ #include "dlg_edit_password.h" -#include "../settings/cache_settings.h" -#include "trice_limits.h" - #include #include #include #include #include +#include +#include DlgEditPassword::DlgEditPassword(QWidget *parent) : QDialog(parent) { diff --git a/cockatrice/src/dialogs/dlg_edit_tokens.cpp b/cockatrice/src/dialogs/dlg_edit_tokens.cpp index 56711dda6..5cf502cfd 100644 --- a/cockatrice/src/dialogs/dlg_edit_tokens.cpp +++ b/cockatrice/src/dialogs/dlg_edit_tokens.cpp @@ -1,12 +1,7 @@ #include "dlg_edit_tokens.h" #include "../client/get_text_with_max.h" -#include "../database/card_database.h" -#include "../database/card_database_manager.h" -#include "../database/model/card_database_model.h" -#include "../database/model/token/token_edit_model.h" #include "../main.h" -#include "trice_limits.h" #include #include @@ -22,6 +17,11 @@ #include #include #include +#include +#include +#include +#include +#include DlgEditTokens::DlgEditTokens(QWidget *parent) : QDialog(parent), currentCard(nullptr) { diff --git a/cockatrice/src/dialogs/dlg_edit_tokens.h b/cockatrice/src/dialogs/dlg_edit_tokens.h index ce3f6d7d4..f19646756 100644 --- a/cockatrice/src/dialogs/dlg_edit_tokens.h +++ b/cockatrice/src/dialogs/dlg_edit_tokens.h @@ -7,9 +7,8 @@ #ifndef DLG_EDIT_TOKENS_H #define DLG_EDIT_TOKENS_H -#include "../card/card_info.h" - #include +#include class QModelIndex; class CardDatabaseModel; diff --git a/cockatrice/src/dialogs/dlg_edit_user.cpp b/cockatrice/src/dialogs/dlg_edit_user.cpp index 7b2af1445..70e99ca28 100644 --- a/cockatrice/src/dialogs/dlg_edit_user.cpp +++ b/cockatrice/src/dialogs/dlg_edit_user.cpp @@ -1,13 +1,12 @@ #include "dlg_edit_user.h" -#include "../settings/cache_settings.h" -#include "trice_limits.h" - #include #include #include #include #include +#include +#include DlgEditUser::DlgEditUser(QWidget *parent, QString email, QString country, QString realName) : QDialog(parent) { diff --git a/cockatrice/src/dialogs/dlg_forgot_password_challenge.cpp b/cockatrice/src/dialogs/dlg_forgot_password_challenge.cpp index 4ff237edf..a8999d1e3 100644 --- a/cockatrice/src/dialogs/dlg_forgot_password_challenge.cpp +++ b/cockatrice/src/dialogs/dlg_forgot_password_challenge.cpp @@ -1,8 +1,5 @@ #include "dlg_forgot_password_challenge.h" -#include "../settings/cache_settings.h" -#include "trice_limits.h" - #include #include #include @@ -10,6 +7,8 @@ #include #include #include +#include +#include DlgForgotPasswordChallenge::DlgForgotPasswordChallenge(QWidget *parent) : QDialog(parent) { diff --git a/cockatrice/src/dialogs/dlg_forgot_password_request.cpp b/cockatrice/src/dialogs/dlg_forgot_password_request.cpp index a07bda279..000e7b0f1 100644 --- a/cockatrice/src/dialogs/dlg_forgot_password_request.cpp +++ b/cockatrice/src/dialogs/dlg_forgot_password_request.cpp @@ -1,8 +1,5 @@ #include "dlg_forgot_password_request.h" -#include "../settings/cache_settings.h" -#include "trice_limits.h" - #include #include #include @@ -10,6 +7,8 @@ #include #include #include +#include +#include DlgForgotPasswordRequest::DlgForgotPasswordRequest(QWidget *parent) : QDialog(parent) { diff --git a/cockatrice/src/dialogs/dlg_forgot_password_reset.cpp b/cockatrice/src/dialogs/dlg_forgot_password_reset.cpp index 81ab96b9b..43b6c2fb9 100644 --- a/cockatrice/src/dialogs/dlg_forgot_password_reset.cpp +++ b/cockatrice/src/dialogs/dlg_forgot_password_reset.cpp @@ -1,8 +1,5 @@ #include "dlg_forgot_password_reset.h" -#include "../settings/cache_settings.h" -#include "trice_limits.h" - #include #include #include @@ -10,6 +7,8 @@ #include #include #include +#include +#include DlgForgotPasswordReset::DlgForgotPasswordReset(QWidget *parent) : QDialog(parent) { diff --git a/cockatrice/src/dialogs/dlg_load_deck.cpp b/cockatrice/src/dialogs/dlg_load_deck.cpp index 91252a768..fe9151b54 100644 --- a/cockatrice/src/dialogs/dlg_load_deck.cpp +++ b/cockatrice/src/dialogs/dlg_load_deck.cpp @@ -1,7 +1,8 @@ #include "dlg_load_deck.h" #include "../deck/deck_loader.h" -#include "../settings/cache_settings.h" + +#include DlgLoadDeck::DlgLoadDeck(QWidget *parent) : QFileDialog(parent, tr("Load Deck")) { diff --git a/cockatrice/src/dialogs/dlg_load_deck_from_clipboard.cpp b/cockatrice/src/dialogs/dlg_load_deck_from_clipboard.cpp index 26f92f4e9..3f0275dd7 100644 --- a/cockatrice/src/dialogs/dlg_load_deck_from_clipboard.cpp +++ b/cockatrice/src/dialogs/dlg_load_deck_from_clipboard.cpp @@ -1,7 +1,6 @@ #include "dlg_load_deck_from_clipboard.h" #include "../deck/deck_loader.h" -#include "../settings/cache_settings.h" #include "dlg_settings.h" #include @@ -13,6 +12,7 @@ #include #include #include +#include /** * Creates the main layout and connects the signals that are common to all versions of this window diff --git a/cockatrice/src/dialogs/dlg_manage_sets.cpp b/cockatrice/src/dialogs/dlg_manage_sets.cpp index 890afc075..ea95c1ed6 100644 --- a/cockatrice/src/dialogs/dlg_manage_sets.cpp +++ b/cockatrice/src/dialogs/dlg_manage_sets.cpp @@ -1,11 +1,9 @@ #include "dlg_manage_sets.h" #include "../client/network/sets_model.h" -#include "../database/card_database_manager.h" #include "../deck/custom_line_edit.h" +#include "../interface/card_picture_loader/card_picture_loader.h" #include "../main.h" -#include "../picture_loader/picture_loader.h" -#include "../settings/cache_settings.h" #include #include @@ -22,6 +20,8 @@ #include #include #include +#include +#include #define SORT_RESET -1 @@ -251,7 +251,7 @@ void WndSets::actSave() { model->save(CardDatabaseManager::getInstance()); SettingsCache::instance().setIncludeRebalancedCards(includeRebalancedCards); - PictureLoader::clearPixmapCache(); + CardPictureLoader::clearPixmapCache(); close(); } diff --git a/cockatrice/src/dialogs/dlg_register.cpp b/cockatrice/src/dialogs/dlg_register.cpp index 05c73179e..e71759554 100644 --- a/cockatrice/src/dialogs/dlg_register.cpp +++ b/cockatrice/src/dialogs/dlg_register.cpp @@ -1,9 +1,5 @@ #include "dlg_register.h" -#include "../settings/cache_settings.h" -#include "pb/serverinfo_user.pb.h" -#include "trice_limits.h" - #include #include #include @@ -11,6 +7,9 @@ #include #include #include +#include +#include +#include DlgRegister::DlgRegister(QWidget *parent) : QDialog(parent) { diff --git a/cockatrice/src/dialogs/dlg_select_set_for_cards.cpp b/cockatrice/src/dialogs/dlg_select_set_for_cards.cpp index 9f20067b2..b6da8fafe 100644 --- a/cockatrice/src/dialogs/dlg_select_set_for_cards.cpp +++ b/cockatrice/src/dialogs/dlg_select_set_for_cards.cpp @@ -1,6 +1,5 @@ #include "dlg_select_set_for_cards.h" -#include "../database/card_database_manager.h" #include "../deck/deck_loader.h" #include "../interface/widgets/cards/card_info_picture_widget.h" #include "../interface/widgets/general/layout_containers/flow_widget.h" @@ -17,6 +16,7 @@ #include #include #include +#include #include #include diff --git a/cockatrice/src/dialogs/dlg_settings.cpp b/cockatrice/src/dialogs/dlg_settings.cpp index 008735585..2d3c9168c 100644 --- a/cockatrice/src/dialogs/dlg_settings.cpp +++ b/cockatrice/src/dialogs/dlg_settings.cpp @@ -4,18 +4,13 @@ #include "../client/network/release_channel.h" #include "../client/network/spoiler_background_updater.h" #include "../client/sound_engine.h" -#include "../database/card_database.h" -#include "../database/card_database_manager.h" #include "../deck/custom_line_edit.h" +#include "../interface/card_picture_loader/card_picture_loader.h" #include "../interface/theme_manager.h" +#include "../interface/utility/sequence_edit.h" #include "../interface/widgets/general/background_sources.h" #include "../main.h" -#include "../picture_loader/picture_loader.h" -#include "../settings/cache_settings.h" -#include "../settings/card_counter_settings.h" -#include "../settings/shortcut_treeview.h" #include "../tabs/tab_supervisor.h" -#include "../utility/sequence_edit.h" #include #include @@ -48,6 +43,11 @@ #include #include #include +#include +#include +#include +#include +#include #define WIKI_CUSTOM_PIC_URL "https://github.com/Cockatrice/Cockatrice/wiki/Custom-Picture-Download-URLs" #define WIKI_CUSTOM_SHORTCUTS "https://github.com/Cockatrice/Cockatrice/wiki/Custom-Keyboard-Shortcuts" @@ -679,8 +679,8 @@ void AppearanceSettingsPage::overrideAllCardArtWithPersonalPreferenceToggled(QT_ if (result == QMessageBox::Yes) { SettingsCache::instance().setOverrideAllCardArtWithPersonalPreference(value); // Caches are now invalid. - PictureLoader::clearPixmapCache(); - PictureLoader::clearNetworkCache(); + CardPictureLoader::clearPixmapCache(); + CardPictureLoader::clearNetworkCache(); } else { // If user cancels, revert the checkbox/state back QTimer::singleShot(0, this, [this, enable]() { @@ -1124,7 +1124,7 @@ void DeckEditorSettingsPage::resetDownloadedURLsButtonClicked() void DeckEditorSettingsPage::clearDownloadedPicsButtonClicked() { - PictureLoader::clearNetworkCache(); + CardPictureLoader::clearNetworkCache(); // These are not used anymore, but we don't delete them automatically, so // we should do it here lest we leave pictures hanging around on users' diff --git a/cockatrice/src/dialogs/dlg_settings.h b/cockatrice/src/dialogs/dlg_settings.h index c88dce8d0..22c9fa1c0 100644 --- a/cockatrice/src/dialogs/dlg_settings.h +++ b/cockatrice/src/dialogs/dlg_settings.h @@ -7,8 +7,6 @@ #ifndef DLG_SETTINGS_H #define DLG_SETTINGS_H -#include "../utility/macros.h" - #include #include #include @@ -17,6 +15,7 @@ #include #include #include +#include inline Q_LOGGING_CATEGORY(DlgSettingsLog, "dlg_settings"); diff --git a/cockatrice/src/dialogs/dlg_startup_card_check.cpp b/cockatrice/src/dialogs/dlg_startup_card_check.cpp index 5d76bc253..c2a03a55e 100644 --- a/cockatrice/src/dialogs/dlg_startup_card_check.cpp +++ b/cockatrice/src/dialogs/dlg_startup_card_check.cpp @@ -1,8 +1,7 @@ #include "dlg_startup_card_check.h" -#include "../settings/cache_settings.h" - #include +#include DlgStartupCardCheck::DlgStartupCardCheck(QWidget *parent) : QDialog(parent) { diff --git a/cockatrice/src/dialogs/dlg_tip_of_the_day.cpp b/cockatrice/src/dialogs/dlg_tip_of_the_day.cpp index eb8e8dc47..6023ac48c 100644 --- a/cockatrice/src/dialogs/dlg_tip_of_the_day.cpp +++ b/cockatrice/src/dialogs/dlg_tip_of_the_day.cpp @@ -1,6 +1,5 @@ #include "dlg_tip_of_the_day.h" -#include "../settings/cache_settings.h" #include "tip_of_the_day.h" #include @@ -10,6 +9,7 @@ #include #include #include +#include #define MIN_TIP_IMAGE_HEIGHT 200 #define MIN_TIP_IMAGE_WIDTH 200 diff --git a/cockatrice/src/dialogs/dlg_update.cpp b/cockatrice/src/dialogs/dlg_update.cpp index 0edcb1512..ca5100f09 100644 --- a/cockatrice/src/dialogs/dlg_update.cpp +++ b/cockatrice/src/dialogs/dlg_update.cpp @@ -3,7 +3,6 @@ #include "../client/network/client_update_checker.h" #include "../client/network/release_channel.h" #include "../interface/window_main.h" -#include "../settings/cache_settings.h" #include #include @@ -14,6 +13,7 @@ #include #include #include +#include #include DlgUpdate::DlgUpdate(QWidget *parent) : QDialog(parent) diff --git a/cockatrice/src/dialogs/dlg_view_log.cpp b/cockatrice/src/dialogs/dlg_view_log.cpp index b60a9767b..7ad8ec9ab 100644 --- a/cockatrice/src/dialogs/dlg_view_log.cpp +++ b/cockatrice/src/dialogs/dlg_view_log.cpp @@ -1,13 +1,12 @@ #include "dlg_view_log.h" -#include "../settings/cache_settings.h" -#include "../utility/logger.h" - #include #include #include #include #include +#include +#include DlgViewLog::DlgViewLog(QWidget *parent) : QDialog(parent) { diff --git a/cockatrice/src/filters/deck_filter_string.cpp b/cockatrice/src/filters/deck_filter_string.cpp index f107884c3..f45115edd 100644 --- a/cockatrice/src/filters/deck_filter_string.cpp +++ b/cockatrice/src/filters/deck_filter_string.cpp @@ -1,8 +1,9 @@ #include "deck_filter_string.h" -#include "../database/card_database_manager.h" #include "filter_string.h" -#include "lib/peglib.h" + +#include +#include static peg::parser search(R"( Start <- QueryPartList diff --git a/cockatrice/src/filters/filter_string.cpp b/cockatrice/src/filters/filter_string.cpp index 02fc1e1ec..3615729f0 100644 --- a/cockatrice/src/filters/filter_string.cpp +++ b/cockatrice/src/filters/filter_string.cpp @@ -1,12 +1,11 @@ #include "filter_string.h" -#include "../../../common/lib/peglib.h" - #include #include #include #include #include +#include static peg::parser search(R"( Start <- QueryPartList diff --git a/cockatrice/src/filters/filter_string.h b/cockatrice/src/filters/filter_string.h index f2b8ce006..4e6cb38bf 100644 --- a/cockatrice/src/filters/filter_string.h +++ b/cockatrice/src/filters/filter_string.h @@ -7,13 +7,13 @@ #ifndef FILTER_STRING_H #define FILTER_STRING_H -#include "../card/card_info.h" #include "filter_tree.h" #include #include #include #include +#include #include inline Q_LOGGING_CATEGORY(FilterStringLog, "filter_string"); diff --git a/cockatrice/src/filters/filter_tree.h b/cockatrice/src/filters/filter_tree.h index 40a6ec54c..dc64f79fe 100644 --- a/cockatrice/src/filters/filter_tree.h +++ b/cockatrice/src/filters/filter_tree.h @@ -7,12 +7,12 @@ #ifndef FILTERTREE_H #define FILTERTREE_H -#include "../database/card_database.h" #include "filter_card.h" #include #include #include +#include #include class FilterTreeNode diff --git a/cockatrice/src/game/abstract_game.h b/cockatrice/src/game/abstract_game.h index 08c25772c..cb4dbac2a 100644 --- a/cockatrice/src/game/abstract_game.h +++ b/cockatrice/src/game/abstract_game.h @@ -7,13 +7,13 @@ #ifndef COCKATRICE_ABSTRACT_GAME_H #define COCKATRICE_ABSTRACT_GAME_H -#include "../../../common/pb/game_replay.pb.h" #include "game_event_handler.h" #include "game_meta_info.h" #include "game_state.h" #include "player/player_manager.h" #include +#include class CardItem; class TabGame; diff --git a/cockatrice/src/game/board/abstract_card_drag_item.cpp b/cockatrice/src/game/board/abstract_card_drag_item.cpp index d7b0b7d46..3507a5a27 100644 --- a/cockatrice/src/game/board/abstract_card_drag_item.cpp +++ b/cockatrice/src/game/board/abstract_card_drag_item.cpp @@ -1,11 +1,10 @@ #include "abstract_card_drag_item.h" -#include "../../settings/cache_settings.h" - #include #include #include #include +#include static const float CARD_WIDTH_HALF = CARD_WIDTH / 2; static const float CARD_HEIGHT_HALF = CARD_HEIGHT / 2; diff --git a/cockatrice/src/game/board/abstract_card_item.cpp b/cockatrice/src/game/board/abstract_card_item.cpp index ea23f39c0..f5edf1d62 100644 --- a/cockatrice/src/game/board/abstract_card_item.cpp +++ b/cockatrice/src/game/board/abstract_card_item.cpp @@ -1,9 +1,6 @@ #include "abstract_card_item.h" -#include "../../database/card_database.h" -#include "../../database/card_database_manager.h" -#include "../../picture_loader/picture_loader.h" -#include "../../settings/cache_settings.h" +#include "../../interface/card_picture_loader/card_picture_loader.h" #include "../game_scene.h" #include @@ -11,6 +8,9 @@ #include #include #include +#include +#include +#include AbstractCardItem::AbstractCardItem(QGraphicsItem *parent, const CardRef &cardRef, Player *_owner, int _id) : ArrowTarget(_owner, parent), id(_id), cardRef(cardRef), tapped(false), facedown(false), tapAngle(0), @@ -119,11 +119,11 @@ void AbstractCardItem::paintPicture(QPainter *painter, const QSizeF &translatedS if (facedown || cardRef.name.isEmpty()) { // never reveal card color, always paint the card back - PictureLoader::getCardBackPixmap(translatedPixmap, translatedSize.toSize()); + CardPictureLoader::getCardBackPixmap(translatedPixmap, translatedSize.toSize()); } else { // don't even spend time trying to load the picture if our size is too small if (translatedSize.width() > 10) { - PictureLoader::getPixmap(translatedPixmap, exactCard, translatedSize.toSize()); + CardPictureLoader::getPixmap(translatedPixmap, exactCard, translatedSize.toSize()); if (translatedPixmap.isNull()) paintImage = false; } else { diff --git a/cockatrice/src/game/board/abstract_card_item.h b/cockatrice/src/game/board/abstract_card_item.h index 7ec843575..8aa5a606b 100644 --- a/cockatrice/src/game/board/abstract_card_item.h +++ b/cockatrice/src/game/board/abstract_card_item.h @@ -7,11 +7,12 @@ #ifndef ABSTRACTCARDITEM_H #define ABSTRACTCARDITEM_H -#include "../../card/exact_card.h" #include "arrow_target.h" -#include "card_ref.h" #include "graphics_item_type.h" +#include +#include + class Player; const int CARD_WIDTH = 72; diff --git a/cockatrice/src/game/board/abstract_counter.cpp b/cockatrice/src/game/board/abstract_counter.cpp index c821dc4f8..cfc20341f 100644 --- a/cockatrice/src/game/board/abstract_counter.cpp +++ b/cockatrice/src/game/board/abstract_counter.cpp @@ -1,11 +1,7 @@ #include "abstract_counter.h" -#include "../../settings/cache_settings.h" #include "../../tabs/tab_game.h" #include "../player/player.h" -#include "expression.h" -#include "pb/command_inc_counter.pb.h" -#include "pb/command_set_counter.pb.h" #include "translate_counter_name.h" #include @@ -16,6 +12,10 @@ #include #include #include +#include +#include +#include +#include AbstractCounter::AbstractCounter(Player *_player, int _id, diff --git a/cockatrice/src/game/board/arrow_item.cpp b/cockatrice/src/game/board/arrow_item.cpp index 819fb7927..cc4a4e6aa 100644 --- a/cockatrice/src/game/board/arrow_item.cpp +++ b/cockatrice/src/game/board/arrow_item.cpp @@ -1,22 +1,22 @@ #define _USE_MATH_DEFINES #include "arrow_item.h" -#include "../../card/card_info.h" -#include "../../settings/cache_settings.h" #include "../player/player.h" #include "../player/player_target.h" #include "../zones/card_zone.h" #include "card_item.h" -#include "color.h" -#include "pb/command_attach_card.pb.h" -#include "pb/command_create_arrow.pb.h" -#include "pb/command_delete_arrow.pb.h" #include #include #include #include #include +#include +#include +#include +#include +#include +#include ArrowItem::ArrowItem(Player *_player, int _id, ArrowTarget *_startItem, ArrowTarget *_targetItem, const QColor &_color) : QGraphicsItem(), player(_player), id(_id), startItem(_startItem), targetItem(_targetItem), targetLocked(false), diff --git a/cockatrice/src/game/board/card_item.cpp b/cockatrice/src/game/board/card_item.cpp index da347098f..2bb36725f 100644 --- a/cockatrice/src/game/board/card_item.cpp +++ b/cockatrice/src/game/board/card_item.cpp @@ -1,8 +1,5 @@ #include "card_item.h" -#include "../../card/card_info.h" -#include "../../settings/cache_settings.h" -#include "../../settings/card_counter_settings.h" #include "../../tabs/tab_game.h" #include "../game_scene.h" #include "../player/player.h" @@ -12,12 +9,15 @@ #include "../zones/view_zone.h" #include "arrow_item.h" #include "card_drag_item.h" -#include "pb/serverinfo_card.pb.h" #include #include #include #include +#include +#include +#include +#include CardItem::CardItem(Player *_owner, QGraphicsItem *parent, const CardRef &cardRef, int _cardid, CardZoneLogic *_zone) : AbstractCardItem(parent, cardRef, _owner, _cardid), zone(_zone), attacking(false), destroyOnZoneChange(false), diff --git a/cockatrice/src/game/board/card_item.h b/cockatrice/src/game/board/card_item.h index 5408a5f3a..dcaf33520 100644 --- a/cockatrice/src/game/board/card_item.h +++ b/cockatrice/src/game/board/card_item.h @@ -9,7 +9,8 @@ #include "../zones/logic/card_zone_logic.h" #include "abstract_card_item.h" -#include "server/game/server_card.h" + +#include class CardDatabase; class CardDragItem; diff --git a/cockatrice/src/game/board/card_list.cpp b/cockatrice/src/game/board/card_list.cpp index 7ad9048c3..c324ca10a 100644 --- a/cockatrice/src/game/board/card_list.cpp +++ b/cockatrice/src/game/board/card_list.cpp @@ -1,10 +1,10 @@ #include "card_list.h" -#include "../../card/card_info.h" #include "card_item.h" #include #include +#include CardList::CardList(bool _contentsKnown) : QList(), contentsKnown(_contentsKnown) { diff --git a/cockatrice/src/game/deckview/deck_view.cpp b/cockatrice/src/game/deckview/deck_view.cpp index 46b1cc524..da9c97db9 100644 --- a/cockatrice/src/game/deckview/deck_view.cpp +++ b/cockatrice/src/game/deckview/deck_view.cpp @@ -1,16 +1,16 @@ #include "deck_view.h" -#include "../../card/card_info.h" #include "../../interface/theme_manager.h" -#include "../../settings/cache_settings.h" -#include "deck_list.h" -#include "deck_list_card_node.h" #include #include #include #include #include +#include +#include +#include +#include DeckViewCardDragItem::DeckViewCardDragItem(DeckViewCard *_item, const QPointF &_hotSpot, diff --git a/cockatrice/src/game/deckview/deck_view.h b/cockatrice/src/game/deckview/deck_view.h index 06fb7294a..7d01d5670 100644 --- a/cockatrice/src/game/deckview/deck_view.h +++ b/cockatrice/src/game/deckview/deck_view.h @@ -8,13 +8,13 @@ #define DECKVIEW_H #include "../board/abstract_card_drag_item.h" -#include "pb/move_card_to_zone.pb.h" #include #include #include #include #include +#include class DeckList; class InnerDecklistNode; diff --git a/cockatrice/src/game/deckview/deck_view_container.cpp b/cockatrice/src/game/deckview/deck_view_container.cpp index 7dd2da41b..22402ee63 100644 --- a/cockatrice/src/game/deckview/deck_view_container.cpp +++ b/cockatrice/src/game/deckview/deck_view_container.cpp @@ -1,29 +1,29 @@ #include "deck_view_container.h" -#include "../../database/card_database.h" -#include "../../database/card_database_manager.h" #include "../../deck/deck_loader.h" #include "../../dialogs/dlg_load_deck.h" #include "../../dialogs/dlg_load_deck_from_clipboard.h" #include "../../dialogs/dlg_load_deck_from_website.h" #include "../../dialogs/dlg_load_remote_deck.h" -#include "../../picture_loader/picture_loader.h" -#include "../../server/pending_command.h" -#include "../../settings/cache_settings.h" +#include "../../interface/card_picture_loader/card_picture_loader.h" #include "../../tabs/tab_game.h" #include "../game_scene.h" #include "deck_view.h" -#include "pb/command_deck_select.pb.h" -#include "pb/command_ready_start.pb.h" -#include "pb/command_set_sideboard_lock.pb.h" -#include "pb/command_set_sideboard_plan.pb.h" -#include "pb/response_deck_download.pb.h" -#include "trice_limits.h" #include #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include ToggleButton::ToggleButton(QWidget *parent) : QPushButton(parent), state(false) { @@ -332,7 +332,7 @@ void DeckViewContainer::deckSelectFinished(const Response &r) { const Response_DeckDownload &resp = r.GetExtension(Response_DeckDownload::ext); DeckLoader newDeck(QString::fromStdString(resp.deck())); - PictureLoader::cacheCardPixmaps(CardDatabaseManager::query()->getCards(newDeck.getCardRefList())); + CardPictureLoader::cacheCardPixmaps(CardDatabaseManager::query()->getCards(newDeck.getCardRefList())); setDeck(newDeck); switchToDeckLoadedView(); } diff --git a/cockatrice/src/game/dialogs/dlg_create_token.cpp b/cockatrice/src/game/dialogs/dlg_create_token.cpp index 8da2bc722..aeb9be453 100644 --- a/cockatrice/src/game/dialogs/dlg_create_token.cpp +++ b/cockatrice/src/game/dialogs/dlg_create_token.cpp @@ -1,13 +1,7 @@ #include "dlg_create_token.h" -#include "../../database/card_database_manager.h" -#include "../../database/model/card_database_model.h" -#include "../../database/model/token/token_display_model.h" #include "../../interface/widgets/cards/card_info_picture_widget.h" #include "../../main.h" -#include "../../settings/cache_settings.h" -#include "deck_list.h" -#include "trice_limits.h" #include #include @@ -22,6 +16,12 @@ #include #include #include +#include +#include +#include +#include +#include +#include DlgCreateToken::DlgCreateToken(const QStringList &_predefinedTokens, QWidget *parent) : QDialog(parent), predefinedTokens(_predefinedTokens) diff --git a/cockatrice/src/game/dialogs/dlg_move_top_cards_until.cpp b/cockatrice/src/game/dialogs/dlg_move_top_cards_until.cpp index 53b762fb4..f73968d7a 100644 --- a/cockatrice/src/game/dialogs/dlg_move_top_cards_until.cpp +++ b/cockatrice/src/game/dialogs/dlg_move_top_cards_until.cpp @@ -1,7 +1,5 @@ #include "dlg_move_top_cards_until.h" -#include "../../database/card_database.h" -#include "../../database/card_database_manager.h" #include "../../filters/filter_string.h" #include @@ -12,6 +10,8 @@ #include #include #include +#include +#include DlgMoveTopCardsUntil::DlgMoveTopCardsUntil(QWidget *parent, QStringList exprs, uint _numberOfHits, bool autoPlay) : QDialog(parent) diff --git a/cockatrice/src/game/dialogs/dlg_roll_dice.cpp b/cockatrice/src/game/dialogs/dlg_roll_dice.cpp index 7a1a2bb9b..dfb3d0bc5 100644 --- a/cockatrice/src/game/dialogs/dlg_roll_dice.cpp +++ b/cockatrice/src/game/dialogs/dlg_roll_dice.cpp @@ -1,12 +1,11 @@ #include "dlg_roll_dice.h" -#include "trice_limits.h" - #include #include #include #include #include +#include DlgRollDice::DlgRollDice(QWidget *parent) : QDialog(parent) { diff --git a/cockatrice/src/game/game.cpp b/cockatrice/src/game/game.cpp index d24d4cb51..a81f838a3 100644 --- a/cockatrice/src/game/game.cpp +++ b/cockatrice/src/game/game.cpp @@ -1,7 +1,8 @@ #include "game.h" #include "../tabs/tab_game.h" -#include "pb/event_game_joined.pb.h" + +#include Game::Game(TabGame *_tab, QList &_clients, diff --git a/cockatrice/src/game/game_event_handler.cpp b/cockatrice/src/game/game_event_handler.cpp index d5848ffdb..3ef1e1c1f 100644 --- a/cockatrice/src/game/game_event_handler.cpp +++ b/cockatrice/src/game/game_event_handler.cpp @@ -1,33 +1,34 @@ #include "game_event_handler.h" -#include "../server/abstract_client.h" -#include "../server/pending_command.h" #include "../tabs/tab_game.h" #include "abstract_game.h" -#include "get_pb_extension.h" #include "log/message_log_widget.h" -#include "pb/command_concede.pb.h" -#include "pb/command_delete_arrow.pb.h" -#include "pb/command_game_say.pb.h" -#include "pb/command_leave_game.pb.h" -#include "pb/command_next_turn.pb.h" -#include "pb/command_reverse_turn.pb.h" -#include "pb/command_set_active_phase.pb.h" -#include "pb/context_connection_state_changed.pb.h" -#include "pb/context_deck_select.pb.h" -#include "pb/context_ping_changed.pb.h" -#include "pb/event_game_closed.pb.h" -#include "pb/event_game_host_changed.pb.h" -#include "pb/event_game_say.pb.h" -#include "pb/event_game_state_changed.pb.h" -#include "pb/event_join.pb.h" -#include "pb/event_kicked.pb.h" -#include "pb/event_leave.pb.h" -#include "pb/event_player_properties_changed.pb.h" -#include "pb/event_reverse_turn.pb.h" -#include "pb/event_set_active_phase.pb.h" -#include "pb/event_set_active_player.pb.h" -#include "pb/game_event_container.pb.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include GameEventHandler::GameEventHandler(AbstractGame *_game) : QObject(_game), game(_game) { diff --git a/cockatrice/src/game/game_event_handler.h b/cockatrice/src/game/game_event_handler.h index 4f44cd83e..2709cdcd5 100644 --- a/cockatrice/src/game/game_event_handler.h +++ b/cockatrice/src/game/game_event_handler.h @@ -7,12 +7,12 @@ #ifndef COCKATRICE_GAME_EVENT_HANDLER_H #define COCKATRICE_GAME_EVENT_HANDLER_H -#include "pb/event_leave.pb.h" -#include "pb/serverinfo_player.pb.h" #include "player/event_processing_options.h" #include #include +#include +#include class AbstractClient; class Response; diff --git a/cockatrice/src/game/game_meta_info.h b/cockatrice/src/game/game_meta_info.h index e3c0c22e0..b5f5bfe4f 100644 --- a/cockatrice/src/game/game_meta_info.h +++ b/cockatrice/src/game/game_meta_info.h @@ -7,10 +7,9 @@ #ifndef GAME_META_INFO_H #define GAME_META_INFO_H -#include "pb/serverinfo_game.pb.h" - #include #include +#include // Translation layer class to expose protobuf safely and hook it up to Qt Signals. // This class de-couples the domain object (i.e. the GameMetaInfo) from the network object. diff --git a/cockatrice/src/game/game_scene.cpp b/cockatrice/src/game/game_scene.cpp index 4316e67bf..5af7b2e1d 100644 --- a/cockatrice/src/game/game_scene.cpp +++ b/cockatrice/src/game/game_scene.cpp @@ -1,6 +1,5 @@ #include "game_scene.h" -#include "../settings/cache_settings.h" #include "board/card_item.h" #include "phases_toolbar.h" #include "player/player.h" @@ -15,6 +14,7 @@ #include #include #include +#include #include /** diff --git a/cockatrice/src/game/game_state.h b/cockatrice/src/game/game_state.h index 0ad24633c..b5d6a6572 100644 --- a/cockatrice/src/game/game_state.h +++ b/cockatrice/src/game/game_state.h @@ -7,11 +7,10 @@ #ifndef COCKATRICE_GAME_STATE_H #define COCKATRICE_GAME_STATE_H -#include "../server/abstract_client.h" -#include "pb/serverinfo_game.pb.h" - #include #include +#include +#include class AbstractGame; class ServerInfo_PlayerProperties; diff --git a/cockatrice/src/game/game_view.cpp b/cockatrice/src/game/game_view.cpp index 969e26e14..607f0c85a 100644 --- a/cockatrice/src/game/game_view.cpp +++ b/cockatrice/src/game/game_view.cpp @@ -1,11 +1,11 @@ #include "game_view.h" -#include "../settings/cache_settings.h" #include "game_scene.h" #include #include #include +#include GameView::GameView(GameScene *scene, QWidget *parent) : QGraphicsView(scene, parent), rubberBand(0) { diff --git a/cockatrice/src/game/log/message_log_widget.cpp b/cockatrice/src/game/log/message_log_widget.cpp index ed8a4e49c..1d76ba31f 100644 --- a/cockatrice/src/game/log/message_log_widget.cpp +++ b/cockatrice/src/game/log/message_log_widget.cpp @@ -1,17 +1,17 @@ #include "message_log_widget.h" #include "../../client/sound_engine.h" -#include "../../settings/card_counter_settings.h" #include "../../tabs/tab_game.h" #include "../board/card_item.h" #include "../board/translate_counter_name.h" #include "../phase.h" #include "../player/player.h" #include "../zones/card_zone.h" -#include "pb/context_move_card.pb.h" -#include "pb/context_mulligan.pb.h" -#include "pb/serverinfo_user.pb.h" +#include +#include +#include +#include #include static const QString TABLE_ZONE_NAME = "table"; diff --git a/cockatrice/src/game/log/message_log_widget.h b/cockatrice/src/game/log/message_log_widget.h index 128d8ba0e..b40f6e5e4 100644 --- a/cockatrice/src/game/log/message_log_widget.h +++ b/cockatrice/src/game/log/message_log_widget.h @@ -10,7 +10,8 @@ #include "../../client/translation.h" #include "../../server/chat_view/chat_view.h" #include "../zones/logic/card_zone_logic.h" -#include "user_level.h" + +#include class AbstractGame; class CardItem; diff --git a/cockatrice/src/game/phases_toolbar.cpp b/cockatrice/src/game/phases_toolbar.cpp index 2fef5321c..5106e40de 100644 --- a/cockatrice/src/game/phases_toolbar.cpp +++ b/cockatrice/src/game/phases_toolbar.cpp @@ -1,16 +1,16 @@ #include "phases_toolbar.h" #include "../interface/pixel_map_generator.h" -#include "pb/command_draw_cards.pb.h" -#include "pb/command_next_turn.pb.h" -#include "pb/command_set_active_phase.pb.h" -#include "pb/command_set_card_attr.pb.h" #include #include #include #include #include +#include +#include +#include +#include PhaseButton::PhaseButton(const QString &_name, QGraphicsItem *parent, QAction *_doubleClickAction, bool _highlightable) : QObject(), QGraphicsItem(parent), name(_name), active(false), highlightable(_highlightable), diff --git a/cockatrice/src/game/player/menu/card_menu.cpp b/cockatrice/src/game/player/menu/card_menu.cpp index 22cc86597..86942258c 100644 --- a/cockatrice/src/game/player/menu/card_menu.cpp +++ b/cockatrice/src/game/player/menu/card_menu.cpp @@ -1,8 +1,5 @@ #include "card_menu.h" -#include "../../../card/card_relation.h" -#include "../../../database/card_database_manager.h" -#include "../../../settings/card_counter_settings.h" #include "../../../tabs/tab_game.h" #include "../../board/card_item.h" #include "../../zones/logic/view_zone_logic.h" @@ -12,6 +9,10 @@ #include "move_menu.h" #include "pt_menu.h" +#include +#include +#include + CardMenu::CardMenu(Player *_player, const CardItem *_card, bool _shortcutsActive) : player(_player), card(_card), shortcutsActive(_shortcutsActive) { diff --git a/cockatrice/src/game/player/menu/hand_menu.cpp b/cockatrice/src/game/player/menu/hand_menu.cpp index 3f506de00..b8908bc3e 100644 --- a/cockatrice/src/game/player/menu/hand_menu.cpp +++ b/cockatrice/src/game/player/menu/hand_menu.cpp @@ -1,7 +1,5 @@ #include "hand_menu.h" -#include "../../../settings/cache_settings.h" -#include "../../../settings/shortcuts_settings.h" #include "../../abstract_game.h" #include "../../zones/hand_zone.h" #include "../player.h" @@ -9,6 +7,8 @@ #include #include +#include +#include HandMenu::HandMenu(Player *_player, PlayerActions *actions, QWidget *parent) : TearOffMenu(parent), player(_player) { diff --git a/cockatrice/src/game/player/menu/library_menu.cpp b/cockatrice/src/game/player/menu/library_menu.cpp index 704e03e9f..53fd58eba 100644 --- a/cockatrice/src/game/player/menu/library_menu.cpp +++ b/cockatrice/src/game/player/menu/library_menu.cpp @@ -1,7 +1,5 @@ #include "library_menu.h" -#include "../../../settings/cache_settings.h" -#include "../../../settings/shortcuts_settings.h" #include "../../../tabs/tab_game.h" #include "../../abstract_game.h" #include "../player.h" @@ -9,6 +7,8 @@ #include #include +#include +#include LibraryMenu::LibraryMenu(Player *_player, QWidget *parent) : TearOffMenu(parent), player(_player) { diff --git a/cockatrice/src/game/player/menu/player_menu.cpp b/cockatrice/src/game/player/menu/player_menu.cpp index 7298d3ca9..cc9e284dd 100644 --- a/cockatrice/src/game/player/menu/player_menu.cpp +++ b/cockatrice/src/game/player/menu/player_menu.cpp @@ -1,7 +1,5 @@ #include "player_menu.h" -#include "../../../common/pb/command_reveal_cards.pb.h" -#include "../../../database/card_database_manager.h" #include "../../../tabs/tab_game.h" #include "../../board/card_item.h" #include "../../zones/hand_zone.h" @@ -10,6 +8,9 @@ #include "card_menu.h" #include "hand_menu.h" +#include +#include + PlayerMenu::PlayerMenu(Player *_player) : player(_player) { playerMenu = new TearOffMenu(); diff --git a/cockatrice/src/game/player/menu/say_menu.cpp b/cockatrice/src/game/player/menu/say_menu.cpp index 3598a1c66..7db8f60be 100644 --- a/cockatrice/src/game/player/menu/say_menu.cpp +++ b/cockatrice/src/game/player/menu/say_menu.cpp @@ -1,9 +1,10 @@ #include "say_menu.h" -#include "../../../settings/cache_settings.h" #include "../player.h" #include "../player_actions.h" +#include + SayMenu::SayMenu(Player *_player) : player(_player) { connect(&SettingsCache::instance().messages(), &MessageSettings::messageMacrosChanged, this, &SayMenu::initSayMenu); diff --git a/cockatrice/src/game/player/player.cpp b/cockatrice/src/game/player/player.cpp index b7faa0868..6390bbd84 100644 --- a/cockatrice/src/game/player/player.cpp +++ b/cockatrice/src/game/player/player.cpp @@ -12,15 +12,6 @@ #include "../zones/stack_zone.h" #include "../zones/table_zone.h" #include "../zones/view_zone.h" -#include "color.h" -#include "pb/command_attach_card.pb.h" -#include "pb/command_set_card_counter.pb.h" -#include "pb/event_create_arrow.pb.h" -#include "pb/event_create_counter.pb.h" -#include "pb/event_draw_cards.pb.h" -#include "pb/serverinfo_player.pb.h" -#include "pb/serverinfo_user.pb.h" -#include "pb/serverinfo_zone.pb.h" #include "player_target.h" #include @@ -28,6 +19,15 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include Player::Player(const ServerInfo_User &info, int _id, bool _local, bool _judge, AbstractGame *_parent) : QObject(_parent), game(_parent), playerInfo(new PlayerInfo(info, _id, _local, _judge)), diff --git a/cockatrice/src/game/player/player.h b/cockatrice/src/game/player/player.h index 8047f514e..cd0e3cec7 100644 --- a/cockatrice/src/game/player/player.h +++ b/cockatrice/src/game/player/player.h @@ -7,14 +7,11 @@ #ifndef PLAYER_H #define PLAYER_H -#include "../../card/card_info.h" #include "../../filters/filter_string.h" #include "../../interface/tearoff_menu.h" #include "../board/abstract_graphics_item.h" #include "../dialogs/dlg_create_token.h" #include "menu/player_menu.h" -#include "pb/card_attributes.pb.h" -#include "pb/game_event.pb.h" #include "player_actions.h" #include "player_area.h" #include "player_event_handler.h" @@ -26,6 +23,9 @@ #include #include #include +#include +#include +#include inline Q_LOGGING_CATEGORY(PlayerLog, "player"); diff --git a/cockatrice/src/game/player/player_actions.cpp b/cockatrice/src/game/player/player_actions.cpp index b74db09ce..004053b1e 100644 --- a/cockatrice/src/game/player/player_actions.cpp +++ b/cockatrice/src/game/player/player_actions.cpp @@ -1,31 +1,32 @@ #include "player_actions.h" -#include "../../../common/pb/context_move_card.pb.h" -#include "../../card/card_relation.h" #include "../../client/get_text_with_max.h" -#include "../../database/card_database_manager.h" #include "../../tabs/tab_game.h" #include "../board/card_item.h" #include "../dialogs/dlg_move_top_cards_until.h" #include "../dialogs/dlg_roll_dice.h" #include "../zones/logic/view_zone_logic.h" #include "card_menu_action_type.h" -#include "pb/command_attach_card.pb.h" -#include "pb/command_change_zone_properties.pb.h" -#include "pb/command_concede.pb.h" -#include "pb/command_create_token.pb.h" -#include "pb/command_draw_cards.pb.h" -#include "pb/command_flip_card.pb.h" -#include "pb/command_game_say.pb.h" -#include "pb/command_move_card.pb.h" -#include "pb/command_mulligan.pb.h" -#include "pb/command_reveal_cards.pb.h" -#include "pb/command_roll_die.pb.h" -#include "pb/command_set_card_attr.pb.h" -#include "pb/command_set_card_counter.pb.h" -#include "pb/command_shuffle.pb.h" -#include "pb/command_undo_draw.pb.h" -#include "trice_limits.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // milliseconds in between triggers of the move top cards until action static constexpr int MOVE_TOP_CARD_UNTIL_INTERVAL = 100; diff --git a/cockatrice/src/game/player/player_actions.h b/cockatrice/src/game/player/player_actions.h index 02991b60b..ffa02385a 100644 --- a/cockatrice/src/game/player/player_actions.h +++ b/cockatrice/src/game/player/player_actions.h @@ -7,12 +7,13 @@ #ifndef COCKATRICE_PLAYER_ACTIONS_H #define COCKATRICE_PLAYER_ACTIONS_H -#include "../../card/card_relation_type.h" #include "event_processing_options.h" #include "player.h" #include #include +#include +#include namespace google { diff --git a/cockatrice/src/game/player/player_event_handler.cpp b/cockatrice/src/game/player/player_event_handler.cpp index 969ffd4d2..eacc2dd2b 100644 --- a/cockatrice/src/game/player/player_event_handler.cpp +++ b/cockatrice/src/game/player/player_event_handler.cpp @@ -5,30 +5,31 @@ #include "../board/card_item.h" #include "../board/card_list.h" #include "../zones/view_zone.h" -#include "pb/command_set_card_attr.pb.h" -#include "pb/context_move_card.pb.h" -#include "pb/context_undo_draw.pb.h" -#include "pb/event_attach_card.pb.h" -#include "pb/event_change_zone_properties.pb.h" -#include "pb/event_create_arrow.pb.h" -#include "pb/event_create_counter.pb.h" -#include "pb/event_create_token.pb.h" -#include "pb/event_del_counter.pb.h" -#include "pb/event_delete_arrow.pb.h" -#include "pb/event_destroy_card.pb.h" -#include "pb/event_draw_cards.pb.h" -#include "pb/event_dump_zone.pb.h" -#include "pb/event_flip_card.pb.h" -#include "pb/event_game_say.pb.h" -#include "pb/event_move_card.pb.h" -#include "pb/event_reveal_cards.pb.h" -#include "pb/event_roll_die.pb.h" -#include "pb/event_set_card_attr.pb.h" -#include "pb/event_set_card_counter.pb.h" -#include "pb/event_set_counter.pb.h" -#include "pb/event_shuffle.pb.h" #include "player.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + PlayerEventHandler::PlayerEventHandler(Player *_player) : player(_player) { } diff --git a/cockatrice/src/game/player/player_event_handler.h b/cockatrice/src/game/player/player_event_handler.h index e7d47b0de..5d1ddd4b4 100644 --- a/cockatrice/src/game/player/player_event_handler.h +++ b/cockatrice/src/game/player/player_event_handler.h @@ -9,8 +9,8 @@ #include "event_processing_options.h" #include -#include -#include +#include +#include class CardItem; class CardZoneLogic; diff --git a/cockatrice/src/game/player/player_info.h b/cockatrice/src/game/player/player_info.h index e649b1584..a8bd63cd0 100644 --- a/cockatrice/src/game/player/player_info.h +++ b/cockatrice/src/game/player/player_info.h @@ -7,7 +7,6 @@ #ifndef COCKATRICE_PLAYER_INFO_H #define COCKATRICE_PLAYER_INFO_H -#include "../../../common/pb/serverinfo_user.pb.h" #include "../../deck/deck_loader.h" #include "../zones/hand_zone.h" #include "../zones/pile_zone.h" @@ -16,6 +15,7 @@ #include "player_target.h" #include +#include class PlayerInfo : public QObject { diff --git a/cockatrice/src/game/player/player_list_widget.cpp b/cockatrice/src/game/player/player_list_widget.cpp index 9df7e94da..009703499 100644 --- a/cockatrice/src/game/player/player_list_widget.cpp +++ b/cockatrice/src/game/player/player_list_widget.cpp @@ -1,21 +1,21 @@ #include "player_list_widget.h" #include "../../interface/pixel_map_generator.h" -#include "../../server/abstract_client.h" #include "../../server/user/user_context_menu.h" #include "../../server/user/user_list_manager.h" #include "../../server/user/user_list_widget.h" #include "../../tabs/tab_account.h" #include "../../tabs/tab_game.h" #include "../../tabs/tab_supervisor.h" -#include "pb/command_kick_from_game.pb.h" -#include "pb/serverinfo_playerproperties.pb.h" -#include "pb/session_commands.pb.h" #include #include #include #include +#include +#include +#include +#include PlayerListItemDelegate::PlayerListItemDelegate(QObject *const parent) : QStyledItemDelegate(parent) { diff --git a/cockatrice/src/game/player/player_manager.h b/cockatrice/src/game/player/player_manager.h index 2c257f7b4..20542d466 100644 --- a/cockatrice/src/game/player/player_manager.h +++ b/cockatrice/src/game/player/player_manager.h @@ -7,10 +7,9 @@ #ifndef COCKATRICE_PLAYER_MANAGER_H #define COCKATRICE_PLAYER_MANAGER_H -#include "pb/serverinfo_playerproperties.pb.h" - #include #include +#include class AbstractGame; class Player; diff --git a/cockatrice/src/game/player/player_target.cpp b/cockatrice/src/game/player/player_target.cpp index 6ece3e261..a7a5cc5e7 100644 --- a/cockatrice/src/game/player/player_target.cpp +++ b/cockatrice/src/game/player/player_target.cpp @@ -1,13 +1,13 @@ #include "player_target.h" #include "../../interface/pixel_map_generator.h" -#include "pb/serverinfo_user.pb.h" #include "player.h" #include #include #include #include +#include PlayerCounter::PlayerCounter(Player *_player, int _id, const QString &_name, int _value, QGraphicsItem *parent) : AbstractCounter(_player, _id, _name, false, _value, false, parent) diff --git a/cockatrice/src/game/zones/hand_zone.cpp b/cockatrice/src/game/zones/hand_zone.cpp index 19ea272b2..5d63e8a28 100644 --- a/cockatrice/src/game/zones/hand_zone.cpp +++ b/cockatrice/src/game/zones/hand_zone.cpp @@ -1,13 +1,13 @@ #include "hand_zone.h" #include "../../interface/theme_manager.h" -#include "../../settings/cache_settings.h" #include "../board/card_drag_item.h" #include "../board/card_item.h" #include "../player/player.h" -#include "pb/command_move_card.pb.h" #include +#include +#include HandZone::HandZone(HandZoneLogic *_logic, int _zoneHeight, QGraphicsItem *parent) : SelectZone(_logic, parent), zoneHeight(_zoneHeight) diff --git a/cockatrice/src/game/zones/logic/card_zone_logic.cpp b/cockatrice/src/game/zones/logic/card_zone_logic.cpp index 70cb21b8e..8147a0ddf 100644 --- a/cockatrice/src/game/zones/logic/card_zone_logic.cpp +++ b/cockatrice/src/game/zones/logic/card_zone_logic.cpp @@ -1,16 +1,16 @@ #include "card_zone_logic.h" -#include "../../../database/card_database_manager.h" #include "../../board/card_item.h" #include "../../player/player.h" #include "../pile_zone.h" #include "../view_zone.h" -#include "pb/command_move_card.pb.h" -#include "pb/serverinfo_user.pb.h" #include "view_zone_logic.h" #include #include +#include +#include +#include /** * @param _player the player that the zone belongs to diff --git a/cockatrice/src/game/zones/logic/view_zone_logic.cpp b/cockatrice/src/game/zones/logic/view_zone_logic.cpp index 6050cbadf..e61c126e7 100644 --- a/cockatrice/src/game/zones/logic/view_zone_logic.cpp +++ b/cockatrice/src/game/zones/logic/view_zone_logic.cpp @@ -1,8 +1,9 @@ #include "view_zone_logic.h" -#include "../../../settings/cache_settings.h" #include "../../board/card_item.h" +#include + /** * @param _player the player that the cards are revealed to. * @param _origZone the zone the cards were revealed from. diff --git a/cockatrice/src/game/zones/pile_zone.cpp b/cockatrice/src/game/zones/pile_zone.cpp index 5df91a64d..cafb29038 100644 --- a/cockatrice/src/game/zones/pile_zone.cpp +++ b/cockatrice/src/game/zones/pile_zone.cpp @@ -4,12 +4,12 @@ #include "../board/card_item.h" #include "../player/player.h" #include "logic/pile_zone_logic.h" -#include "pb/command_move_card.pb.h" #include "view_zone.h" #include #include #include +#include PileZone::PileZone(PileZoneLogic *_logic, QGraphicsItem *parent) : CardZone(_logic, parent) { diff --git a/cockatrice/src/game/zones/select_zone.cpp b/cockatrice/src/game/zones/select_zone.cpp index 863edab48..ec24e4f9f 100644 --- a/cockatrice/src/game/zones/select_zone.cpp +++ b/cockatrice/src/game/zones/select_zone.cpp @@ -1,11 +1,11 @@ #include "select_zone.h" -#include "../../settings/cache_settings.h" #include "../board/card_item.h" #include "../game_scene.h" #include #include +#include qreal divideCardSpaceInZone(qreal index, int cardCount, qreal totalHeight, qreal cardHeight, bool reverse) { diff --git a/cockatrice/src/game/zones/stack_zone.cpp b/cockatrice/src/game/zones/stack_zone.cpp index 0eedd5500..4d8c15da8 100644 --- a/cockatrice/src/game/zones/stack_zone.cpp +++ b/cockatrice/src/game/zones/stack_zone.cpp @@ -1,16 +1,16 @@ #include "stack_zone.h" #include "../../interface/theme_manager.h" -#include "../../settings/cache_settings.h" #include "../board/arrow_item.h" #include "../board/card_drag_item.h" #include "../board/card_item.h" #include "../player/player.h" #include "logic/stack_zone_logic.h" -#include "pb/command_move_card.pb.h" #include #include +#include +#include StackZone::StackZone(StackZoneLogic *_logic, int _zoneHeight, QGraphicsItem *parent) : SelectZone(_logic, parent), zoneHeight(_zoneHeight) diff --git a/cockatrice/src/game/zones/table_zone.cpp b/cockatrice/src/game/zones/table_zone.cpp index 4573cc5c3..b0484f984 100644 --- a/cockatrice/src/game/zones/table_zone.cpp +++ b/cockatrice/src/game/zones/table_zone.cpp @@ -1,19 +1,19 @@ #include "table_zone.h" -#include "../../card/card_info.h" #include "../../interface/theme_manager.h" -#include "../../settings/cache_settings.h" #include "../board/arrow_item.h" #include "../board/card_drag_item.h" #include "../board/card_item.h" #include "../player/player.h" #include "logic/table_zone_logic.h" -#include "pb/command_move_card.pb.h" -#include "pb/command_set_card_attr.pb.h" #include #include #include +#include +#include +#include +#include const QColor TableZone::BACKGROUND_COLOR = QColor(100, 100, 100); const QColor TableZone::FADE_MASK = QColor(0, 0, 0, 80); diff --git a/cockatrice/src/game/zones/view_zone.cpp b/cockatrice/src/game/zones/view_zone.cpp index 1eb99f5c1..d5eea9dfe 100644 --- a/cockatrice/src/game/zones/view_zone.cpp +++ b/cockatrice/src/game/zones/view_zone.cpp @@ -1,21 +1,21 @@ #include "view_zone.h" -#include "../../card/card_info.h" -#include "../../server/pending_command.h" #include "../board/card_drag_item.h" #include "../board/card_item.h" #include "../player/player.h" #include "logic/view_zone_logic.h" -#include "pb/command_dump_zone.pb.h" -#include "pb/command_move_card.pb.h" -#include "pb/response_dump_zone.pb.h" -#include "pb/serverinfo_card.pb.h" #include #include #include #include #include +#include +#include +#include +#include +#include +#include /** * @param parent the parent QGraphicsWidget containing the reveal zone diff --git a/cockatrice/src/game/zones/view_zone.h b/cockatrice/src/game/zones/view_zone.h index e452ecedd..06c1e77fb 100644 --- a/cockatrice/src/game/zones/view_zone.h +++ b/cockatrice/src/game/zones/view_zone.h @@ -13,7 +13,7 @@ #include #include -#include +#include inline Q_LOGGING_CATEGORY(ViewZoneLog, "view_zone"); diff --git a/cockatrice/src/game/zones/view_zone_widget.cpp b/cockatrice/src/game/zones/view_zone_widget.cpp index f0615d256..2424feb9b 100644 --- a/cockatrice/src/game/zones/view_zone_widget.cpp +++ b/cockatrice/src/game/zones/view_zone_widget.cpp @@ -2,11 +2,9 @@ #include "../../filters/syntax_help.h" #include "../../interface/pixel_map_generator.h" -#include "../../settings/cache_settings.h" #include "../board/card_item.h" #include "../game_scene.h" #include "../player/player.h" -#include "pb/command_shuffle.pb.h" #include "view_zone.h" #include @@ -18,6 +16,8 @@ #include #include #include +#include +#include /** * @param _player the player the cards were revealed to. diff --git a/cockatrice/src/game/zones/view_zone_widget.h b/cockatrice/src/game/zones/view_zone_widget.h index 862026b21..272ff5560 100644 --- a/cockatrice/src/game/zones/view_zone_widget.h +++ b/cockatrice/src/game/zones/view_zone_widget.h @@ -7,7 +7,6 @@ #ifndef ZONEVIEWWIDGET_H #define ZONEVIEWWIDGET_H -#include "../../utility/macros.h" #include "logic/card_zone_logic.h" #include @@ -15,6 +14,7 @@ #include #include #include +#include class QLabel; class QPushButton; diff --git a/cockatrice/src/picture_loader/picture_loader.cpp b/cockatrice/src/interface/card_picture_loader/card_picture_loader.cpp similarity index 65% rename from cockatrice/src/picture_loader/picture_loader.cpp rename to cockatrice/src/interface/card_picture_loader/card_picture_loader.cpp index 22f81c5dd..56b00e4b8 100644 --- a/cockatrice/src/picture_loader/picture_loader.cpp +++ b/cockatrice/src/interface/card_picture_loader/card_picture_loader.cpp @@ -1,6 +1,4 @@ -#include "picture_loader.h" - -#include "../settings/cache_settings.h" +#include "card_picture_loader.h" #include #include @@ -17,48 +15,51 @@ #include #include #include +#include #include // never cache more than 300 cards at once for a single deck #define CACHED_CARD_PER_DECK_MAX 300 -PictureLoader::PictureLoader() : QObject(nullptr) +CardPictureLoader::CardPictureLoader() : QObject(nullptr) { - worker = new PictureLoaderWorker; - connect(&SettingsCache::instance(), &SettingsCache::picsPathChanged, this, &PictureLoader::picsPathChanged); - connect(&SettingsCache::instance(), &SettingsCache::picDownloadChanged, this, &PictureLoader::picDownloadChanged); + worker = new CardPictureLoaderWorker; + connect(&SettingsCache::instance(), &SettingsCache::picsPathChanged, this, &CardPictureLoader::picsPathChanged); + connect(&SettingsCache::instance(), &SettingsCache::picDownloadChanged, this, + &CardPictureLoader::picDownloadChanged); - connect(worker, &PictureLoaderWorker::imageLoaded, this, &PictureLoader::imageLoaded); + connect(worker, &CardPictureLoaderWorker::imageLoaded, this, &CardPictureLoader::imageLoaded); - statusBar = new PictureLoaderStatusBar(nullptr); + statusBar = new CardPictureLoaderStatusBar(nullptr); QMainWindow *mainWindow = qobject_cast(QApplication::activeWindow()); if (mainWindow) { mainWindow->statusBar()->addPermanentWidget(statusBar); } - connect(worker, &PictureLoaderWorker::imageRequestQueued, statusBar, &PictureLoaderStatusBar::addQueuedImageLoad); - connect(worker, &PictureLoaderWorker::imageRequestSucceeded, statusBar, - &PictureLoaderStatusBar::addSuccessfulImageLoad); + connect(worker, &CardPictureLoaderWorker::imageRequestQueued, statusBar, + &CardPictureLoaderStatusBar::addQueuedImageLoad); + connect(worker, &CardPictureLoaderWorker::imageRequestSucceeded, statusBar, + &CardPictureLoaderStatusBar::addSuccessfulImageLoad); } -PictureLoader::~PictureLoader() +CardPictureLoader::~CardPictureLoader() { worker->deleteLater(); } -void PictureLoader::getCardBackPixmap(QPixmap &pixmap, QSize size) +void CardPictureLoader::getCardBackPixmap(QPixmap &pixmap, QSize size) { QString backCacheKey = "_trice_card_back_" + QString::number(size.width()) + "x" + QString::number(size.height()); if (!QPixmapCache::find(backCacheKey, &pixmap)) { - qCDebug(PictureLoaderLog) << "PictureLoader: cache miss for" << backCacheKey; + qCDebug(CardPictureLoaderLog) << "PictureLoader: cache miss for" << backCacheKey; QPixmap tmpPixmap("theme:cardback"); if (tmpPixmap.isNull()) { - qCWarning(PictureLoaderLog) << "Failed to load 'theme:cardback'! Using fallback pixmap."; + qCWarning(CardPictureLoaderLog) << "Failed to load 'theme:cardback'! Using fallback pixmap."; tmpPixmap = QPixmap(size); tmpPixmap.fill(Qt::gray); // Fallback to a gray pixmap } else { - qCDebug(PictureLoaderLog) << "Successfully loaded 'theme:cardback'."; + qCDebug(CardPictureLoaderLog) << "Successfully loaded 'theme:cardback'."; } pixmap = tmpPixmap.scaled(size, Qt::KeepAspectRatio, Qt::SmoothTransformation); @@ -66,20 +67,21 @@ void PictureLoader::getCardBackPixmap(QPixmap &pixmap, QSize size) } } -void PictureLoader::getCardBackLoadingInProgressPixmap(QPixmap &pixmap, QSize size) +void CardPictureLoader::getCardBackLoadingInProgressPixmap(QPixmap &pixmap, QSize size) { QString backCacheKey = "_trice_card_back_inprogress_" + QString::number(size.width()) + "x" + QString::number(size.height()); if (!QPixmapCache::find(backCacheKey, &pixmap)) { - qCDebug(PictureLoaderCardBackCacheFailLog) << "PictureLoader: cache miss for" << backCacheKey; + qCDebug(CardPictureLoaderCardBackCacheFailLog) << "PictureLoader: cache miss for" << backCacheKey; QPixmap tmpPixmap("theme:cardback"); if (tmpPixmap.isNull()) { - qCWarning(PictureLoaderLog) << "Failed to load 'theme:cardback' for in-progress state! Using fallback."; + qCWarning(CardPictureLoaderLog) << "Failed to load 'theme:cardback' for in-progress state! Using fallback."; tmpPixmap = QPixmap(size); tmpPixmap.fill(Qt::blue); // Fallback with blue color } else { - qCDebug(PictureLoaderCardBackCacheFailLog) << "Successfully loaded 'theme:cardback' for in-progress state."; + qCDebug(CardPictureLoaderCardBackCacheFailLog) + << "Successfully loaded 'theme:cardback' for in-progress state."; } pixmap = tmpPixmap.scaled(size, Qt::KeepAspectRatio, Qt::SmoothTransformation); @@ -87,20 +89,20 @@ void PictureLoader::getCardBackLoadingInProgressPixmap(QPixmap &pixmap, QSize si } } -void PictureLoader::getCardBackLoadingFailedPixmap(QPixmap &pixmap, QSize size) +void CardPictureLoader::getCardBackLoadingFailedPixmap(QPixmap &pixmap, QSize size) { QString backCacheKey = "_trice_card_back_failed_" + QString::number(size.width()) + "x" + QString::number(size.height()); if (!QPixmapCache::find(backCacheKey, &pixmap)) { - qCDebug(PictureLoaderCardBackCacheFailLog) << "PictureLoader: cache miss for" << backCacheKey; + qCDebug(CardPictureLoaderCardBackCacheFailLog) << "PictureLoader: cache miss for" << backCacheKey; QPixmap tmpPixmap("theme:cardback"); if (tmpPixmap.isNull()) { - qCWarning(PictureLoaderLog) << "Failed to load 'theme:cardback' for failed state! Using fallback."; + qCWarning(CardPictureLoaderLog) << "Failed to load 'theme:cardback' for failed state! Using fallback."; tmpPixmap = QPixmap(size); tmpPixmap.fill(Qt::red); // Fallback with red color } else { - qCDebug(PictureLoaderCardBackCacheFailLog) << "Successfully loaded 'theme:cardback' for failed state."; + qCDebug(CardPictureLoaderCardBackCacheFailLog) << "Successfully loaded 'theme:cardback' for failed state."; } pixmap = tmpPixmap.scaled(size, Qt::KeepAspectRatio, Qt::SmoothTransformation); @@ -108,10 +110,10 @@ void PictureLoader::getCardBackLoadingFailedPixmap(QPixmap &pixmap, QSize size) } } -void PictureLoader::getPixmap(QPixmap &pixmap, const ExactCard &card, QSize size) +void CardPictureLoader::getPixmap(QPixmap &pixmap, const ExactCard &card, QSize size) { if (!card) { - qCWarning(PictureLoaderLog) << "getPixmap called with null card!"; + qCWarning(CardPictureLoaderLog) << "getPixmap called with null card!"; return; } @@ -126,13 +128,13 @@ void PictureLoader::getPixmap(QPixmap &pixmap, const ExactCard &card, QSize size QPixmap bigPixmap; if (QPixmapCache::find(key, &bigPixmap)) { if (bigPixmap.isNull()) { - qCDebug(PictureLoaderLog) << "Cached pixmap for key" << key << "is NULL!"; + qCDebug(CardPictureLoaderLog) << "Cached pixmap for key" << key << "is NULL!"; return; } QScreen *screen = qApp->primaryScreen(); qreal dpr = screen ? screen->devicePixelRatio() : 1.0; - qCDebug(PictureLoaderLog) << "Scaling cached image for" << card.getName(); + qCDebug(CardPictureLoaderLog) << "Scaling cached image for" << card.getName(); pixmap = bigPixmap.scaled(size * dpr, Qt::KeepAspectRatio, Qt::SmoothTransformation); pixmap.setDevicePixelRatio(dpr); @@ -141,14 +143,14 @@ void PictureLoader::getPixmap(QPixmap &pixmap, const ExactCard &card, QSize size } // add the card to the load queue - qCDebug(PictureLoaderLog) << "Enqueuing " << card.getName() << " for " << card.getPixmapCacheKey(); + qCDebug(CardPictureLoaderLog) << "Enqueuing " << card.getName() << " for " << card.getPixmapCacheKey(); getInstance().worker->enqueueImageLoad(card); } -void PictureLoader::imageLoaded(const ExactCard &card, const QImage &image) +void CardPictureLoader::imageLoaded(const ExactCard &card, const QImage &image) { if (image.isNull()) { - qCDebug(PictureLoaderLog) << "Caching NULL pixmap for" << card.getName(); + qCDebug(CardPictureLoaderLog) << "Caching NULL pixmap for" << card.getName(); QPixmapCache::insert(card.getPixmapCacheKey(), QPixmap()); } else { if (card.getInfo().getUpsideDownArt()) { @@ -164,7 +166,7 @@ void PictureLoader::imageLoaded(const ExactCard &card, const QImage &image) } // imageLoaded should only be reached if the exactCard isn't already in cache. - // (plus there's a deduplication mechanism in PictureLoaderWorker) + // (plus there's a deduplication mechanism in CardPictureLoaderWorker) // It should be safe to connect the CardInfo here without worrying about redundant connections. connect(card.getCardPtr().data(), &QObject::destroyed, this, [cacheKey = card.getPixmapCacheKey()] { QPixmapCache::remove(cacheKey); }); @@ -172,17 +174,17 @@ void PictureLoader::imageLoaded(const ExactCard &card, const QImage &image) card.emitPixmapUpdated(); } -void PictureLoader::clearPixmapCache() +void CardPictureLoader::clearPixmapCache() { QPixmapCache::clear(); } -void PictureLoader::clearNetworkCache() +void CardPictureLoader::clearNetworkCache() { getInstance().worker->clearNetworkCache(); } -void PictureLoader::cacheCardPixmaps(const QList &cards) +void CardPictureLoader::cacheCardPixmaps(const QList &cards) { QPixmap tmp; int max = qMin(cards.size(), CACHED_CARD_PER_DECK_MAX); @@ -201,17 +203,17 @@ void PictureLoader::cacheCardPixmaps(const QList &cards) } } -void PictureLoader::picDownloadChanged() +void CardPictureLoader::picDownloadChanged() { QPixmapCache::clear(); } -void PictureLoader::picsPathChanged() +void CardPictureLoader::picsPathChanged() { QPixmapCache::clear(); } -bool PictureLoader::hasCustomArt() +bool CardPictureLoader::hasCustomArt() { auto picsPath = SettingsCache::instance().getPicsPath(); QDirIterator it(picsPath, QDir::Dirs | QDir::NoDotAndDotDot); diff --git a/cockatrice/src/picture_loader/picture_loader.h b/cockatrice/src/interface/card_picture_loader/card_picture_loader.h similarity index 53% rename from cockatrice/src/picture_loader/picture_loader.h rename to cockatrice/src/interface/card_picture_loader/card_picture_loader.h index 05a82f708..213231cd9 100644 --- a/cockatrice/src/picture_loader/picture_loader.h +++ b/cockatrice/src/interface/card_picture_loader/card_picture_loader.h @@ -1,40 +1,40 @@ /** - * @file picture_loader.h + * @file card_picture_loader.h * @ingroup PictureLoader * @brief TODO: Document this. */ -#ifndef PICTURELOADER_H -#define PICTURELOADER_H +#ifndef CARD_PICTURE_LOADER_H +#define CARD_PICTURE_LOADER_H -#include "../card/card_info.h" -#include "picture_loader_status_bar.h" -#include "picture_loader_worker.h" +#include "card_picture_loader_status_bar.h" +#include "card_picture_loader_worker.h" #include +#include -inline Q_LOGGING_CATEGORY(PictureLoaderLog, "picture_loader"); -inline Q_LOGGING_CATEGORY(PictureLoaderCardBackCacheFailLog, "picture_loader.card_back_cache_fail"); +inline Q_LOGGING_CATEGORY(CardPictureLoaderLog, "card_picture_loader"); +inline Q_LOGGING_CATEGORY(CardPictureLoaderCardBackCacheFailLog, "card_picture_loader.card_back_cache_fail"); -class PictureLoader : public QObject +class CardPictureLoader : public QObject { Q_OBJECT public: - static PictureLoader &getInstance() + static CardPictureLoader &getInstance() { - static PictureLoader instance; + static CardPictureLoader instance; return instance; } private: - explicit PictureLoader(); - ~PictureLoader() override; + explicit CardPictureLoader(); + ~CardPictureLoader() override; // Singleton - Don't implement copy constructor and assign operator - PictureLoader(PictureLoader const &); - void operator=(PictureLoader const &); + CardPictureLoader(CardPictureLoader const &); + void operator=(CardPictureLoader const &); - PictureLoaderWorker *worker; - PictureLoaderStatusBar *statusBar; + CardPictureLoaderWorker *worker; + CardPictureLoaderStatusBar *statusBar; public: static void getPixmap(QPixmap &pixmap, const ExactCard &card, QSize size); diff --git a/cockatrice/src/picture_loader/picture_loader_local.cpp b/cockatrice/src/interface/card_picture_loader/card_picture_loader_local.cpp similarity index 77% rename from cockatrice/src/picture_loader/picture_loader_local.cpp rename to cockatrice/src/interface/card_picture_loader/card_picture_loader_local.cpp index a939f2c66..0f95f03ad 100644 --- a/cockatrice/src/picture_loader/picture_loader_local.cpp +++ b/cockatrice/src/interface/card_picture_loader/card_picture_loader_local.cpp @@ -1,29 +1,30 @@ -#include "picture_loader_local.h" +#include "card_picture_loader_local.h" -#include "../database/card_database_manager.h" -#include "../settings/cache_settings.h" -#include "picture_to_load.h" +#include "card_picture_to_load.h" #include #include +#include +#include static constexpr int REFRESH_INTERVAL_MS = 10 * 1000; -PictureLoaderLocal::PictureLoaderLocal(QObject *parent) +CardPictureLoaderLocal::CardPictureLoaderLocal(QObject *parent) : QObject(parent), picsPath(SettingsCache::instance().getPicsPath()), customPicsPath(SettingsCache::instance().getCustomPicsPath()) { // Hook up signals to settings - connect(&SettingsCache::instance(), &SettingsCache::picsPathChanged, this, &PictureLoaderLocal::picsPathChanged); + connect(&SettingsCache::instance(), &SettingsCache::picsPathChanged, this, + &CardPictureLoaderLocal::picsPathChanged); refreshIndex(); refreshTimer = new QTimer(this); - connect(refreshTimer, &QTimer::timeout, this, &PictureLoaderLocal::refreshIndex); + connect(refreshTimer, &QTimer::timeout, this, &CardPictureLoaderLocal::refreshIndex); refreshTimer->start(REFRESH_INTERVAL_MS); } -void PictureLoaderLocal::refreshIndex() +void CardPictureLoaderLocal::refreshIndex() { customFolderIndex.clear(); @@ -42,8 +43,8 @@ void PictureLoaderLocal::refreshIndex() } } - qCDebug(PictureLoaderLocalLog) << "Finished indexing local image folder CUSTOM; map now has" - << customFolderIndex.size() << "entries."; + qCDebug(CardPictureLoaderLocalLog) << "Finished indexing local image folder CUSTOM; map now has" + << customFolderIndex.size() << "entries."; } /** @@ -52,7 +53,7 @@ void PictureLoaderLocal::refreshIndex() * @param toLoad The card to load * @return The loaded image, or an empty QImage if loading failed. */ -QImage PictureLoaderLocal::tryLoad(const ExactCard &toLoad) const +QImage CardPictureLoaderLocal::tryLoad(const ExactCard &toLoad) const { PrintingInfo setInstance = toLoad.getPrinting(); @@ -67,15 +68,15 @@ QImage PictureLoaderLocal::tryLoad(const ExactCard &toLoad) const providerId = setInstance.getUuid(); } - qCDebug(PictureLoaderLocalLog).nospace() + qCDebug(CardPictureLoaderLocalLog).nospace() << "[card: " << cardName << " set: " << setName << "]: Attempting to load picture from local"; return tryLoadCardImageFromDisk(setName, correctedCardName, collectorNumber, providerId); } -QImage PictureLoaderLocal::tryLoadCardImageFromDisk(const QString &setName, - const QString &correctedCardName, - const QString &collectorNumber, - const QString &providerId) const +QImage CardPictureLoaderLocal::tryLoadCardImageFromDisk(const QString &setName, + const QString &correctedCardName, + const QString &collectorNumber, + const QString &providerId) const { QImage image; QImageReader imgReader; @@ -134,7 +135,7 @@ QImage PictureLoaderLocal::tryLoadCardImageFromDisk(const QString &setName, imgReader.setFileName(fullPath); if (imgReader.read(&image)) { - qCDebug(PictureLoaderLocalLog).nospace() + qCDebug(CardPictureLoaderLocalLog).nospace() << "[card: " << correctedCardName << " set: " << setName << "] Found picture at: " << fullPath; return image; } @@ -142,12 +143,12 @@ QImage PictureLoaderLocal::tryLoadCardImageFromDisk(const QString &setName, } } - qCDebug(PictureLoaderLocalLog).nospace() + qCDebug(CardPictureLoaderLocalLog).nospace() << "[card: " << correctedCardName << " set: " << setName << "]: Picture NOT found on disk."; return QImage(); } -void PictureLoaderLocal::picsPathChanged() +void CardPictureLoaderLocal::picsPathChanged() { picsPath = SettingsCache::instance().getPicsPath(); customPicsPath = SettingsCache::instance().getCustomPicsPath(); diff --git a/cockatrice/src/picture_loader/picture_loader_local.h b/cockatrice/src/interface/card_picture_loader/card_picture_loader_local.h similarity index 78% rename from cockatrice/src/picture_loader/picture_loader_local.h rename to cockatrice/src/interface/card_picture_loader/card_picture_loader_local.h index 184f43395..1954e1698 100644 --- a/cockatrice/src/picture_loader/picture_loader_local.h +++ b/cockatrice/src/interface/card_picture_loader/card_picture_loader_local.h @@ -1,5 +1,5 @@ /** - * @file picture_loader_local.h + * @file card_picture_loader_local.h * @ingroup PictureLoader * @brief TODO: Document this. */ @@ -7,24 +7,23 @@ #ifndef PICTURE_LOADER_LOCAL_H #define PICTURE_LOADER_LOCAL_H -#include "../card/exact_card.h" - #include #include #include +#include -inline Q_LOGGING_CATEGORY(PictureLoaderLocalLog, "picture_loader.local"); +inline Q_LOGGING_CATEGORY(CardPictureLoaderLocalLog, "card_picture_loader.local"); /** * Handles searching for and loading card images from the local pics and custom image folders. * This class maintains an index of the CUSTOM folder, to avoid repeatedly searching the entire directory. */ -class PictureLoaderLocal : public QObject +class CardPictureLoaderLocal : public QObject { Q_OBJECT public: - explicit PictureLoaderLocal(QObject *parent); + explicit CardPictureLoaderLocal(QObject *parent); QImage tryLoad(const ExactCard &toLoad) const; diff --git a/cockatrice/src/picture_loader/picture_loader_request_status_display_widget.cpp b/cockatrice/src/interface/card_picture_loader/card_picture_loader_request_status_display_widget.cpp similarity index 74% rename from cockatrice/src/picture_loader/picture_loader_request_status_display_widget.cpp rename to cockatrice/src/interface/card_picture_loader/card_picture_loader_request_status_display_widget.cpp index 6403f576c..d1895af06 100644 --- a/cockatrice/src/picture_loader/picture_loader_request_status_display_widget.cpp +++ b/cockatrice/src/interface/card_picture_loader/card_picture_loader_request_status_display_widget.cpp @@ -1,9 +1,9 @@ -#include "picture_loader_request_status_display_widget.h" +#include "card_picture_loader_request_status_display_widget.h" -PictureLoaderRequestStatusDisplayWidget::PictureLoaderRequestStatusDisplayWidget(QWidget *parent, - const QUrl &_url, - const ExactCard &card, - const QString &setName) +CardPictureLoaderRequestStatusDisplayWidget::CardPictureLoaderRequestStatusDisplayWidget(QWidget *parent, + const QUrl &_url, + const ExactCard &card, + const QString &setName) : QWidget(parent) { layout = new QHBoxLayout(this); diff --git a/cockatrice/src/picture_loader/picture_loader_request_status_display_widget.h b/cockatrice/src/interface/card_picture_loader/card_picture_loader_request_status_display_widget.h similarity index 75% rename from cockatrice/src/picture_loader/picture_loader_request_status_display_widget.h rename to cockatrice/src/interface/card_picture_loader/card_picture_loader_request_status_display_widget.h index b74412587..be032ae64 100644 --- a/cockatrice/src/picture_loader/picture_loader_request_status_display_widget.h +++ b/cockatrice/src/interface/card_picture_loader/card_picture_loader_request_status_display_widget.h @@ -1,25 +1,25 @@ /** - * @file picture_loader_request_status_display_widget.h + * @file card_picture_loader_request_status_display_widget.h * @ingroup PictureLoader * @brief TODO: Document this. */ #ifndef PICTURE_LOADER_REQUEST_STATUS_DISPLAY_WIDGET_H #define PICTURE_LOADER_REQUEST_STATUS_DISPLAY_WIDGET_H -#include "picture_loader_worker_work.h" +#include "card_picture_loader_worker_work.h" #include #include #include -class PictureLoaderRequestStatusDisplayWidget : public QWidget +class CardPictureLoaderRequestStatusDisplayWidget : public QWidget { Q_OBJECT public: - PictureLoaderRequestStatusDisplayWidget(QWidget *parent, - const QUrl &url, - const ExactCard &card, - const QString &setName); + CardPictureLoaderRequestStatusDisplayWidget(QWidget *parent, + const QUrl &url, + const ExactCard &card, + const QString &setName); void setFinished() { diff --git a/cockatrice/src/picture_loader/picture_loader_status_bar.cpp b/cockatrice/src/interface/card_picture_loader/card_picture_loader_status_bar.cpp similarity index 54% rename from cockatrice/src/picture_loader/picture_loader_status_bar.cpp rename to cockatrice/src/interface/card_picture_loader/card_picture_loader_status_bar.cpp index 40104bb23..9e7e645bd 100644 --- a/cockatrice/src/picture_loader/picture_loader_status_bar.cpp +++ b/cockatrice/src/interface/card_picture_loader/card_picture_loader_status_bar.cpp @@ -1,8 +1,8 @@ -#include "picture_loader_status_bar.h" +#include "card_picture_loader_status_bar.h" -#include "picture_loader_request_status_display_widget.h" +#include "card_picture_loader_request_status_display_widget.h" -PictureLoaderStatusBar::PictureLoaderStatusBar(QWidget *parent) : QWidget(parent) +CardPictureLoaderStatusBar::CardPictureLoaderStatusBar(QWidget *parent) : QWidget(parent) { layout = new QHBoxLayout(this); progressBar = new QProgressBar(this); @@ -15,19 +15,19 @@ PictureLoaderStatusBar::PictureLoaderStatusBar(QWidget *parent) : QWidget(parent cleaner = new QTimer(this); cleaner->setInterval(1000); - connect(cleaner, &QTimer::timeout, this, &PictureLoaderStatusBar::cleanOldEntries); + connect(cleaner, &QTimer::timeout, this, &CardPictureLoaderStatusBar::cleanOldEntries); cleaner->start(); setLayout(layout); } -void PictureLoaderStatusBar::cleanOldEntries() +void CardPictureLoaderStatusBar::cleanOldEntries() { if (!loadLog || !loadLog->popup) { return; } - for (PictureLoaderRequestStatusDisplayWidget *statusDisplayWidget : - loadLog->popup->findChildren()) { + for (CardPictureLoaderRequestStatusDisplayWidget *statusDisplayWidget : + loadLog->popup->findChildren()) { statusDisplayWidget->queryElapsedSeconds(); if (statusDisplayWidget->getFinished() && QDateTime::fromString(statusDisplayWidget->getStartTime()).secsTo(QDateTime::currentDateTime()) > 10) { @@ -38,17 +38,17 @@ void PictureLoaderStatusBar::cleanOldEntries() } } -void PictureLoaderStatusBar::addQueuedImageLoad(const QUrl &url, const ExactCard &card, const QString &setName) +void CardPictureLoaderStatusBar::addQueuedImageLoad(const QUrl &url, const ExactCard &card, const QString &setName) { - loadLog->addSettingsWidget(new PictureLoaderRequestStatusDisplayWidget(loadLog, url, card, setName)); + loadLog->addSettingsWidget(new CardPictureLoaderRequestStatusDisplayWidget(loadLog, url, card, setName)); progressBar->setMaximum(progressBar->maximum() + 1); } -void PictureLoaderStatusBar::addSuccessfulImageLoad(const QUrl &url) +void CardPictureLoaderStatusBar::addSuccessfulImageLoad(const QUrl &url) { progressBar->setValue(progressBar->value() + 1); - for (PictureLoaderRequestStatusDisplayWidget *statusDisplayWidget : - loadLog->popup->findChildren()) { + for (CardPictureLoaderRequestStatusDisplayWidget *statusDisplayWidget : + loadLog->popup->findChildren()) { if (statusDisplayWidget->getUrl() == url.toString()) { statusDisplayWidget->queryElapsedSeconds(); statusDisplayWidget->setFinished(); diff --git a/cockatrice/src/picture_loader/picture_loader_status_bar.h b/cockatrice/src/interface/card_picture_loader/card_picture_loader_status_bar.h similarity index 68% rename from cockatrice/src/picture_loader/picture_loader_status_bar.h rename to cockatrice/src/interface/card_picture_loader/card_picture_loader_status_bar.h index 366018d0e..b44d2cc20 100644 --- a/cockatrice/src/picture_loader/picture_loader_status_bar.h +++ b/cockatrice/src/interface/card_picture_loader/card_picture_loader_status_bar.h @@ -1,5 +1,5 @@ /** - * @file picture_loader_status_bar.h + * @file card_picture_loader_status_bar.h * @ingroup PictureLoader * @brief TODO: Document this. */ @@ -7,18 +7,18 @@ #ifndef PICTURE_LOADER_STATUS_BAR_H #define PICTURE_LOADER_STATUS_BAR_H -#include "../interface/widgets/quick_settings/settings_button_widget.h" -#include "picture_loader_worker_work.h" +#include "../../interface/widgets/quick_settings/settings_button_widget.h" +#include "card_picture_loader_worker_work.h" #include #include #include -class PictureLoaderStatusBar : public QWidget +class CardPictureLoaderStatusBar : public QWidget { Q_OBJECT public: - explicit PictureLoaderStatusBar(QWidget *parent); + explicit CardPictureLoaderStatusBar(QWidget *parent); public slots: void addQueuedImageLoad(const QUrl &url, const ExactCard &card, const QString &setName); diff --git a/cockatrice/src/picture_loader/picture_loader_worker.cpp b/cockatrice/src/interface/card_picture_loader/card_picture_loader_worker.cpp similarity index 78% rename from cockatrice/src/picture_loader/picture_loader_worker.cpp rename to cockatrice/src/interface/card_picture_loader/card_picture_loader_worker.cpp index 42429d0e3..301b0d4fb 100644 --- a/cockatrice/src/picture_loader/picture_loader_worker.cpp +++ b/cockatrice/src/interface/card_picture_loader/card_picture_loader_worker.cpp @@ -1,20 +1,20 @@ -#include "picture_loader_worker.h" +#include "card_picture_loader_worker.h" -#include "../database/card_database_manager.h" -#include "../settings/cache_settings.h" -#include "picture_loader_local.h" -#include "picture_loader_worker_work.h" +#include "card_picture_loader_local.h" +#include "card_picture_loader_worker_work.h" #include #include #include #include #include +#include +#include #include static constexpr int MAX_REQUESTS_PER_SEC = 10; -PictureLoaderWorker::PictureLoaderWorker() +CardPictureLoaderWorker::CardPictureLoaderWorker() : QObject(nullptr), picDownload(SettingsCache::instance().getPicDownload()), requestQuota(MAX_REQUESTS_PER_SEC) { networkManager = new QNetworkAccessManager(this); @@ -41,28 +41,28 @@ PictureLoaderWorker::PictureLoaderWorker() cleanStaleEntries(); connect(QCoreApplication::instance(), &QCoreApplication::aboutToQuit, this, - &PictureLoaderWorker::saveRedirectCache); + &CardPictureLoaderWorker::saveRedirectCache); - localLoader = new PictureLoaderLocal(this); + localLoader = new CardPictureLoaderLocal(this); pictureLoaderThread = new QThread; pictureLoaderThread->start(QThread::LowPriority); moveToThread(pictureLoaderThread); - connect(this, &PictureLoaderWorker::imageLoadEnqueued, this, &PictureLoaderWorker::handleImageLoadEnqueued); + connect(this, &CardPictureLoaderWorker::imageLoadEnqueued, this, &CardPictureLoaderWorker::handleImageLoadEnqueued); - connect(&requestTimer, &QTimer::timeout, this, &PictureLoaderWorker::resetRequestQuota); + connect(&requestTimer, &QTimer::timeout, this, &CardPictureLoaderWorker::resetRequestQuota); requestTimer.setInterval(1000); requestTimer.start(); } -PictureLoaderWorker::~PictureLoaderWorker() +CardPictureLoaderWorker::~CardPictureLoaderWorker() { saveRedirectCache(); pictureLoaderThread->deleteLater(); } -void PictureLoaderWorker::queueRequest(const QUrl &url, PictureLoaderWorkerWork *worker) +void CardPictureLoaderWorker::queueRequest(const QUrl &url, CardPictureLoaderWorkerWork *worker) { QUrl cachedRedirect = getCachedRedirect(url); if (!cachedRedirect.isEmpty()) { @@ -77,7 +77,7 @@ void PictureLoaderWorker::queueRequest(const QUrl &url, PictureLoaderWorkerWork } } -QNetworkReply *PictureLoaderWorker::makeRequest(const QUrl &url, PictureLoaderWorkerWork *worker) +QNetworkReply *CardPictureLoaderWorker::makeRequest(const QUrl &url, CardPictureLoaderWorkerWork *worker) { // Check for cached redirects QUrl cachedRedirect = getCachedRedirect(url); @@ -99,7 +99,7 @@ QNetworkReply *PictureLoaderWorker::makeRequest(const QUrl &url, PictureLoaderWo return reply; } -void PictureLoaderWorker::resetRequestQuota() +void CardPictureLoaderWorker::resetRequestQuota() { requestQuota = MAX_REQUESTS_PER_SEC; processQueuedRequests(); @@ -108,7 +108,7 @@ void PictureLoaderWorker::resetRequestQuota() /** * Keeps processing requests from the queue until it is empty or until the quota runs out. */ -void PictureLoaderWorker::processQueuedRequests() +void CardPictureLoaderWorker::processQueuedRequests() { while (requestQuota > 0 && processSingleRequest()) { --requestQuota; @@ -119,7 +119,7 @@ void PictureLoaderWorker::processQueuedRequests() * Immediately processes a single queued request. No-ops if the load queue is empty * @return If a request was processed */ -bool PictureLoaderWorker::processSingleRequest() +bool CardPictureLoaderWorker::processSingleRequest() { if (!requestLoadQueue.isEmpty()) { auto request = requestLoadQueue.takeFirst(); @@ -129,17 +129,17 @@ bool PictureLoaderWorker::processSingleRequest() return false; } -void PictureLoaderWorker::enqueueImageLoad(const ExactCard &card) +void CardPictureLoaderWorker::enqueueImageLoad(const ExactCard &card) { // Send call through a connection to ensure the handling is run on the pictureLoader thread emit imageLoadEnqueued(card); } -void PictureLoaderWorker::handleImageLoadEnqueued(const ExactCard &card) +void CardPictureLoaderWorker::handleImageLoadEnqueued(const ExactCard &card) { // deduplicate loads for the same card if (currentlyLoading.contains(card.getPixmapCacheKey())) { - qCDebug(PictureLoaderWorkerLog()) + qCDebug(CardPictureLoaderWorkerLog()) << "Skipping enqueued" << card.getName() << "because it's already being loaded"; return; } @@ -151,31 +151,31 @@ void PictureLoaderWorker::handleImageLoadEnqueued(const ExactCard &card) handleImageLoaded(card, image); } else { // queue up to load image from remote only after local loading failed - new PictureLoaderWorkerWork(this, card); + new CardPictureLoaderWorkerWork(this, card); } } /** * Called when image loading is done. Failures are indicated by an empty QImage. */ -void PictureLoaderWorker::handleImageLoaded(const ExactCard &card, const QImage &image) +void CardPictureLoaderWorker::handleImageLoaded(const ExactCard &card, const QImage &image) { currentlyLoading.remove(card.getPixmapCacheKey()); emit imageLoaded(card, image); } -void PictureLoaderWorker::cacheRedirect(const QUrl &originalUrl, const QUrl &redirectUrl) +void CardPictureLoaderWorker::cacheRedirect(const QUrl &originalUrl, const QUrl &redirectUrl) { redirectCache[originalUrl] = qMakePair(redirectUrl, QDateTime::currentDateTimeUtc()); // saveRedirectCache(); } -void PictureLoaderWorker::removedCachedUrl(const QUrl &url) +void CardPictureLoaderWorker::removedCachedUrl(const QUrl &url) { networkManager->cache()->remove(url); } -QUrl PictureLoaderWorker::getCachedRedirect(const QUrl &originalUrl) const +QUrl CardPictureLoaderWorker::getCachedRedirect(const QUrl &originalUrl) const { if (redirectCache.contains(originalUrl)) { return redirectCache[originalUrl].first; @@ -183,7 +183,7 @@ QUrl PictureLoaderWorker::getCachedRedirect(const QUrl &originalUrl) const return {}; } -void PictureLoaderWorker::loadRedirectCache() +void CardPictureLoaderWorker::loadRedirectCache() { QSettings settings(cacheFilePath, QSettings::IniFormat); @@ -202,7 +202,7 @@ void PictureLoaderWorker::loadRedirectCache() settings.endArray(); } -void PictureLoaderWorker::saveRedirectCache() const +void CardPictureLoaderWorker::saveRedirectCache() const { QSettings settings(cacheFilePath, QSettings::IniFormat); @@ -217,7 +217,7 @@ void PictureLoaderWorker::saveRedirectCache() const settings.endArray(); } -void PictureLoaderWorker::cleanStaleEntries() +void CardPictureLoaderWorker::cleanStaleEntries() { QDateTime now = QDateTime::currentDateTimeUtc(); @@ -231,7 +231,7 @@ void PictureLoaderWorker::cleanStaleEntries() } } -void PictureLoaderWorker::clearNetworkCache() +void CardPictureLoaderWorker::clearNetworkCache() { networkManager->cache()->clear(); redirectCache.clear(); diff --git a/cockatrice/src/picture_loader/picture_loader_worker.h b/cockatrice/src/interface/card_picture_loader/card_picture_loader_worker.h similarity index 67% rename from cockatrice/src/picture_loader/picture_loader_worker.h rename to cockatrice/src/interface/card_picture_loader/card_picture_loader_worker.h index 778ce71a0..028ffbf85 100644 --- a/cockatrice/src/picture_loader/picture_loader_worker.h +++ b/cockatrice/src/interface/card_picture_loader/card_picture_loader_worker.h @@ -1,5 +1,5 @@ /** - * @file picture_loader_worker.h + * @file card_picture_loader_worker.h * @ingroup PictureLoader * @brief TODO: Document this. */ @@ -7,11 +7,9 @@ #ifndef PICTURE_LOADER_WORKER_H #define PICTURE_LOADER_WORKER_H -#include "../card/card_info.h" -#include "../database/card_database.h" -#include "picture_loader_local.h" -#include "picture_loader_worker_work.h" -#include "picture_to_load.h" +#include "card_picture_loader_local.h" +#include "card_picture_loader_worker_work.h" +#include "card_picture_to_load.h" #include #include @@ -20,6 +18,8 @@ #include #include #include +#include +#include #define REDIRECT_HEADER_NAME "redirects" #define REDIRECT_ORIGINAL_URL "original" @@ -27,22 +27,22 @@ #define REDIRECT_TIMESTAMP "timestamp" #define REDIRECT_CACHE_FILENAME "cache.ini" -inline Q_LOGGING_CATEGORY(PictureLoaderWorkerLog, "picture_loader.worker"); +inline Q_LOGGING_CATEGORY(CardPictureLoaderWorkerLog, "card_picture_loader.worker"); -class PictureLoaderWorkerWork; -class PictureLoaderWorker : public QObject +class CardPictureLoaderWorkerWork; +class CardPictureLoaderWorker : public QObject { Q_OBJECT public: - explicit PictureLoaderWorker(); - ~PictureLoaderWorker() override; + explicit CardPictureLoaderWorker(); + ~CardPictureLoaderWorker() override; - void enqueueImageLoad(const ExactCard &card); // Starts a thread for the image to be loaded - void queueRequest(const QUrl &url, PictureLoaderWorkerWork *worker); // Queues network requests for load threads + void enqueueImageLoad(const ExactCard &card); // Starts a thread for the image to be loaded + void queueRequest(const QUrl &url, CardPictureLoaderWorkerWork *worker); // Queues network requests for load threads void clearNetworkCache(); public slots: - QNetworkReply *makeRequest(const QUrl &url, PictureLoaderWorkerWork *workThread); + QNetworkReply *makeRequest(const QUrl &url, CardPictureLoaderWorkerWork *workThread); void processQueuedRequests(); bool processSingleRequest(); void handleImageLoaded(const ExactCard &card, const QImage &image); @@ -57,12 +57,12 @@ private: QString cacheFilePath; // Path to persistent storage static constexpr int CacheTTLInDays = 30; // TODO: Make user configurable bool picDownload; - QQueue> requestLoadQueue; + QQueue> requestLoadQueue; int requestQuota; QTimer requestTimer; // Timer for refreshing request quota - PictureLoaderLocal *localLoader; + CardPictureLoaderLocal *localLoader; QSet currentlyLoading; // for deduplication purposes. Contains pixmapCacheKey QUrl getCachedRedirect(const QUrl &originalUrl) const; diff --git a/cockatrice/src/picture_loader/picture_loader_worker_work.cpp b/cockatrice/src/interface/card_picture_loader/card_picture_loader_worker_work.cpp similarity index 75% rename from cockatrice/src/picture_loader/picture_loader_worker_work.cpp rename to cockatrice/src/interface/card_picture_loader/card_picture_loader_worker_work.cpp index 4d9fb9354..ba0e6e7e1 100644 --- a/cockatrice/src/picture_loader/picture_loader_worker_work.cpp +++ b/cockatrice/src/interface/card_picture_loader/card_picture_loader_worker_work.cpp @@ -1,8 +1,6 @@ -#include "picture_loader_worker_work.h" +#include "card_picture_loader_worker_work.h" -#include "../database/card_database_manager.h" -#include "../settings/cache_settings.h" -#include "picture_loader_worker.h" +#include "card_picture_loader_worker.h" #include #include @@ -12,19 +10,24 @@ #include #include #include +#include +#include // Card back returned by gatherer when card is not found static const QStringList MD5_BLACKLIST = {"db0c48db407a907c16ade38de048a441"}; -PictureLoaderWorkerWork::PictureLoaderWorkerWork(const PictureLoaderWorker *worker, const ExactCard &toLoad) - : QObject(nullptr), cardToDownload(PictureToLoad(toLoad)), picDownload(SettingsCache::instance().getPicDownload()) +CardPictureLoaderWorkerWork::CardPictureLoaderWorkerWork(const CardPictureLoaderWorker *worker, const ExactCard &toLoad) + : QObject(nullptr), cardToDownload(CardPictureToLoad(toLoad)), + picDownload(SettingsCache::instance().getPicDownload()) { // Hook up signals to the orchestrator - connect(this, &PictureLoaderWorkerWork::requestImageDownload, worker, &PictureLoaderWorker::queueRequest); - connect(this, &PictureLoaderWorkerWork::urlRedirected, worker, &PictureLoaderWorker::cacheRedirect); - connect(this, &PictureLoaderWorkerWork::cachedUrlInvalidated, worker, &PictureLoaderWorker::removedCachedUrl); - connect(this, &PictureLoaderWorkerWork::imageLoaded, worker, &PictureLoaderWorker::handleImageLoaded); - connect(this, &PictureLoaderWorkerWork::requestSucceeded, worker, &PictureLoaderWorker::imageRequestSucceeded); + connect(this, &CardPictureLoaderWorkerWork::requestImageDownload, worker, &CardPictureLoaderWorker::queueRequest); + connect(this, &CardPictureLoaderWorkerWork::urlRedirected, worker, &CardPictureLoaderWorker::cacheRedirect); + connect(this, &CardPictureLoaderWorkerWork::cachedUrlInvalidated, worker, + &CardPictureLoaderWorker::removedCachedUrl); + connect(this, &CardPictureLoaderWorkerWork::imageLoaded, worker, &CardPictureLoaderWorker::handleImageLoaded); + connect(this, &CardPictureLoaderWorkerWork::requestSucceeded, worker, + &CardPictureLoaderWorker::imageRequestSucceeded); // Hook up signals to settings connect(&SettingsCache::instance(), SIGNAL(picDownloadChanged()), this, SLOT(picDownloadChanged())); @@ -32,7 +35,7 @@ PictureLoaderWorkerWork::PictureLoaderWorkerWork(const PictureLoaderWorker *work startNextPicDownload(); } -void PictureLoaderWorkerWork::startNextPicDownload() +void CardPictureLoaderWorkerWork::startNextPicDownload() { QString picUrl = cardToDownload.getCurrentUrl(); @@ -40,7 +43,7 @@ void PictureLoaderWorkerWork::startNextPicDownload() picDownloadFailed(); } else { QUrl url(picUrl); - qCDebug(PictureLoaderWorkerWorkLog).nospace() + qCDebug(CardPictureLoaderWorkerWorkLog).nospace() << "PictureLoader: [card: " << cardToDownload.getCard().getInfo().getCorrectedName() << " set: " << cardToDownload.getSetName() << "]: Trying to fetch picture from url " << url.toDisplayString(); @@ -52,7 +55,7 @@ void PictureLoaderWorkerWork::startNextPicDownload() * Starts another pic download using the next possible url combination for the card. * If all possibilities are exhausted, then concludes the image loading with an empty QImage. */ -void PictureLoaderWorkerWork::picDownloadFailed() +void CardPictureLoaderWorkerWork::picDownloadFailed() { /* Take advantage of short-circuiting here to call the nextUrl until one is not available. Only once nextUrl evaluates to false will this move @@ -61,7 +64,7 @@ void PictureLoaderWorkerWork::picDownloadFailed() if (cardToDownload.nextUrl() || cardToDownload.nextSet()) { startNextPicDownload(); } else { - qCWarning(PictureLoaderWorkerWorkLog).nospace() + qCWarning(CardPictureLoaderWorkerWorkLog).nospace() << "PictureLoader: [card: " << cardToDownload.getCard().getInfo().getCorrectedName() << " set: " << cardToDownload.getSetName() << "]: Picture NOT found, " << (picDownload ? "download failed" : "downloads disabled") @@ -74,7 +77,7 @@ void PictureLoaderWorkerWork::picDownloadFailed() * * @param reply The reply. Takes ownership of the object */ -void PictureLoaderWorkerWork::handleNetworkReply(QNetworkReply *reply) +void CardPictureLoaderWorkerWork::handleNetworkReply(QNetworkReply *reply) { QVariant redirectTarget = reply->attribute(QNetworkRequest::RedirectionTargetAttribute); if (redirectTarget.isValid()) { @@ -102,15 +105,15 @@ static bool imageIsBlackListed(const QByteArray &picData) return MD5_BLACKLIST.contains(md5sum); } -void PictureLoaderWorkerWork::handleFailedReply(const QNetworkReply *reply) +void CardPictureLoaderWorkerWork::handleFailedReply(const QNetworkReply *reply) { if (reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt() == 429) { - qCWarning(PictureLoaderWorkerWorkLog) << "Too many requests."; + qCWarning(CardPictureLoaderWorkerWorkLog) << "Too many requests."; } else { bool isFromCache = reply->attribute(QNetworkRequest::SourceIsFromCacheAttribute).toBool(); if (isFromCache) { - qCDebug(PictureLoaderWorkerWorkLog).nospace() + qCDebug(CardPictureLoaderWorkerWorkLog).nospace() << "PictureLoader: [card: " << cardToDownload.getCard().getName() << " set: " << cardToDownload.getSetName() << "]: Removing corrupted cache file for url " << reply->url().toDisplayString() << " and retrying (" << reply->errorString() << ")"; @@ -119,7 +122,7 @@ void PictureLoaderWorkerWork::handleFailedReply(const QNetworkReply *reply) emit requestImageDownload(reply->url(), this); } else { - qCDebug(PictureLoaderWorkerWorkLog).nospace() + qCDebug(CardPictureLoaderWorkerWorkLog).nospace() << "PictureLoader: [card: " << cardToDownload.getCard().getName() << " set: " << cardToDownload.getSetName() << "]: " << (picDownload ? "Download" : "Cache search") << " failed for url " << reply->url().toDisplayString() << " (" << reply->errorString() << ")"; @@ -129,7 +132,7 @@ void PictureLoaderWorkerWork::handleFailedReply(const QNetworkReply *reply) } } -void PictureLoaderWorkerWork::handleSuccessfulReply(QNetworkReply *reply) +void CardPictureLoaderWorkerWork::handleSuccessfulReply(QNetworkReply *reply) { bool isFromCache = reply->attribute(QNetworkRequest::SourceIsFromCacheAttribute).toBool(); @@ -138,7 +141,7 @@ void PictureLoaderWorkerWork::handleSuccessfulReply(QNetworkReply *reply) if (statusCode == 301 || statusCode == 302 || statusCode == 303 || statusCode == 305 || statusCode == 307 || statusCode == 308) { QUrl redirectUrl = reply->header(QNetworkRequest::LocationHeader).toUrl(); - qCDebug(PictureLoaderWorkerWorkLog).nospace() + qCDebug(CardPictureLoaderWorkerWorkLog).nospace() << "PictureLoader: [card: " << cardToDownload.getCard().getName() << " set: " << cardToDownload.getSetName() << "]: following " << (isFromCache ? "cached redirect" : "redirect") << " to " << redirectUrl.toDisplayString(); @@ -150,7 +153,7 @@ void PictureLoaderWorkerWork::handleSuccessfulReply(QNetworkReply *reply) const QByteArray &picData = reply->peek(reply->size()); if (imageIsBlackListed(picData)) { - qCDebug(PictureLoaderWorkerWorkLog).nospace() + qCDebug(CardPictureLoaderWorkerWorkLog).nospace() << "PictureLoader: [card: " << cardToDownload.getCard().getName() << " set: " << cardToDownload.getSetName() << "]: Picture found, but blacklisted, will consider it as not found"; @@ -161,14 +164,14 @@ void PictureLoaderWorkerWork::handleSuccessfulReply(QNetworkReply *reply) QImage image = tryLoadImageFromReply(reply); if (image.isNull()) { - qCDebug(PictureLoaderWorkerWorkLog).nospace() + qCDebug(CardPictureLoaderWorkerWorkLog).nospace() << "PictureLoader: [card: " << cardToDownload.getCard().getName() << " set: " << cardToDownload.getSetName() << "]: Possible " << (isFromCache ? "cached" : "downloaded") << " picture at " << reply->url().toDisplayString() << " could not be loaded: " << reply->errorString(); picDownloadFailed(); } else { - qCDebug(PictureLoaderWorkerWorkLog).nospace() + qCDebug(CardPictureLoaderWorkerWorkLog).nospace() << "PictureLoader: [card: " << cardToDownload.getCard().getName() << " set: " << cardToDownload.getSetName() << "]: Image successfully " << (isFromCache ? "loaded from cached" : "downloaded from") << " url " << reply->url().toDisplayString(); @@ -181,7 +184,7 @@ void PictureLoaderWorkerWork::handleSuccessfulReply(QNetworkReply *reply) * @param reply The reply to load the image from * @return The loaded image, or an empty QImage if loading failed */ -QImage PictureLoaderWorkerWork::tryLoadImageFromReply(QNetworkReply *reply) +QImage CardPictureLoaderWorkerWork::tryLoadImageFromReply(QNetworkReply *reply) { static constexpr int riffHeaderSize = 12; // RIFF_HEADER_SIZE from webp/format_constants.h auto replyHeader = reply->peek(riffHeaderSize); @@ -208,13 +211,13 @@ QImage PictureLoaderWorkerWork::tryLoadImageFromReply(QNetworkReply *reply) * Call this method when the image has finished being loaded. * @param image The image that was loaded. Empty QImage indicates failure. */ -void PictureLoaderWorkerWork::concludeImageLoad(const QImage &image) +void CardPictureLoaderWorkerWork::concludeImageLoad(const QImage &image) { emit imageLoaded(cardToDownload.getCard(), image); deleteLater(); } -void PictureLoaderWorkerWork::picDownloadChanged() +void CardPictureLoaderWorkerWork::picDownloadChanged() { picDownload = SettingsCache::instance().getPicDownload(); } diff --git a/cockatrice/src/picture_loader/picture_loader_worker_work.h b/cockatrice/src/interface/card_picture_loader/card_picture_loader_worker_work.h similarity index 74% rename from cockatrice/src/picture_loader/picture_loader_worker_work.h rename to cockatrice/src/interface/card_picture_loader/card_picture_loader_worker_work.h index f40cc61b9..69b18a5fd 100644 --- a/cockatrice/src/picture_loader/picture_loader_worker_work.h +++ b/cockatrice/src/interface/card_picture_loader/card_picture_loader_worker_work.h @@ -7,15 +7,15 @@ #ifndef PICTURE_LOADER_WORKER_WORK_H #define PICTURE_LOADER_WORKER_WORK_H -#include "../database/card_database.h" -#include "picture_loader_worker.h" -#include "picture_to_load.h" +#include "card_picture_loader_worker.h" +#include "card_picture_to_load.h" #include #include #include #include #include +#include #define REDIRECT_HEADER_NAME "redirects" #define REDIRECT_ORIGINAL_URL "original" @@ -23,17 +23,17 @@ #define REDIRECT_TIMESTAMP "timestamp" #define REDIRECT_CACHE_FILENAME "cache.ini" -inline Q_LOGGING_CATEGORY(PictureLoaderWorkerWorkLog, "picture_loader.worker"); +inline Q_LOGGING_CATEGORY(CardPictureLoaderWorkerWorkLog, "card_picture_loader.worker"); -class PictureLoaderWorker; +class CardPictureLoaderWorker; -class PictureLoaderWorkerWork : public QObject +class CardPictureLoaderWorkerWork : public QObject { Q_OBJECT public: - explicit PictureLoaderWorkerWork(const PictureLoaderWorker *worker, const ExactCard &toLoad); + explicit CardPictureLoaderWorkerWork(const CardPictureLoaderWorker *worker, const ExactCard &toLoad); - PictureToLoad cardToDownload; + CardPictureToLoad cardToDownload; public slots: void handleNetworkReply(QNetworkReply *reply); @@ -63,7 +63,7 @@ signals: * Emitted when a request did not return a 400 or 500 response */ void requestSucceeded(const QUrl &url); - void requestImageDownload(const QUrl &url, PictureLoaderWorkerWork *instance); + void requestImageDownload(const QUrl &url, CardPictureLoaderWorkerWork *instance); void urlRedirected(const QUrl &originalUrl, const QUrl &redirectUrl); void cachedUrlInvalidated(const QUrl &url); diff --git a/cockatrice/src/picture_loader/picture_to_load.cpp b/cockatrice/src/interface/card_picture_loader/card_picture_to_load.cpp similarity index 93% rename from cockatrice/src/picture_loader/picture_to_load.cpp rename to cockatrice/src/interface/card_picture_loader/card_picture_to_load.cpp index f70f23d33..1908a6b80 100644 --- a/cockatrice/src/picture_loader/picture_to_load.cpp +++ b/cockatrice/src/interface/card_picture_loader/card_picture_to_load.cpp @@ -1,15 +1,14 @@ -#include "picture_to_load.h" - -#include "../settings/cache_settings.h" -#include "../utility/card_set_comparator.h" +#include "card_picture_to_load.h" #include #include #include #include #include +#include +#include -PictureToLoad::PictureToLoad(const ExactCard &_card) +CardPictureToLoad::CardPictureToLoad(const ExactCard &_card) : card(_card), urlTemplates(SettingsCache::instance().downloads().getAllURLs()) { if (card) { @@ -25,7 +24,7 @@ PictureToLoad::PictureToLoad(const ExactCard &_card) * * @return A list of sets. Will not be empty. */ -QList PictureToLoad::extractSetsSorted(const ExactCard &card) +QList CardPictureToLoad::extractSetsSorted(const ExactCard &card) { QList sortedSets; for (const auto &printings : card.getInfo().getSets()) { @@ -80,7 +79,7 @@ static PrintingInfo findPrintingForSet(const ExactCard &card, const QString &set return setsToPrintings[setName][0]; } -void PictureToLoad::populateSetUrls() +void CardPictureToLoad::populateSetUrls() { /* currentSetUrls is a list, populated each time a new set is requested for a particular card and Urls are removed from it as a download is attempted from each one. Custom Urls for @@ -113,7 +112,7 @@ void PictureToLoad::populateSetUrls() * If we are already at the end of the list, then currentSet is set to empty. * @return If we are already at the end of the list */ -bool PictureToLoad::nextSet() +bool CardPictureToLoad::nextSet() { if (!sortedSets.isEmpty()) { currentSet = sortedSets.takeFirst(); @@ -129,7 +128,7 @@ bool PictureToLoad::nextSet() * If we are already at the end of the list, then currentUrl is set to empty. * @return If we are already at the end of the list */ -bool PictureToLoad::nextUrl() +bool CardPictureToLoad::nextUrl() { if (!currentSetUrls.isEmpty()) { currentUrl = currentSetUrls.takeFirst(); @@ -139,7 +138,7 @@ bool PictureToLoad::nextUrl() return false; } -QString PictureToLoad::getSetName() const +QString CardPictureToLoad::getSetName() const { if (currentSet) { return currentSet->getCorrectedShortName(); @@ -185,7 +184,7 @@ static int parse(const QString &urlTemplate, } QString propertyValue = getProperty(cardPropertyName); if (propertyValue.isEmpty()) { - qCDebug(PictureToLoadLog).nospace() + qCDebug(CardPictureToLoadLog).nospace() << "PictureLoader: [card: " << cardName << " set: " << setName << "]: Requested " << propType << "property (" << cardPropertyName << ") for Url template (" << urlTemplate << ") is not available"; return 1; @@ -193,7 +192,7 @@ static int parse(const QString &urlTemplate, int propLength = propertyValue.length(); if (subStrLen > 0) { if (subStrPos + subStrLen > propLength) { - qCDebug(PictureToLoadLog).nospace() + qCDebug(CardPictureToLoadLog).nospace() << "PictureLoader: [card: " << cardName << " set: " << setName << "]: Requested " << propType << " property (" << cardPropertyName << ") for Url template (" << urlTemplate << ") is smaller than substr specification (" << subStrPos << " + " << subStrLen << " > " @@ -208,7 +207,7 @@ static int parse(const QString &urlTemplate, if (!fillWith.isEmpty()) { int fillLength = fillWith.length(); if (fillLength < propLength) { - qCDebug(PictureToLoadLog).nospace() + qCDebug(CardPictureToLoadLog).nospace() << "PictureLoader: [card: " << cardName << " set: " << setName << "]: Requested " << propType << " property (" << cardPropertyName << ") for Url template (" << urlTemplate << ") is longer than fill specification (" << fillWith << ")"; @@ -225,7 +224,7 @@ static int parse(const QString &urlTemplate, return 0; } -QString PictureToLoad::transformUrl(const QString &urlTemplate) const +QString CardPictureToLoad::transformUrl(const QString &urlTemplate) const { /* This function takes Url templates and substitutes actual card details into the url. This is used for making Urls with follow a predictable format @@ -279,7 +278,7 @@ QString PictureToLoad::transformUrl(const QString &urlTemplate) const * populated in this card, so it should return an empty string, * indicating an invalid Url. */ - qCDebug(PictureToLoadLog).nospace() + qCDebug(CardPictureToLoadLog).nospace() << "PictureLoader: [card: " << cardName << " set: " << setName << "]: Requested information (" << prop << ") for Url template (" << urlTemplate << ") is not available"; return QString(); diff --git a/cockatrice/src/picture_loader/picture_to_load.h b/cockatrice/src/interface/card_picture_loader/card_picture_to_load.h similarity index 76% rename from cockatrice/src/picture_loader/picture_to_load.h rename to cockatrice/src/interface/card_picture_loader/card_picture_to_load.h index 57b406587..c91296ab4 100644 --- a/cockatrice/src/picture_loader/picture_to_load.h +++ b/cockatrice/src/interface/card_picture_loader/card_picture_to_load.h @@ -1,5 +1,5 @@ /** - * @file picture_to_load.h + * @file card_picture_to_load.h * @ingroup PictureLoader * @brief TODO: Document this. */ @@ -7,13 +7,12 @@ #ifndef PICTURE_TO_LOAD_H #define PICTURE_TO_LOAD_H -#include "../card/exact_card.h" - #include +#include -inline Q_LOGGING_CATEGORY(PictureToLoadLog, "picture_loader.picture_to_load"); +inline Q_LOGGING_CATEGORY(CardPictureToLoadLog, "card_picture_loader.picture_to_load"); -class PictureToLoad +class CardPictureToLoad { private: ExactCard card; @@ -24,7 +23,7 @@ private: CardSetPtr currentSet; public: - explicit PictureToLoad(const ExactCard &_card); + explicit CardPictureToLoad(const ExactCard &_card); const ExactCard &getCard() const { diff --git a/cockatrice/src/interface/pixel_map_generator.cpp b/cockatrice/src/interface/pixel_map_generator.cpp index 25bd67264..382fff317 100644 --- a/cockatrice/src/interface/pixel_map_generator.cpp +++ b/cockatrice/src/interface/pixel_map_generator.cpp @@ -1,13 +1,12 @@ #include "pixel_map_generator.h" -#include "pb/serverinfo_user.pb.h" - #include #include #include #include #include #include +#include #define DEFAULT_COLOR_UNREGISTERED "#32c8ec"; #define DEFAULT_COLOR_REGISTERED "#5ed900"; diff --git a/cockatrice/src/interface/pixel_map_generator.h b/cockatrice/src/interface/pixel_map_generator.h index dcc4f689f..61d771c79 100644 --- a/cockatrice/src/interface/pixel_map_generator.h +++ b/cockatrice/src/interface/pixel_map_generator.h @@ -7,12 +7,11 @@ #ifndef PIXMAPGENERATOR_H #define PIXMAPGENERATOR_H -#include "user_level.h" - #include #include #include #include +#include inline Q_LOGGING_CATEGORY(PixelMapGeneratorLog, "pixel_map_generator"); diff --git a/cockatrice/src/interface/tearoff_menu.h b/cockatrice/src/interface/tearoff_menu.h index 30a2542e4..d2b3f3413 100644 --- a/cockatrice/src/interface/tearoff_menu.h +++ b/cockatrice/src/interface/tearoff_menu.h @@ -6,9 +6,8 @@ #pragma once -#include "../settings/cache_settings.h" - #include +#include class TearOffMenu : public QMenu { diff --git a/cockatrice/src/interface/theme_manager.cpp b/cockatrice/src/interface/theme_manager.cpp index 58a411c99..4cb66e2b1 100644 --- a/cockatrice/src/interface/theme_manager.cpp +++ b/cockatrice/src/interface/theme_manager.cpp @@ -1,13 +1,12 @@ #include "theme_manager.h" -#include "../settings/cache_settings.h" - #include #include #include #include #include #include +#include #define NONE_THEME_NAME "Default" #define STYLE_CSS_NAME "style.css" diff --git a/cockatrice/src/utility/deck_list_sort_filter_proxy_model.cpp b/cockatrice/src/interface/utility/deck_list_sort_filter_proxy_model.cpp similarity index 98% rename from cockatrice/src/utility/deck_list_sort_filter_proxy_model.cpp rename to cockatrice/src/interface/utility/deck_list_sort_filter_proxy_model.cpp index a7776cbec..90be2546d 100644 --- a/cockatrice/src/utility/deck_list_sort_filter_proxy_model.cpp +++ b/cockatrice/src/interface/utility/deck_list_sort_filter_proxy_model.cpp @@ -1,6 +1,6 @@ #include "deck_list_sort_filter_proxy_model.h" -#include "../deck/deck_list_model.h" +#include "../../deck/deck_list_model.h" bool DeckListSortFilterProxyModel::lessThan(const QModelIndex &left, const QModelIndex &right) const { diff --git a/cockatrice/src/utility/deck_list_sort_filter_proxy_model.h b/cockatrice/src/interface/utility/deck_list_sort_filter_proxy_model.h similarity index 92% rename from cockatrice/src/utility/deck_list_sort_filter_proxy_model.h rename to cockatrice/src/interface/utility/deck_list_sort_filter_proxy_model.h index af352a56b..0ea6d7495 100644 --- a/cockatrice/src/utility/deck_list_sort_filter_proxy_model.h +++ b/cockatrice/src/interface/utility/deck_list_sort_filter_proxy_model.h @@ -7,9 +7,8 @@ #ifndef COCKATRICE_DECK_LIST_SORT_FILTER_PROXY_MODEL_H #define COCKATRICE_DECK_LIST_SORT_FILTER_PROXY_MODEL_H -#include "../database/card_database_manager.h" - #include +#include class DeckListSortFilterProxyModel : public QSortFilterProxyModel { diff --git a/cockatrice/src/utility/sequence_edit.cpp b/cockatrice/src/interface/utility/sequence_edit.cpp similarity index 99% rename from cockatrice/src/utility/sequence_edit.cpp rename to cockatrice/src/interface/utility/sequence_edit.cpp index c5f0fd1c1..53776a3b0 100644 --- a/cockatrice/src/utility/sequence_edit.cpp +++ b/cockatrice/src/interface/utility/sequence_edit.cpp @@ -1,10 +1,9 @@ #include "sequence_edit.h" -#include "../settings/cache_settings.h" - #include #include #include +#include #include SequenceEdit::SequenceEdit(const QString &_shortcutName, QWidget *parent) : QWidget(parent) diff --git a/cockatrice/src/utility/sequence_edit.h b/cockatrice/src/interface/utility/sequence_edit.h similarity index 100% rename from cockatrice/src/utility/sequence_edit.h rename to cockatrice/src/interface/utility/sequence_edit.h diff --git a/cockatrice/src/interface/widgets/cards/additional_info/color_identity_widget.cpp b/cockatrice/src/interface/widgets/cards/additional_info/color_identity_widget.cpp index c00fd7cb2..c134b0aff 100644 --- a/cockatrice/src/interface/widgets/cards/additional_info/color_identity_widget.cpp +++ b/cockatrice/src/interface/widgets/cards/additional_info/color_identity_widget.cpp @@ -1,6 +1,5 @@ #include "color_identity_widget.h" -#include "../../../../settings/cache_settings.h" #include "mana_symbol_widget.h" #include @@ -9,6 +8,7 @@ #include #include #include +#include ColorIdentityWidget::ColorIdentityWidget(QWidget *parent, CardInfoPtr _card) : QWidget(parent), card(_card) { diff --git a/cockatrice/src/interface/widgets/cards/additional_info/color_identity_widget.h b/cockatrice/src/interface/widgets/cards/additional_info/color_identity_widget.h index bb6447035..60d69af06 100644 --- a/cockatrice/src/interface/widgets/cards/additional_info/color_identity_widget.h +++ b/cockatrice/src/interface/widgets/cards/additional_info/color_identity_widget.h @@ -7,10 +7,9 @@ #ifndef COLOR_IDENTITY_WIDGET_H #define COLOR_IDENTITY_WIDGET_H -#include "../../../../card/card_info.h" - #include #include +#include class ColorIdentityWidget : public QWidget { diff --git a/cockatrice/src/interface/widgets/cards/additional_info/mana_cost_widget.h b/cockatrice/src/interface/widgets/cards/additional_info/mana_cost_widget.h index e4aac81c4..26a186c59 100644 --- a/cockatrice/src/interface/widgets/cards/additional_info/mana_cost_widget.h +++ b/cockatrice/src/interface/widgets/cards/additional_info/mana_cost_widget.h @@ -7,10 +7,9 @@ #ifndef MANA_COST_WIDGET_H #define MANA_COST_WIDGET_H -#include "../../../../card/card_info.h" - #include #include +#include class ManaCostWidget : public QWidget { diff --git a/cockatrice/src/interface/widgets/cards/additional_info/mana_symbol_widget.cpp b/cockatrice/src/interface/widgets/cards/additional_info/mana_symbol_widget.cpp index aae22190b..942635871 100644 --- a/cockatrice/src/interface/widgets/cards/additional_info/mana_symbol_widget.cpp +++ b/cockatrice/src/interface/widgets/cards/additional_info/mana_symbol_widget.cpp @@ -1,8 +1,7 @@ #include "mana_symbol_widget.h" -#include "../../../../settings/cache_settings.h" - #include +#include ManaSymbolWidget::ManaSymbolWidget(QWidget *parent, QString _symbol, bool _isActive, bool _mayBeToggled) : QLabel(parent), symbol(_symbol), isActive(_isActive), mayBeToggled(_mayBeToggled) diff --git a/cockatrice/src/interface/widgets/cards/card_group_display_widgets/card_group_display_widget.cpp b/cockatrice/src/interface/widgets/cards/card_group_display_widgets/card_group_display_widget.cpp index dcd4cc9aa..36f0e6a4e 100644 --- a/cockatrice/src/interface/widgets/cards/card_group_display_widgets/card_group_display_widget.cpp +++ b/cockatrice/src/interface/widgets/cards/card_group_display_widgets/card_group_display_widget.cpp @@ -1,12 +1,12 @@ #include "card_group_display_widget.h" -#include "../../../../database/card_database_manager.h" #include "../../../../deck/deck_list_model.h" -#include "../../../../utility/card_info_comparator.h" -#include "../../../../utility/deck_list_sort_filter_proxy_model.h" +#include "../../../utility/deck_list_sort_filter_proxy_model.h" #include "../card_info_picture_with_text_overlay_widget.h" #include +#include +#include CardGroupDisplayWidget::CardGroupDisplayWidget(QWidget *parent, DeckListModel *_deckListModel, diff --git a/cockatrice/src/interface/widgets/cards/card_group_display_widgets/card_group_display_widget.h b/cockatrice/src/interface/widgets/cards/card_group_display_widgets/card_group_display_widget.h index 0b74d5c3f..4920d97d8 100644 --- a/cockatrice/src/interface/widgets/cards/card_group_display_widgets/card_group_display_widget.h +++ b/cockatrice/src/interface/widgets/cards/card_group_display_widgets/card_group_display_widget.h @@ -7,7 +7,6 @@ #ifndef CARD_GROUP_DISPLAY_WIDGET_H #define CARD_GROUP_DISPLAY_WIDGET_H -#include "../../../../card/card_info.h" #include "../../../../deck/deck_list_model.h" #include "../../general/display/banner_widget.h" #include "../card_info_picture_with_text_overlay_widget.h" @@ -16,6 +15,7 @@ #include #include #include +#include class CardGroupDisplayWidget : public QWidget { diff --git a/cockatrice/src/interface/widgets/cards/card_group_display_widgets/flat_card_group_display_widget.cpp b/cockatrice/src/interface/widgets/cards/card_group_display_widgets/flat_card_group_display_widget.cpp index 391edb2da..cc46d59eb 100644 --- a/cockatrice/src/interface/widgets/cards/card_group_display_widgets/flat_card_group_display_widget.cpp +++ b/cockatrice/src/interface/widgets/cards/card_group_display_widgets/flat_card_group_display_widget.cpp @@ -1,11 +1,11 @@ #include "flat_card_group_display_widget.h" -#include "../../../../database/card_database_manager.h" #include "../../../../deck/deck_list_model.h" -#include "../../../../utility/card_info_comparator.h" #include "../card_info_picture_with_text_overlay_widget.h" #include +#include +#include #include FlatCardGroupDisplayWidget::FlatCardGroupDisplayWidget(QWidget *parent, diff --git a/cockatrice/src/interface/widgets/cards/card_group_display_widgets/overlapped_card_group_display_widget.cpp b/cockatrice/src/interface/widgets/cards/card_group_display_widgets/overlapped_card_group_display_widget.cpp index c549ceefe..df02c9e1c 100644 --- a/cockatrice/src/interface/widgets/cards/card_group_display_widgets/overlapped_card_group_display_widget.cpp +++ b/cockatrice/src/interface/widgets/cards/card_group_display_widgets/overlapped_card_group_display_widget.cpp @@ -1,11 +1,11 @@ #include "overlapped_card_group_display_widget.h" -#include "../../../../database/card_database_manager.h" #include "../../../../deck/deck_list_model.h" -#include "../../../../utility/card_info_comparator.h" #include "../card_info_picture_with_text_overlay_widget.h" #include +#include +#include OverlappedCardGroupDisplayWidget::OverlappedCardGroupDisplayWidget(QWidget *parent, DeckListModel *_deckListModel, diff --git a/cockatrice/src/interface/widgets/cards/card_info_display_widget.cpp b/cockatrice/src/interface/widgets/cards/card_info_display_widget.cpp index d11590a05..f6533e3ca 100644 --- a/cockatrice/src/interface/widgets/cards/card_info_display_widget.cpp +++ b/cockatrice/src/interface/widgets/cards/card_info_display_widget.cpp @@ -1,6 +1,5 @@ #include "card_info_display_widget.h" -#include "../../../database/card_database_manager.h" #include "../../../game/board/card_item.h" #include "../../../main.h" #include "card_info_picture_widget.h" @@ -9,6 +8,7 @@ #include #include #include +#include #include CardInfoDisplayWidget::CardInfoDisplayWidget(const CardRef &cardRef, QWidget *parent, Qt::WindowFlags flags) diff --git a/cockatrice/src/interface/widgets/cards/card_info_display_widget.h b/cockatrice/src/interface/widgets/cards/card_info_display_widget.h index ed2e03114..f5b2ea2f2 100644 --- a/cockatrice/src/interface/widgets/cards/card_info_display_widget.h +++ b/cockatrice/src/interface/widgets/cards/card_info_display_widget.h @@ -7,12 +7,11 @@ #ifndef CARDINFOWIDGET_H #define CARDINFOWIDGET_H -#include "../../../card/exact_card.h" -#include "card_ref.h" - #include #include #include +#include +#include class CardInfoPictureWidget; class CardInfoTextWidget; diff --git a/cockatrice/src/interface/widgets/cards/card_info_frame_widget.cpp b/cockatrice/src/interface/widgets/cards/card_info_frame_widget.cpp index ddc1efb48..fe9385a23 100644 --- a/cockatrice/src/interface/widgets/cards/card_info_frame_widget.cpp +++ b/cockatrice/src/interface/widgets/cards/card_info_frame_widget.cpp @@ -1,15 +1,15 @@ #include "card_info_frame_widget.h" -#include "../../../card/card_relation.h" -#include "../../../database/card_database_manager.h" #include "../../../game/board/card_item.h" -#include "../../../settings/cache_settings.h" #include "card_info_display_widget.h" #include "card_info_picture_widget.h" #include "card_info_text_widget.h" #include #include +#include +#include +#include #include CardInfoFrameWidget::CardInfoFrameWidget(QWidget *parent) diff --git a/cockatrice/src/interface/widgets/cards/card_info_frame_widget.h b/cockatrice/src/interface/widgets/cards/card_info_frame_widget.h index 65fd0a514..f534ab956 100644 --- a/cockatrice/src/interface/widgets/cards/card_info_frame_widget.h +++ b/cockatrice/src/interface/widgets/cards/card_info_frame_widget.h @@ -7,11 +7,10 @@ #ifndef CARDFRAME_H #define CARDFRAME_H -#include "../../../card/exact_card.h" -#include "card_ref.h" - #include #include +#include +#include class AbstractCardItem; class CardInfoPictureWidget; diff --git a/cockatrice/src/interface/widgets/cards/card_info_picture_art_crop_widget.cpp b/cockatrice/src/interface/widgets/cards/card_info_picture_art_crop_widget.cpp index e7acabce9..451104d17 100644 --- a/cockatrice/src/interface/widgets/cards/card_info_picture_art_crop_widget.cpp +++ b/cockatrice/src/interface/widgets/cards/card_info_picture_art_crop_widget.cpp @@ -1,6 +1,6 @@ #include "card_info_picture_art_crop_widget.h" -#include "../../../picture_loader/picture_loader.h" +#include "../../../interface/card_picture_loader/card_picture_loader.h" CardInfoPictureArtCropWidget::CardInfoPictureArtCropWidget(QWidget *parent) : CardInfoPictureWidget(parent, false, false) @@ -13,9 +13,9 @@ QPixmap CardInfoPictureArtCropWidget::getProcessedBackground(const QSize &target // Load the full-resolution card image, not a pre-scaled one QPixmap fullResPixmap; if (getCard()) { - PictureLoader::getPixmap(fullResPixmap, getCard(), QSize(745, 1040)); // or a high default size + CardPictureLoader::getPixmap(fullResPixmap, getCard(), QSize(745, 1040)); // or a high default size } else { - PictureLoader::getCardBackPixmap(fullResPixmap, QSize(745, 1040)); + CardPictureLoader::getCardBackPixmap(fullResPixmap, QSize(745, 1040)); } // Fail-safe if loading failed diff --git a/cockatrice/src/interface/widgets/cards/card_info_picture_enlarged_widget.cpp b/cockatrice/src/interface/widgets/cards/card_info_picture_enlarged_widget.cpp index 02ba37b74..ead669e7c 100644 --- a/cockatrice/src/interface/widgets/cards/card_info_picture_enlarged_widget.cpp +++ b/cockatrice/src/interface/widgets/cards/card_info_picture_enlarged_widget.cpp @@ -1,10 +1,10 @@ #include "card_info_picture_enlarged_widget.h" -#include "../../../picture_loader/picture_loader.h" -#include "../../../settings/cache_settings.h" +#include "../../../interface/card_picture_loader/card_picture_loader.h" #include #include +#include #include /** @@ -35,9 +35,9 @@ CardInfoPictureEnlargedWidget::CardInfoPictureEnlargedWidget(QWidget *parent) : void CardInfoPictureEnlargedWidget::loadPixmap(const QSize &size) { if (card) { - PictureLoader::getPixmap(enlargedPixmap, card, size); + CardPictureLoader::getPixmap(enlargedPixmap, card, size); } else { - PictureLoader::getCardBackPixmap(enlargedPixmap, size); + CardPictureLoader::getCardBackPixmap(enlargedPixmap, size); } pixmapDirty = false; } diff --git a/cockatrice/src/interface/widgets/cards/card_info_picture_enlarged_widget.h b/cockatrice/src/interface/widgets/cards/card_info_picture_enlarged_widget.h index 07ecd1aab..cc37f2f0b 100644 --- a/cockatrice/src/interface/widgets/cards/card_info_picture_enlarged_widget.h +++ b/cockatrice/src/interface/widgets/cards/card_info_picture_enlarged_widget.h @@ -8,10 +8,9 @@ #ifndef CARD_PICTURE_ENLARGED_WIDGET_H #define CARD_PICTURE_ENLARGED_WIDGET_H -#include "../../../card/exact_card.h" - #include #include +#include class CardInfoPictureEnlargedWidget final : public QWidget { diff --git a/cockatrice/src/interface/widgets/cards/card_info_picture_widget.cpp b/cockatrice/src/interface/widgets/cards/card_info_picture_widget.cpp index 33f0be946..7e87d6587 100644 --- a/cockatrice/src/interface/widgets/cards/card_info_picture_widget.cpp +++ b/cockatrice/src/interface/widgets/cards/card_info_picture_widget.cpp @@ -1,10 +1,7 @@ #include "card_info_picture_widget.h" -#include "../../../card/card_relation.h" -#include "../../../database/card_database_manager.h" #include "../../../game/board/card_item.h" -#include "../../../picture_loader/picture_loader.h" -#include "../../../settings/cache_settings.h" +#include "../../../interface/card_picture_loader/card_picture_loader.h" #include "../../../tabs/tab_supervisor.h" #include "../../window_main.h" @@ -13,6 +10,9 @@ #include #include #include +#include +#include +#include #include /** @@ -152,11 +152,11 @@ void CardInfoPictureWidget::updatePixmap() */ void CardInfoPictureWidget::loadPixmap() { - PictureLoader::getCardBackLoadingInProgressPixmap(resizedPixmap, size()); + CardPictureLoader::getCardBackLoadingInProgressPixmap(resizedPixmap, size()); if (exactCard) { - PictureLoader::getPixmap(resizedPixmap, exactCard, size()); + CardPictureLoader::getPixmap(resizedPixmap, exactCard, size()); } else { - PictureLoader::getCardBackLoadingFailedPixmap(resizedPixmap, size()); + CardPictureLoader::getCardBackLoadingFailedPixmap(resizedPixmap, size()); } pixmapDirty = false; diff --git a/cockatrice/src/interface/widgets/cards/card_info_picture_widget.h b/cockatrice/src/interface/widgets/cards/card_info_picture_widget.h index ce918a33e..3cbdd46db 100644 --- a/cockatrice/src/interface/widgets/cards/card_info_picture_widget.h +++ b/cockatrice/src/interface/widgets/cards/card_info_picture_widget.h @@ -7,12 +7,12 @@ #ifndef CARD_INFO_PICTURE_H #define CARD_INFO_PICTURE_H -#include "../../../card/exact_card.h" #include "card_info_picture_enlarged_widget.h" #include #include #include +#include inline Q_LOGGING_CATEGORY(CardInfoPictureWidgetLog, "card_info_picture_widget"); diff --git a/cockatrice/src/interface/widgets/cards/card_info_text_widget.cpp b/cockatrice/src/interface/widgets/cards/card_info_text_widget.cpp index 8a4b26eb6..0a040ff29 100644 --- a/cockatrice/src/interface/widgets/cards/card_info_text_widget.cpp +++ b/cockatrice/src/interface/widgets/cards/card_info_text_widget.cpp @@ -1,7 +1,5 @@ #include "card_info_text_widget.h" -#include "../../../card/card_relation.h" -#include "../../../card/game_specific_terms.h" #include "../../../game/board/card_item.h" #include @@ -10,6 +8,8 @@ #include #include #include +#include +#include CardInfoTextWidget::CardInfoTextWidget(QWidget *parent) : QFrame(parent), info(nullptr) { diff --git a/cockatrice/src/interface/widgets/cards/card_info_text_widget.h b/cockatrice/src/interface/widgets/cards/card_info_text_widget.h index d3cba8994..8711422b0 100644 --- a/cockatrice/src/interface/widgets/cards/card_info_text_widget.h +++ b/cockatrice/src/interface/widgets/cards/card_info_text_widget.h @@ -7,9 +7,8 @@ #ifndef CARDINFOTEXT_H #define CARDINFOTEXT_H -#include "../../../card/card_info.h" - #include +#include class QLabel; class QScrollArea; class QTextEdit; diff --git a/cockatrice/src/interface/widgets/cards/card_size_widget.cpp b/cockatrice/src/interface/widgets/cards/card_size_widget.cpp index 2b81b26d5..c084dac64 100644 --- a/cockatrice/src/interface/widgets/cards/card_size_widget.cpp +++ b/cockatrice/src/interface/widgets/cards/card_size_widget.cpp @@ -1,9 +1,10 @@ #include "card_size_widget.h" -#include "../../../settings/cache_settings.h" #include "../printing_selector/printing_selector.h" #include "../visual_deck_storage/visual_deck_storage_widget.h" +#include + /** * @class CardSizeWidget * @brief A widget for adjusting card sizes using a slider. diff --git a/cockatrice/src/interface/widgets/cards/deck_card_zone_display_widget.cpp b/cockatrice/src/interface/widgets/cards/deck_card_zone_display_widget.cpp index 4a8f55cab..892652c02 100644 --- a/cockatrice/src/interface/widgets/cards/deck_card_zone_display_widget.cpp +++ b/cockatrice/src/interface/widgets/cards/deck_card_zone_display_widget.cpp @@ -1,11 +1,11 @@ #include "deck_card_zone_display_widget.h" #include "../../../deck/deck_list_model.h" -#include "../../../utility/card_info_comparator.h" #include "card_group_display_widgets/flat_card_group_display_widget.h" #include "card_group_display_widgets/overlapped_card_group_display_widget.h" #include +#include DeckCardZoneDisplayWidget::DeckCardZoneDisplayWidget(QWidget *parent, DeckListModel *_deckListModel, diff --git a/cockatrice/src/interface/widgets/cards/deck_card_zone_display_widget.h b/cockatrice/src/interface/widgets/cards/deck_card_zone_display_widget.h index 79ddebf6a..12be2debf 100644 --- a/cockatrice/src/interface/widgets/cards/deck_card_zone_display_widget.h +++ b/cockatrice/src/interface/widgets/cards/deck_card_zone_display_widget.h @@ -7,7 +7,6 @@ #ifndef DECK_CARD_ZONE_DISPLAY_WIDGET_H #define DECK_CARD_ZONE_DISPLAY_WIDGET_H -#include "../../../card/card_info.h" #include "../../../deck/deck_list_model.h" #include "../general/display/banner_widget.h" #include "../general/layout_containers/overlap_widget.h" @@ -18,6 +17,7 @@ #include #include +#include class DeckCardZoneDisplayWidget : public QWidget { diff --git a/cockatrice/src/interface/widgets/cards/deck_preview_card_picture_widget.cpp b/cockatrice/src/interface/widgets/cards/deck_preview_card_picture_widget.cpp index b284b3f05..dfa7bc025 100644 --- a/cockatrice/src/interface/widgets/cards/deck_preview_card_picture_widget.cpp +++ b/cockatrice/src/interface/widgets/cards/deck_preview_card_picture_widget.cpp @@ -1,7 +1,5 @@ #include "deck_preview_card_picture_widget.h" -#include "../../../settings/cache_settings.h" - #include #include #include @@ -9,6 +7,7 @@ #include #include #include +#include /** * @brief Constructs a CardPictureWithTextOverlay widget. diff --git a/cockatrice/src/interface/widgets/deck_analytics/deck_analytics_widget.h b/cockatrice/src/interface/widgets/deck_analytics/deck_analytics_widget.h index f2ae805d1..e1c4627fe 100644 --- a/cockatrice/src/interface/widgets/deck_analytics/deck_analytics_widget.h +++ b/cockatrice/src/interface/widgets/deck_analytics/deck_analytics_widget.h @@ -17,7 +17,7 @@ #include #include #include -#include +#include class DeckAnalyticsWidget : public QWidget { diff --git a/cockatrice/src/interface/widgets/deck_analytics/mana_base_widget.cpp b/cockatrice/src/interface/widgets/deck_analytics/mana_base_widget.cpp index 11d87be40..4981d0a2d 100644 --- a/cockatrice/src/interface/widgets/deck_analytics/mana_base_widget.cpp +++ b/cockatrice/src/interface/widgets/deck_analytics/mana_base_widget.cpp @@ -1,14 +1,14 @@ #include "mana_base_widget.h" -#include "../../../database/card_database.h" -#include "../../../database/card_database_manager.h" #include "../../../deck/deck_loader.h" #include "../general/display/banner_widget.h" #include "../general/display/bar_widget.h" #include #include -#include +#include +#include +#include ManaBaseWidget::ManaBaseWidget(QWidget *parent, DeckListModel *_deckListModel) : QWidget(parent), deckListModel(_deckListModel) diff --git a/cockatrice/src/interface/widgets/deck_analytics/mana_base_widget.h b/cockatrice/src/interface/widgets/deck_analytics/mana_base_widget.h index c0d970db2..f202eb31e 100644 --- a/cockatrice/src/interface/widgets/deck_analytics/mana_base_widget.h +++ b/cockatrice/src/interface/widgets/deck_analytics/mana_base_widget.h @@ -12,7 +12,7 @@ #include #include -#include +#include #include class ManaBaseWidget : public QWidget diff --git a/cockatrice/src/interface/widgets/deck_analytics/mana_curve_widget.cpp b/cockatrice/src/interface/widgets/deck_analytics/mana_curve_widget.cpp index 5a4e14dc9..5b50d953f 100644 --- a/cockatrice/src/interface/widgets/deck_analytics/mana_curve_widget.cpp +++ b/cockatrice/src/interface/widgets/deck_analytics/mana_curve_widget.cpp @@ -1,13 +1,13 @@ #include "mana_curve_widget.h" -#include "../../../database/card_database.h" -#include "../../../database/card_database_manager.h" #include "../../../deck/deck_loader.h" #include "../../../main.h" #include "../general/display/banner_widget.h" #include "../general/display/bar_widget.h" -#include +#include +#include +#include #include ManaCurveWidget::ManaCurveWidget(QWidget *parent, DeckListModel *_deckListModel) diff --git a/cockatrice/src/interface/widgets/deck_analytics/mana_devotion_widget.cpp b/cockatrice/src/interface/widgets/deck_analytics/mana_devotion_widget.cpp index 4960b009a..cfe5684c8 100644 --- a/cockatrice/src/interface/widgets/deck_analytics/mana_devotion_widget.cpp +++ b/cockatrice/src/interface/widgets/deck_analytics/mana_devotion_widget.cpp @@ -1,14 +1,14 @@ #include "mana_devotion_widget.h" -#include "../../../database/card_database.h" -#include "../../../database/card_database_manager.h" #include "../../../deck/deck_loader.h" #include "../../../main.h" #include "../general/display/banner_widget.h" #include "../general/display/bar_widget.h" -#include #include +#include +#include +#include #include #include #include diff --git a/cockatrice/src/interface/widgets/deck_analytics/mana_devotion_widget.h b/cockatrice/src/interface/widgets/deck_analytics/mana_devotion_widget.h index 003770b51..03cb9aa38 100644 --- a/cockatrice/src/interface/widgets/deck_analytics/mana_devotion_widget.h +++ b/cockatrice/src/interface/widgets/deck_analytics/mana_devotion_widget.h @@ -12,7 +12,7 @@ #include #include -#include +#include #include class ManaDevotionWidget : public QWidget diff --git a/cockatrice/src/interface/widgets/deck_editor/deck_editor_database_display_widget.cpp b/cockatrice/src/interface/widgets/deck_editor/deck_editor_database_display_widget.cpp index c0bf03b9f..d0bd43148 100644 --- a/cockatrice/src/interface/widgets/deck_editor/deck_editor_database_display_widget.cpp +++ b/cockatrice/src/interface/widgets/deck_editor/deck_editor_database_display_widget.cpp @@ -1,9 +1,6 @@ #include "deck_editor_database_display_widget.h" -#include "../../../card/card_relation.h" -#include "../../../database/card_database_manager.h" #include "../../../filters/syntax_help.h" -#include "../../../settings/cache_settings.h" #include "../../../tabs/abstract_tab_deck_editor.h" #include "../../../tabs/tab_supervisor.h" #include "../../pixel_map_generator.h" @@ -15,6 +12,9 @@ #include #include #include +#include +#include +#include static bool canBeCommander(const CardInfo &cardInfo) { diff --git a/cockatrice/src/interface/widgets/deck_editor/deck_editor_database_display_widget.h b/cockatrice/src/interface/widgets/deck_editor/deck_editor_database_display_widget.h index a2f803e2c..8fc9176bd 100644 --- a/cockatrice/src/interface/widgets/deck_editor/deck_editor_database_display_widget.h +++ b/cockatrice/src/interface/widgets/deck_editor/deck_editor_database_display_widget.h @@ -8,14 +8,14 @@ #ifndef DECK_EDITOR_DATABASE_DISPLAY_WIDGET_H #define DECK_EDITOR_DATABASE_DISPLAY_WIDGET_H -#include "../../../database/model/card_database_display_model.h" -#include "../../../database/model/card_database_model.h" #include "../../../deck/custom_line_edit.h" #include "../../../tabs/abstract_tab_deck_editor.h" -#include "../../../utility/key_signals.h" #include #include +#include +#include +#include class AbstractTabDeckEditor; class DeckEditorDatabaseDisplayWidget : public QWidget diff --git a/cockatrice/src/interface/widgets/deck_editor/deck_editor_deck_dock_widget.cpp b/cockatrice/src/interface/widgets/deck_editor/deck_editor_deck_dock_widget.cpp index 90489b296..66ee2e34d 100644 --- a/cockatrice/src/interface/widgets/deck_editor/deck_editor_deck_dock_widget.cpp +++ b/cockatrice/src/interface/widgets/deck_editor/deck_editor_deck_dock_widget.cpp @@ -1,15 +1,14 @@ #include "deck_editor_deck_dock_widget.h" -#include "../../../database/card_database_manager.h" -#include "../../../settings/cache_settings.h" - #include #include #include #include #include #include -#include +#include +#include +#include DeckEditorDeckDockWidget::DeckEditorDeckDockWidget(AbstractTabDeckEditor *parent) : QDockWidget(parent), deckEditor(parent) diff --git a/cockatrice/src/interface/widgets/deck_editor/deck_editor_deck_dock_widget.h b/cockatrice/src/interface/widgets/deck_editor/deck_editor_deck_dock_widget.h index 3cb9bf5e9..7c568f6ca 100644 --- a/cockatrice/src/interface/widgets/deck_editor/deck_editor_deck_dock_widget.h +++ b/cockatrice/src/interface/widgets/deck_editor/deck_editor_deck_dock_widget.h @@ -8,10 +8,8 @@ #ifndef DECK_EDITOR_DECK_DOCK_WIDGET_H #define DECK_EDITOR_DECK_DOCK_WIDGET_H -#include "../../../card/card_info.h" #include "../../../deck/custom_line_edit.h" #include "../../../tabs/abstract_tab_deck_editor.h" -#include "../../../utility/key_signals.h" #include "../visual_deck_storage/deck_preview/deck_preview_deck_tags_display_widget.h" #include @@ -19,6 +17,8 @@ #include #include #include +#include +#include class DeckListModel; class AbstractTabDeckEditor; diff --git a/cockatrice/src/interface/widgets/deck_editor/deck_editor_filter_dock_widget.cpp b/cockatrice/src/interface/widgets/deck_editor/deck_editor_filter_dock_widget.cpp index 51d0cdbbe..89e93d376 100644 --- a/cockatrice/src/interface/widgets/deck_editor/deck_editor_filter_dock_widget.cpp +++ b/cockatrice/src/interface/widgets/deck_editor/deck_editor_filter_dock_widget.cpp @@ -1,13 +1,13 @@ #include "deck_editor_filter_dock_widget.h" -#include "../../../database/model/card_database_model.h" #include "../../../filters/filter_builder.h" #include "../../../filters/filter_tree_model.h" -#include "../../../settings/cache_settings.h" #include #include #include +#include +#include DeckEditorFilterDockWidget::DeckEditorFilterDockWidget(AbstractTabDeckEditor *parent) : QDockWidget(parent), deckEditor(parent) diff --git a/cockatrice/src/interface/widgets/deck_editor/deck_editor_filter_dock_widget.h b/cockatrice/src/interface/widgets/deck_editor/deck_editor_filter_dock_widget.h index 7357e489f..740f5c759 100644 --- a/cockatrice/src/interface/widgets/deck_editor/deck_editor_filter_dock_widget.h +++ b/cockatrice/src/interface/widgets/deck_editor/deck_editor_filter_dock_widget.h @@ -9,10 +9,10 @@ #define DECK_EDITOR_FILTER_DOCK_WIDGET_H #include "../../../tabs/abstract_tab_deck_editor.h" -#include "../../../utility/key_signals.h" #include #include +#include class FilterTreeModel; class AbstractTabDeckEditor; diff --git a/cockatrice/src/interface/widgets/general/home_widget.cpp b/cockatrice/src/interface/widgets/general/home_widget.cpp index 50823db4b..14295858c 100644 --- a/cockatrice/src/interface/widgets/general/home_widget.cpp +++ b/cockatrice/src/interface/widgets/general/home_widget.cpp @@ -1,8 +1,5 @@ #include "home_widget.h" -#include "../../../database/card_database_manager.h" -#include "../../../server/remote/remote_client.h" -#include "../../../settings/cache_settings.h" #include "../../../tabs/tab_supervisor.h" #include "../../window_main.h" #include "background_sources.h" @@ -12,6 +9,9 @@ #include #include #include +#include +#include +#include HomeWidget::HomeWidget(QWidget *parent, TabSupervisor *_tabSupervisor) : QWidget(parent), tabSupervisor(_tabSupervisor), background("theme:backgrounds/home"), overlay("theme:cockatrice") diff --git a/cockatrice/src/interface/widgets/general/home_widget.h b/cockatrice/src/interface/widgets/general/home_widget.h index 2c22bc29b..3cc4d8da1 100644 --- a/cockatrice/src/interface/widgets/general/home_widget.h +++ b/cockatrice/src/interface/widgets/general/home_widget.h @@ -7,7 +7,6 @@ #ifndef HOME_WIDGET_H #define HOME_WIDGET_H -#include "../../../server/abstract_client.h" #include "../../../tabs/tab_supervisor.h" #include "../cards/card_info_picture_art_crop_widget.h" #include "home_styled_button.h" @@ -15,6 +14,7 @@ #include #include #include +#include class HomeWidget : public QWidget { diff --git a/cockatrice/src/interface/widgets/printing_selector/card_amount_widget.h b/cockatrice/src/interface/widgets/printing_selector/card_amount_widget.h index 49321ed6e..5e23ccf2a 100644 --- a/cockatrice/src/interface/widgets/printing_selector/card_amount_widget.h +++ b/cockatrice/src/interface/widgets/printing_selector/card_amount_widget.h @@ -8,7 +8,6 @@ #ifndef CARD_AMOUNT_WIDGET_H #define CARD_AMOUNT_WIDGET_H -#include "../../../card/card_info.h" #include "../../../deck/deck_list_model.h" #include "../../../deck/deck_loader.h" #include "../../../tabs/abstract_tab_deck_editor.h" @@ -19,6 +18,7 @@ #include #include #include +#include class CardAmountWidget : public QWidget { diff --git a/cockatrice/src/interface/widgets/printing_selector/printing_selector.cpp b/cockatrice/src/interface/widgets/printing_selector/printing_selector.cpp index e49fd2c9d..f581312f2 100644 --- a/cockatrice/src/interface/widgets/printing_selector/printing_selector.cpp +++ b/cockatrice/src/interface/widgets/printing_selector/printing_selector.cpp @@ -1,8 +1,7 @@ #include "printing_selector.h" #include "../../../dialogs/dlg_select_set_for_cards.h" -#include "../../../picture_loader/picture_loader.h" -#include "../../../settings/cache_settings.h" +#include "../../../interface/card_picture_loader/card_picture_loader.h" #include "printing_selector_card_display_widget.h" #include "printing_selector_card_search_widget.h" #include "printing_selector_card_selection_widget.h" @@ -10,6 +9,7 @@ #include #include +#include #include /** diff --git a/cockatrice/src/interface/widgets/printing_selector/printing_selector.h b/cockatrice/src/interface/widgets/printing_selector/printing_selector.h index 1fd27498a..c44057070 100644 --- a/cockatrice/src/interface/widgets/printing_selector/printing_selector.h +++ b/cockatrice/src/interface/widgets/printing_selector/printing_selector.h @@ -7,7 +7,6 @@ #ifndef PRINTING_SELECTOR_H #define PRINTING_SELECTOR_H -#include "../../../card/card_info.h" #include "../../../deck/deck_list_model.h" #include "../cards/card_size_widget.h" #include "../general/layout_containers/flow_widget.h" @@ -19,6 +18,7 @@ #include #include #include +#include #define BATCH_SIZE 10 diff --git a/cockatrice/src/interface/widgets/printing_selector/printing_selector_card_display_widget.h b/cockatrice/src/interface/widgets/printing_selector/printing_selector_card_display_widget.h index 4bd686cb3..f5b4a1392 100644 --- a/cockatrice/src/interface/widgets/printing_selector/printing_selector_card_display_widget.h +++ b/cockatrice/src/interface/widgets/printing_selector/printing_selector_card_display_widget.h @@ -7,7 +7,6 @@ #ifndef PRINTING_SELECTOR_CARD_DISPLAY_WIDGET_H #define PRINTING_SELECTOR_CARD_DISPLAY_WIDGET_H -#include "../../../card/card_info.h" #include "../../../deck/deck_list_model.h" #include "../../../tabs/abstract_tab_deck_editor.h" #include "printing_selector_card_overlay_widget.h" @@ -15,6 +14,7 @@ #include #include +#include class PrintingSelectorCardDisplayWidget : public QWidget { diff --git a/cockatrice/src/interface/widgets/printing_selector/printing_selector_card_overlay_widget.cpp b/cockatrice/src/interface/widgets/printing_selector/printing_selector_card_overlay_widget.cpp index f537f566b..ccda1ba34 100644 --- a/cockatrice/src/interface/widgets/printing_selector/printing_selector_card_overlay_widget.cpp +++ b/cockatrice/src/interface/widgets/printing_selector/printing_selector_card_overlay_widget.cpp @@ -1,13 +1,13 @@ #include "printing_selector_card_overlay_widget.h" -#include "../../../card/card_relation.h" -#include "../../../database/card_database_manager.h" -#include "../../../settings/cache_settings.h" #include "printing_selector_card_display_widget.h" #include #include #include +#include +#include +#include #include /** diff --git a/cockatrice/src/interface/widgets/printing_selector/printing_selector_card_overlay_widget.h b/cockatrice/src/interface/widgets/printing_selector/printing_selector_card_overlay_widget.h index 84f029f11..25c8f771c 100644 --- a/cockatrice/src/interface/widgets/printing_selector/printing_selector_card_overlay_widget.h +++ b/cockatrice/src/interface/widgets/printing_selector/printing_selector_card_overlay_widget.h @@ -7,7 +7,6 @@ #ifndef PRINTING_SELECTOR_CARD_OVERLAY_WIDGET_H #define PRINTING_SELECTOR_CARD_OVERLAY_WIDGET_H -#include "../../../card/card_info.h" #include "../../../deck/deck_list_model.h" #include "../../../tabs/abstract_tab_deck_editor.h" #include "../cards/card_info_picture_widget.h" @@ -15,6 +14,8 @@ #include "card_amount_widget.h" #include "set_name_and_collectors_number_display_widget.h" +#include + class PrintingSelectorCardOverlayWidget : public QWidget { Q_OBJECT diff --git a/cockatrice/src/interface/widgets/printing_selector/printing_selector_card_sorting_widget.cpp b/cockatrice/src/interface/widgets/printing_selector/printing_selector_card_sorting_widget.cpp index 2da987762..312bae9a1 100644 --- a/cockatrice/src/interface/widgets/printing_selector/printing_selector_card_sorting_widget.cpp +++ b/cockatrice/src/interface/widgets/printing_selector/printing_selector_card_sorting_widget.cpp @@ -1,7 +1,7 @@ #include "printing_selector_card_sorting_widget.h" -#include "../../../settings/cache_settings.h" -#include "../../../utility/card_set_comparator.h" +#include +#include const QString PrintingSelectorCardSortingWidget::SORT_OPTIONS_ALPHABETICAL = tr("Alphabetical"); const QString PrintingSelectorCardSortingWidget::SORT_OPTIONS_PREFERENCE = tr("Preference"); diff --git a/cockatrice/src/interface/widgets/visual_database_display/visual_database_display_filter_save_load_widget.cpp b/cockatrice/src/interface/widgets/visual_database_display/visual_database_display_filter_save_load_widget.cpp index 15ef4a590..e8c42a28a 100644 --- a/cockatrice/src/interface/widgets/visual_database_display/visual_database_display_filter_save_load_widget.cpp +++ b/cockatrice/src/interface/widgets/visual_database_display/visual_database_display_filter_save_load_widget.cpp @@ -1,13 +1,13 @@ #include "visual_database_display_filter_save_load_widget.h" #include "../../../filters/filter_tree.h" -#include "../../../settings/cache_settings.h" #include "visual_database_filter_display_widget.h" #include #include #include #include +#include VisualDatabaseDisplayFilterSaveLoadWidget::VisualDatabaseDisplayFilterSaveLoadWidget(QWidget *parent, FilterTreeModel *_filterModel) diff --git a/cockatrice/src/interface/widgets/visual_database_display/visual_database_display_main_type_filter_widget.cpp b/cockatrice/src/interface/widgets/visual_database_display/visual_database_display_main_type_filter_widget.cpp index 1fddc9724..47c00ac48 100644 --- a/cockatrice/src/interface/widgets/visual_database_display/visual_database_display_main_type_filter_widget.cpp +++ b/cockatrice/src/interface/widgets/visual_database_display/visual_database_display_main_type_filter_widget.cpp @@ -1,12 +1,12 @@ #include "visual_database_display_main_type_filter_widget.h" -#include "../../../database/card_database_manager.h" #include "../../../filters/filter_tree.h" #include "../../../filters/filter_tree_model.h" #include #include #include +#include VisualDatabaseDisplayMainTypeFilterWidget::VisualDatabaseDisplayMainTypeFilterWidget(QWidget *parent, FilterTreeModel *_filterModel) diff --git a/cockatrice/src/interface/widgets/visual_database_display/visual_database_display_set_filter_widget.cpp b/cockatrice/src/interface/widgets/visual_database_display/visual_database_display_set_filter_widget.cpp index 6bc27d90f..17c26b544 100644 --- a/cockatrice/src/interface/widgets/visual_database_display/visual_database_display_set_filter_widget.cpp +++ b/cockatrice/src/interface/widgets/visual_database_display/visual_database_display_set_filter_widget.cpp @@ -1,14 +1,14 @@ #include "visual_database_display_set_filter_widget.h" -#include "../../../database/card_database_manager.h" #include "../../../filters/filter_tree.h" #include "../../../filters/filter_tree_model.h" -#include "../../../settings/cache_settings.h" #include #include #include #include +#include +#include VisualDatabaseDisplayRecentSetFilterSettingsWidget::VisualDatabaseDisplayRecentSetFilterSettingsWidget(QWidget *parent) : QWidget(parent) diff --git a/cockatrice/src/interface/widgets/visual_database_display/visual_database_display_sub_type_filter_widget.cpp b/cockatrice/src/interface/widgets/visual_database_display/visual_database_display_sub_type_filter_widget.cpp index 9c531ba1a..02047723f 100644 --- a/cockatrice/src/interface/widgets/visual_database_display/visual_database_display_sub_type_filter_widget.cpp +++ b/cockatrice/src/interface/widgets/visual_database_display/visual_database_display_sub_type_filter_widget.cpp @@ -1,6 +1,5 @@ #include "visual_database_display_sub_type_filter_widget.h" -#include "../../../database/card_database_manager.h" #include "../../../filters/filter_tree.h" #include "../../../filters/filter_tree_model.h" @@ -8,6 +7,7 @@ #include #include #include +#include VisualDatabaseDisplaySubTypeFilterWidget::VisualDatabaseDisplaySubTypeFilterWidget(QWidget *parent, FilterTreeModel *_filterModel) diff --git a/cockatrice/src/interface/widgets/visual_database_display/visual_database_display_widget.cpp b/cockatrice/src/interface/widgets/visual_database_display/visual_database_display_widget.cpp index 95a463b23..b436c84f5 100644 --- a/cockatrice/src/interface/widgets/visual_database_display/visual_database_display_widget.cpp +++ b/cockatrice/src/interface/widgets/visual_database_display/visual_database_display_widget.cpp @@ -1,12 +1,8 @@ #include "visual_database_display_widget.h" -#include "../../../database/card_database.h" -#include "../../../database/card_database_manager.h" #include "../../../deck/custom_line_edit.h" #include "../../../filters/filter_tree_model.h" #include "../../../filters/syntax_help.h" -#include "../../../settings/cache_settings.h" -#include "../../../utility/card_info_comparator.h" #include "../../pixel_map_generator.h" #include "../cards/card_info_picture_with_text_overlay_widget.h" #include "../quick_settings/settings_button_widget.h" @@ -19,6 +15,10 @@ #include #include +#include +#include +#include +#include #include #include diff --git a/cockatrice/src/interface/widgets/visual_database_display/visual_database_display_widget.h b/cockatrice/src/interface/widgets/visual_database_display/visual_database_display_widget.h index 947afeae1..736223dee 100644 --- a/cockatrice/src/interface/widgets/visual_database_display/visual_database_display_widget.h +++ b/cockatrice/src/interface/widgets/visual_database_display/visual_database_display_widget.h @@ -7,13 +7,10 @@ #ifndef VISUAL_DATABASE_DISPLAY_WIDGET_H #define VISUAL_DATABASE_DISPLAY_WIDGET_H -#include "../../../database/card_database.h" -#include "../../../database/model/card_database_model.h" #include "../../../deck/custom_line_edit.h" #include "../../../deck/deck_list_model.h" #include "../../../filters/filter_tree_model.h" #include "../../../tabs/abstract_tab_deck_editor.h" -#include "../../../utility/key_signals.h" #include "../../layouts/flow_layout.h" #include "../cards/card_info_picture_with_text_overlay_widget.h" #include "../cards/card_size_widget.h" @@ -31,6 +28,9 @@ #include #include #include +#include +#include +#include #include inline Q_LOGGING_CATEGORY(VisualDatabaseDisplayLog, "visual_database_display"); diff --git a/cockatrice/src/interface/widgets/visual_database_display/visual_database_filter_display_widget.cpp b/cockatrice/src/interface/widgets/visual_database_display/visual_database_filter_display_widget.cpp index 3f6c2d104..093a52d72 100644 --- a/cockatrice/src/interface/widgets/visual_database_display/visual_database_filter_display_widget.cpp +++ b/cockatrice/src/interface/widgets/visual_database_display/visual_database_filter_display_widget.cpp @@ -1,13 +1,12 @@ #include "visual_database_filter_display_widget.h" -#include "../../../settings/cache_settings.h" - #include #include #include #include #include #include +#include FilterDisplayWidget::FilterDisplayWidget(QWidget *parent, const QString &filename, FilterTreeModel *_filterModel) : QWidget(parent), filterFilename(filename), filterModel(_filterModel) diff --git a/cockatrice/src/interface/widgets/visual_deck_editor/visual_deck_editor_sample_hand_widget.cpp b/cockatrice/src/interface/widgets/visual_deck_editor/visual_deck_editor_sample_hand_widget.cpp index 0f3fc9e49..c73260115 100644 --- a/cockatrice/src/interface/widgets/visual_deck_editor/visual_deck_editor_sample_hand_widget.cpp +++ b/cockatrice/src/interface/widgets/visual_deck_editor/visual_deck_editor_sample_hand_widget.cpp @@ -1,10 +1,10 @@ #include "visual_deck_editor_sample_hand_widget.h" -#include "../../../database/card_database_manager.h" #include "../../../deck/deck_loader.h" -#include "../../../settings/cache_settings.h" #include "../cards/card_info_picture_widget.h" +#include +#include #include VisualDeckEditorSampleHandWidget::VisualDeckEditorSampleHandWidget(QWidget *parent, DeckListModel *_deckListModel) diff --git a/cockatrice/src/interface/widgets/visual_deck_editor/visual_deck_editor_widget.cpp b/cockatrice/src/interface/widgets/visual_deck_editor/visual_deck_editor_widget.cpp index 6a23d8215..bf2c7f7e7 100644 --- a/cockatrice/src/interface/widgets/visual_deck_editor/visual_deck_editor_widget.cpp +++ b/cockatrice/src/interface/widgets/visual_deck_editor/visual_deck_editor_widget.cpp @@ -1,14 +1,8 @@ #include "visual_deck_editor_widget.h" -#include "../../../database/card_database.h" -#include "../../../database/card_database_manager.h" -#include "../../../database/model/card/card_completer_proxy_model.h" -#include "../../../database/model/card/card_search_model.h" -#include "../../../database/model/card_database_model.h" #include "../../../deck/deck_list_model.h" #include "../../../deck/deck_loader.h" #include "../../../main.h" -#include "../../../utility/card_info_comparator.h" #include "../../layouts/overlap_layout.h" #include "../cards/card_info_picture_with_text_overlay_widget.h" #include "../cards/deck_card_zone_display_widget.h" @@ -21,6 +15,12 @@ #include #include #include +#include +#include +#include +#include +#include +#include #include VisualDeckEditorWidget::VisualDeckEditorWidget(QWidget *parent, DeckListModel *_deckListModel) diff --git a/cockatrice/src/interface/widgets/visual_deck_editor/visual_deck_editor_widget.h b/cockatrice/src/interface/widgets/visual_deck_editor/visual_deck_editor_widget.h index 5453b6e22..06e41f408 100644 --- a/cockatrice/src/interface/widgets/visual_deck_editor/visual_deck_editor_widget.h +++ b/cockatrice/src/interface/widgets/visual_deck_editor/visual_deck_editor_widget.h @@ -7,10 +7,6 @@ #ifndef VISUAL_DECK_EDITOR_H #define VISUAL_DECK_EDITOR_H -#include "../../../database/card_database.h" -#include "../../../database/model/card/card_completer_proxy_model.h" -#include "../../../database/model/card_database_display_model.h" -#include "../../../database/model/card_database_model.h" #include "../../../deck/deck_list_model.h" #include "../cards/card_info_picture_with_text_overlay_widget.h" #include "../cards/card_size_widget.h" @@ -22,6 +18,10 @@ #include #include #include +#include +#include +#include +#include #include class DeckCardZoneDisplayWidget; diff --git a/cockatrice/src/interface/widgets/visual_deck_storage/deck_preview/deck_preview_deck_tags_display_widget.cpp b/cockatrice/src/interface/widgets/visual_deck_storage/deck_preview/deck_preview_deck_tags_display_widget.cpp index 6dc579c5b..067318ab5 100644 --- a/cockatrice/src/interface/widgets/visual_deck_storage/deck_preview/deck_preview_deck_tags_display_widget.cpp +++ b/cockatrice/src/interface/widgets/visual_deck_storage/deck_preview/deck_preview_deck_tags_display_widget.cpp @@ -1,7 +1,6 @@ #include "deck_preview_deck_tags_display_widget.h" #include "../../../../dialogs/dlg_convert_deck_to_cod_format.h" -#include "../../../../settings/cache_settings.h" #include "../../../../tabs/tab_deck_editor.h" #include "../../general/layout_containers/flow_widget.h" #include "deck_preview_tag_addition_widget.h" @@ -13,6 +12,7 @@ #include #include #include +#include DeckPreviewDeckTagsDisplayWidget::DeckPreviewDeckTagsDisplayWidget(QWidget *_parent, DeckList *_deckList) : QWidget(_parent), deckList(nullptr) diff --git a/cockatrice/src/interface/widgets/visual_deck_storage/deck_preview/deck_preview_tag_addition_widget.cpp b/cockatrice/src/interface/widgets/visual_deck_storage/deck_preview/deck_preview_tag_addition_widget.cpp index df9fa72ae..21e2b0364 100644 --- a/cockatrice/src/interface/widgets/visual_deck_storage/deck_preview/deck_preview_tag_addition_widget.cpp +++ b/cockatrice/src/interface/widgets/visual_deck_storage/deck_preview/deck_preview_tag_addition_widget.cpp @@ -1,6 +1,5 @@ #include "deck_preview_tag_addition_widget.h" -#include "../../../../settings/cache_settings.h" #include "../../../../tabs/abstract_tab_deck_editor.h" #include "deck_preview_tag_dialog.h" @@ -8,6 +7,7 @@ #include #include #include +#include #include DeckPreviewTagAdditionWidget::DeckPreviewTagAdditionWidget(QWidget *_parent, QString _tagName) diff --git a/cockatrice/src/interface/widgets/visual_deck_storage/deck_preview/deck_preview_tag_dialog.cpp b/cockatrice/src/interface/widgets/visual_deck_storage/deck_preview/deck_preview_tag_dialog.cpp index 601a03394..513c2543b 100644 --- a/cockatrice/src/interface/widgets/visual_deck_storage/deck_preview/deck_preview_tag_dialog.cpp +++ b/cockatrice/src/interface/widgets/visual_deck_storage/deck_preview/deck_preview_tag_dialog.cpp @@ -1,7 +1,6 @@ #include "deck_preview_tag_dialog.h" #include "../../../../dialogs/dlg_default_tags_editor.h" -#include "../../../../settings/cache_settings.h" #include "deck_preview_tag_item_widget.h" #include @@ -12,6 +11,7 @@ #include #include #include +#include DeckPreviewTagDialog::DeckPreviewTagDialog(const QStringList &knownTags, const QStringList &_activeTags, diff --git a/cockatrice/src/interface/widgets/visual_deck_storage/deck_preview/deck_preview_widget.cpp b/cockatrice/src/interface/widgets/visual_deck_storage/deck_preview/deck_preview_widget.cpp index 695918861..6a240020f 100644 --- a/cockatrice/src/interface/widgets/visual_deck_storage/deck_preview/deck_preview_widget.cpp +++ b/cockatrice/src/interface/widgets/visual_deck_storage/deck_preview/deck_preview_widget.cpp @@ -1,7 +1,5 @@ #include "deck_preview_widget.h" -#include "../../../../database/card_database_manager.h" -#include "../../../../settings/cache_settings.h" #include "../../cards/additional_info/color_identity_widget.h" #include "../../cards/deck_preview_card_picture_widget.h" #include "deck_preview_deck_tags_display_widget.h" @@ -15,6 +13,8 @@ #include #include #include +#include +#include DeckPreviewWidget::DeckPreviewWidget(QWidget *_parent, VisualDeckStorageWidget *_visualDeckStorageWidget, diff --git a/cockatrice/src/interface/widgets/visual_deck_storage/visual_deck_storage_folder_display_widget.cpp b/cockatrice/src/interface/widgets/visual_deck_storage/visual_deck_storage_folder_display_widget.cpp index 235e62deb..f36b84a1c 100644 --- a/cockatrice/src/interface/widgets/visual_deck_storage/visual_deck_storage_folder_display_widget.cpp +++ b/cockatrice/src/interface/widgets/visual_deck_storage/visual_deck_storage_folder_display_widget.cpp @@ -1,10 +1,10 @@ #include "visual_deck_storage_folder_display_widget.h" -#include "../../../settings/cache_settings.h" #include "deck_preview/deck_preview_widget.h" #include #include +#include VisualDeckStorageFolderDisplayWidget::VisualDeckStorageFolderDisplayWidget( QWidget *parent, diff --git a/cockatrice/src/interface/widgets/visual_deck_storage/visual_deck_storage_quick_settings_widget.cpp b/cockatrice/src/interface/widgets/visual_deck_storage/visual_deck_storage_quick_settings_widget.cpp index 6e269a9b5..19bf070c9 100644 --- a/cockatrice/src/interface/widgets/visual_deck_storage/visual_deck_storage_quick_settings_widget.cpp +++ b/cockatrice/src/interface/widgets/visual_deck_storage/visual_deck_storage_quick_settings_widget.cpp @@ -1,11 +1,11 @@ #include "visual_deck_storage_quick_settings_widget.h" -#include "../../../settings/cache_settings.h" #include "visual_deck_storage_widget.h" #include #include #include +#include VisualDeckStorageQuickSettingsWidget::VisualDeckStorageQuickSettingsWidget(QWidget *parent) : SettingsButtonWidget(parent) diff --git a/cockatrice/src/interface/widgets/visual_deck_storage/visual_deck_storage_search_widget.cpp b/cockatrice/src/interface/widgets/visual_deck_storage/visual_deck_storage_search_widget.cpp index 69fb1025a..18430d698 100644 --- a/cockatrice/src/interface/widgets/visual_deck_storage/visual_deck_storage_search_widget.cpp +++ b/cockatrice/src/interface/widgets/visual_deck_storage/visual_deck_storage_search_widget.cpp @@ -2,10 +2,10 @@ #include "../../../filters/deck_filter_string.h" #include "../../../filters/syntax_help.h" -#include "../../../settings/cache_settings.h" #include "../../pixel_map_generator.h" #include +#include /** * @brief Constructs a PrintingSelectorCardSearchWidget for searching cards by set name or set code. diff --git a/cockatrice/src/interface/widgets/visual_deck_storage/visual_deck_storage_sort_widget.cpp b/cockatrice/src/interface/widgets/visual_deck_storage/visual_deck_storage_sort_widget.cpp index c7917ed44..c68dfdc3b 100644 --- a/cockatrice/src/interface/widgets/visual_deck_storage/visual_deck_storage_sort_widget.cpp +++ b/cockatrice/src/interface/widgets/visual_deck_storage/visual_deck_storage_sort_widget.cpp @@ -1,6 +1,6 @@ #include "visual_deck_storage_sort_widget.h" -#include "../../../settings/cache_settings.h" +#include /** * @brief Constructs a PrintingSelectorCardSortWidget for searching cards by set name or set code. diff --git a/cockatrice/src/interface/widgets/visual_deck_storage/visual_deck_storage_widget.cpp b/cockatrice/src/interface/widgets/visual_deck_storage/visual_deck_storage_widget.cpp index 36f9c7705..847846c53 100644 --- a/cockatrice/src/interface/widgets/visual_deck_storage/visual_deck_storage_widget.cpp +++ b/cockatrice/src/interface/widgets/visual_deck_storage/visual_deck_storage_widget.cpp @@ -1,7 +1,5 @@ #include "visual_deck_storage_widget.h" -#include "../../../database/card_database_manager.h" -#include "../../../settings/cache_settings.h" #include "../quick_settings/settings_button_widget.h" #include "deck_preview/deck_preview_widget.h" #include "visual_deck_storage_folder_display_widget.h" @@ -14,6 +12,8 @@ #include #include #include +#include +#include VisualDeckStorageWidget::VisualDeckStorageWidget(QWidget *parent) : QWidget(parent), folderWidget(nullptr) { diff --git a/cockatrice/src/interface/window_main.cpp b/cockatrice/src/interface/window_main.cpp index f1117c369..fbe9b5b10 100644 --- a/cockatrice/src/interface/window_main.cpp +++ b/cockatrice/src/interface/window_main.cpp @@ -22,8 +22,6 @@ #include "../client/get_text_with_max.h" #include "../client/network/client_update_checker.h" #include "../client/network/release_channel.h" -#include "../database/card_database.h" -#include "../database/card_database_manager.h" #include "../dialogs/dlg_connect.h" #include "../dialogs/dlg_edit_tokens.h" #include "../dialogs/dlg_forgot_password_challenge.h" @@ -37,18 +35,8 @@ #include "../dialogs/dlg_update.h" #include "../dialogs/dlg_view_log.h" #include "../main.h" -#include "../server/local_client.h" -#include "../server/local_server.h" -#include "../server/local_server_interface.h" -#include "../server/remote/remote_client.h" -#include "../settings/cache_settings.h" #include "../tabs/tab_game.h" #include "../tabs/tab_supervisor.h" -#include "../utility/logger.h" -#include "pb/event_connection_closed.pb.h" -#include "pb/event_server_shutdown.pb.h" -#include "pb/game_replay.pb.h" -#include "pb/room_commands.pb.h" #include "version_string.h" #include @@ -72,6 +60,18 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #define GITHUB_PAGES_URL "https://cockatrice.github.io" #define GITHUB_CONTRIBUTORS_URL "https://github.com/Cockatrice/Cockatrice/graphs/contributors?type=c" diff --git a/cockatrice/src/interface/window_main.h b/cockatrice/src/interface/window_main.h index 3b1b25638..620a09467 100644 --- a/cockatrice/src/interface/window_main.h +++ b/cockatrice/src/interface/window_main.h @@ -25,9 +25,6 @@ #ifndef WINDOW_H #define WINDOW_H -#include "../server/abstract_client.h" -#include "pb/response.pb.h" - #include #include #include @@ -35,6 +32,8 @@ #include #include #include +#include +#include inline Q_LOGGING_CATEGORY(WindowMainLog, "window_main"); inline Q_LOGGING_CATEGORY(WindowMainStartupLog, "window_main.startup"); diff --git a/cockatrice/src/main.cpp b/cockatrice/src/main.cpp index 3a047ef98..14b824eb3 100644 --- a/cockatrice/src/main.cpp +++ b/cockatrice/src/main.cpp @@ -24,13 +24,9 @@ #include "client/network/spoiler_background_updater.h" #include "client/sound_engine.h" #include "dialogs/dlg_settings.h" -#include "featureset.h" #include "interface/pixel_map_generator.h" #include "interface/theme_manager.h" #include "interface/window_main.h" -#include "rng_sfmt.h" -#include "settings/cache_settings.h" -#include "utility/logger.h" #include "version_string.h" #include @@ -45,6 +41,10 @@ #include #include #include +#include +#include +#include +#include QTranslator *translator, *qtTranslator; RNG_Abstract *rng; diff --git a/cockatrice/src/main.h b/cockatrice/src/main.h index 1cdc4e78d..487abc0ea 100644 --- a/cockatrice/src/main.h +++ b/cockatrice/src/main.h @@ -7,9 +7,8 @@ #ifndef MAIN_H #define MAIN_H -#include "utility/macros.h" - #include +#include inline Q_LOGGING_CATEGORY(MainLog, "main"); inline Q_LOGGING_CATEGORY(QtTranslatorDebug, "qt_translator"); diff --git a/cockatrice/src/server/chat_view/chat_view.cpp b/cockatrice/src/server/chat_view/chat_view.cpp index b6a6b3f98..3288f6143 100644 --- a/cockatrice/src/server/chat_view/chat_view.cpp +++ b/cockatrice/src/server/chat_view/chat_view.cpp @@ -2,18 +2,18 @@ #include "../../client/sound_engine.h" #include "../../interface/pixel_map_generator.h" -#include "../../settings/cache_settings.h" #include "../../tabs/tab_account.h" #include "../user/user_context_menu.h" #include "../user/user_list_manager.h" #include "../user/user_list_proxy.h" -#include "user_level.h" #include #include #include #include #include +#include +#include const QColor DEFAULT_MENTION_COLOR = QColor(194, 31, 47); diff --git a/cockatrice/src/server/chat_view/chat_view.h b/cockatrice/src/server/chat_view/chat_view.h index 924c2ff42..3e4c21712 100644 --- a/cockatrice/src/server/chat_view/chat_view.h +++ b/cockatrice/src/server/chat_view/chat_view.h @@ -10,14 +10,14 @@ #include "../../tabs/tab_supervisor.h" #include "../user/user_list_widget.h" -#include "room_message_type.h" -#include "user_level.h" #include #include #include #include #include +#include +#include class AbstractGame; class QTextTable; diff --git a/cockatrice/src/server/game_selector.cpp b/cockatrice/src/server/game_selector.cpp index 3cfd3315a..175def86d 100644 --- a/cockatrice/src/server/game_selector.cpp +++ b/cockatrice/src/server/game_selector.cpp @@ -7,12 +7,7 @@ #include "../tabs/tab_game.h" #include "../tabs/tab_room.h" #include "../tabs/tab_supervisor.h" -#include "abstract_client.h" #include "games_model.h" -#include "pb/response.pb.h" -#include "pb/room_commands.pb.h" -#include "pb/serverinfo_game.pb.h" -#include "pending_command.h" #include "user/user_list_manager.h" #include @@ -26,6 +21,11 @@ #include #include #include +#include +#include +#include +#include +#include GameSelector::GameSelector(AbstractClient *_client, TabSupervisor *_tabSupervisor, diff --git a/cockatrice/src/server/game_selector.h b/cockatrice/src/server/game_selector.h index a6cadf141..0ca477fa9 100644 --- a/cockatrice/src/server/game_selector.h +++ b/cockatrice/src/server/game_selector.h @@ -10,9 +10,9 @@ #include "game_type_map.h" #include -#include -#include -#include +#include +#include +#include class QTreeView; class GamesModel; diff --git a/cockatrice/src/server/games_model.cpp b/cockatrice/src/server/games_model.cpp index 5c336738c..3a8c626ea 100644 --- a/cockatrice/src/server/games_model.cpp +++ b/cockatrice/src/server/games_model.cpp @@ -1,9 +1,7 @@ #include "games_model.h" #include "../interface/pixel_map_generator.h" -#include "../settings/cache_settings.h" #include "../tabs/tab_account.h" -#include "pb/serverinfo_game.pb.h" #include "user/user_list_manager.h" #include "user/user_list_widget.h" @@ -13,6 +11,8 @@ #include #include #include +#include +#include enum GameListColumn { diff --git a/cockatrice/src/server/games_model.h b/cockatrice/src/server/games_model.h index 03717bce8..1541b57bf 100644 --- a/cockatrice/src/server/games_model.h +++ b/cockatrice/src/server/games_model.h @@ -8,7 +8,6 @@ #define GAMESMODEL_H #include "game_type_map.h" -#include "pb/serverinfo_game.pb.h" #include #include @@ -16,6 +15,7 @@ #include #include #include +#include class UserListProxy; diff --git a/cockatrice/src/server/handle_public_servers.cpp b/cockatrice/src/server/handle_public_servers.cpp index cc44ba262..2497ecdcc 100644 --- a/cockatrice/src/server/handle_public_servers.cpp +++ b/cockatrice/src/server/handle_public_servers.cpp @@ -1,12 +1,11 @@ #include "handle_public_servers.h" -#include "../settings/cache_settings.h" - #include #include #include #include #include +#include #define PUBLIC_SERVERS_JSON "https://cockatrice.github.io/public-servers.json" diff --git a/cockatrice/src/server/remote/remote_decklist_tree_widget.cpp b/cockatrice/src/server/remote/remote_decklist_tree_widget.cpp index dfed741f9..6ca680c3f 100644 --- a/cockatrice/src/server/remote/remote_decklist_tree_widget.cpp +++ b/cockatrice/src/server/remote/remote_decklist_tree_widget.cpp @@ -1,14 +1,13 @@ #include "remote_decklist_tree_widget.h" -#include "../abstract_client.h" -#include "../pending_command.h" -#include "pb/command_deck_list.pb.h" -#include "pb/response_deck_list.pb.h" -#include "pb/serverinfo_deckstorage.pb.h" - #include #include #include +#include +#include +#include +#include +#include RemoteDeckList_TreeModel::DirectoryNode::DirectoryNode(const QString &_name, RemoteDeckList_TreeModel::DirectoryNode *_parent) diff --git a/cockatrice/src/server/remote/remote_replay_list_tree_widget.cpp b/cockatrice/src/server/remote/remote_replay_list_tree_widget.cpp index 1fa72b20c..a5e8e46df 100644 --- a/cockatrice/src/server/remote/remote_replay_list_tree_widget.cpp +++ b/cockatrice/src/server/remote/remote_replay_list_tree_widget.cpp @@ -1,14 +1,13 @@ #include "remote_replay_list_tree_widget.h" -#include "../abstract_client.h" -#include "../pending_command.h" -#include "pb/command_replay_list.pb.h" -#include "pb/response_replay_list.pb.h" -#include "pb/serverinfo_replay.pb.h" - #include #include #include +#include +#include +#include +#include +#include const int RemoteReplayList_TreeModel::numberOfColumns = 6; diff --git a/cockatrice/src/server/remote/remote_replay_list_tree_widget.h b/cockatrice/src/server/remote/remote_replay_list_tree_widget.h index ccff71c47..d5d70af53 100644 --- a/cockatrice/src/server/remote/remote_replay_list_tree_widget.h +++ b/cockatrice/src/server/remote/remote_replay_list_tree_widget.h @@ -9,12 +9,11 @@ #ifndef REMOTEREPLAYLIST_TREEWIDGET_H #define REMOTEREPLAYLIST_TREEWIDGET_H -#include "pb/serverinfo_replay.pb.h" -#include "pb/serverinfo_replay_match.pb.h" - #include #include #include +#include +#include class Response; class AbstractClient; diff --git a/cockatrice/src/server/user/user_context_menu.cpp b/cockatrice/src/server/user/user_context_menu.cpp index c6782ef18..405799ba0 100644 --- a/cockatrice/src/server/user/user_context_menu.cpp +++ b/cockatrice/src/server/user/user_context_menu.cpp @@ -3,20 +3,8 @@ #include "../../tabs/tab_account.h" #include "../../tabs/tab_game.h" #include "../../tabs/tab_supervisor.h" -#include "../abstract_client.h" #include "../chat_view/chat_view.h" #include "../game_selector.h" -#include "../pending_command.h" -#include "pb/command_kick_from_game.pb.h" -#include "pb/commands.pb.h" -#include "pb/moderator_commands.pb.h" -#include "pb/response_ban_history.pb.h" -#include "pb/response_get_admin_notes.pb.h" -#include "pb/response_get_games_of_user.pb.h" -#include "pb/response_get_user_info.pb.h" -#include "pb/response_warn_history.pb.h" -#include "pb/response_warn_list.pb.h" -#include "pb/session_commands.pb.h" #include "user_info_box.h" #include "user_list_manager.h" #include "user_list_proxy.h" @@ -28,6 +16,18 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include UserContextMenu::UserContextMenu(TabSupervisor *_tabSupervisor, QWidget *parent, AbstractGame *_game) : QObject(parent), client(_tabSupervisor->getClient()), tabSupervisor(_tabSupervisor), diff --git a/cockatrice/src/server/user/user_context_menu.h b/cockatrice/src/server/user/user_context_menu.h index d6f48f836..0056d74ae 100644 --- a/cockatrice/src/server/user/user_context_menu.h +++ b/cockatrice/src/server/user/user_context_menu.h @@ -7,9 +7,8 @@ #ifndef USER_CONTEXT_MENU_H #define USER_CONTEXT_MENU_H -#include "user_level.h" - #include +#include class AbstractGame; class UserListProxy; diff --git a/cockatrice/src/server/user/user_info_box.cpp b/cockatrice/src/server/user/user_info_box.cpp index cec0c38e8..e756dfbc9 100644 --- a/cockatrice/src/server/user/user_info_box.cpp +++ b/cockatrice/src/server/user/user_info_box.cpp @@ -5,12 +5,6 @@ #include "../../dialogs/dlg_edit_password.h" #include "../../dialogs/dlg_edit_user.h" #include "../../interface/pixel_map_generator.h" -#include "../abstract_client.h" -#include "../pending_command.h" -#include "passwordhasher.h" -#include "pb/response_get_user_info.pb.h" -#include "pb/serverinfo_user.pb.h" -#include "pb/session_commands.pb.h" #include #include @@ -18,6 +12,12 @@ #include #include #include +#include +#include +#include +#include +#include +#include UserInfoBox::UserInfoBox(AbstractClient *_client, bool _editable, QWidget *parent, Qt::WindowFlags flags) : QWidget(parent, flags), client(_client), editable(_editable) diff --git a/cockatrice/src/server/user/user_info_connection.cpp b/cockatrice/src/server/user/user_info_connection.cpp index 50ac129a8..813a9236c 100644 --- a/cockatrice/src/server/user/user_info_connection.cpp +++ b/cockatrice/src/server/user/user_info_connection.cpp @@ -1,8 +1,7 @@ #include "user_info_connection.h" -#include "../../settings/cache_settings.h" - #include +#include #include UserConnection_Information::UserConnection_Information() = default; diff --git a/cockatrice/src/server/user/user_list_manager.cpp b/cockatrice/src/server/user/user_list_manager.cpp index c74706955..9b930b7f6 100644 --- a/cockatrice/src/server/user/user_list_manager.cpp +++ b/cockatrice/src/server/user/user_list_manager.cpp @@ -1,16 +1,17 @@ #include "user_list_manager.h" #include "../../client/sound_engine.h" -#include "../abstract_client.h" -#include "../pending_command.h" -#include "pb/event_add_to_list.pb.h" -#include "pb/event_remove_from_list.pb.h" -#include "pb/event_user_joined.pb.h" -#include "pb/event_user_left.pb.h" -#include "pb/response_list_users.pb.h" -#include "pb/session_commands.pb.h" #include "user_info_box.h" +#include +#include +#include +#include +#include +#include +#include +#include + UserListManager::UserListManager(AbstractClient *_client, QObject *parent) : QObject(parent), client(_client), ownUserInfo(nullptr) { diff --git a/cockatrice/src/server/user/user_list_manager.h b/cockatrice/src/server/user/user_list_manager.h index b02a43808..56f50c0be 100644 --- a/cockatrice/src/server/user/user_list_manager.h +++ b/cockatrice/src/server/user/user_list_manager.h @@ -7,11 +7,11 @@ #ifndef COCKATRICE_USER_LIST_MANAGER_H #define COCKATRICE_USER_LIST_MANAGER_H -#include "pb/serverinfo_user.pb.h" #include "user_list_proxy.h" #include #include +#include class AbstractClient; class Event_AddToList; diff --git a/cockatrice/src/server/user/user_list_widget.cpp b/cockatrice/src/server/user/user_list_widget.cpp index d4dad5919..68f2f97c8 100644 --- a/cockatrice/src/server/user/user_list_widget.cpp +++ b/cockatrice/src/server/user/user_list_widget.cpp @@ -3,14 +3,7 @@ #include "../../interface/pixel_map_generator.h" #include "../../tabs/tab_account.h" #include "../../tabs/tab_supervisor.h" -#include "../abstract_client.h" #include "../game_selector.h" -#include "../pending_command.h" -#include "pb/moderator_commands.pb.h" -#include "pb/response_get_games_of_user.pb.h" -#include "pb/response_get_user_info.pb.h" -#include "pb/session_commands.pb.h" -#include "trice_limits.h" #include "user_context_menu.h" #include "user_list_manager.h" @@ -30,6 +23,13 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include BanDialog::BanDialog(const ServerInfo_User &info, QWidget *parent) : QDialog(parent) { diff --git a/cockatrice/src/server/user/user_list_widget.h b/cockatrice/src/server/user/user_list_widget.h index 8a1674549..897c01b83 100644 --- a/cockatrice/src/server/user/user_list_widget.h +++ b/cockatrice/src/server/user/user_list_widget.h @@ -7,15 +7,14 @@ #ifndef USERLIST_H #define USERLIST_H -#include "pb/moderator_commands.pb.h" -#include "user_level.h" - #include #include #include #include #include #include +#include +#include class QTreeWidget; class ServerInfo_User; diff --git a/cockatrice/src/tabs/abstract_tab_deck_editor.cpp b/cockatrice/src/tabs/abstract_tab_deck_editor.cpp index 8eb7d35f7..af120ac8b 100644 --- a/cockatrice/src/tabs/abstract_tab_deck_editor.cpp +++ b/cockatrice/src/tabs/abstract_tab_deck_editor.cpp @@ -1,22 +1,14 @@ #include "abstract_tab_deck_editor.h" #include "../client/tapped_out_interface.h" -#include "../database/card_database_manager.h" -#include "../database/model/card_database_model.h" #include "../deck/deck_stats_interface.h" #include "../dialogs/dlg_load_deck.h" #include "../dialogs/dlg_load_deck_from_clipboard.h" #include "../dialogs/dlg_load_deck_from_website.h" +#include "../interface/card_picture_loader/card_picture_loader.h" #include "../interface/pixel_map_generator.h" #include "../interface/widgets/cards/card_info_frame_widget.h" -#include "../picture_loader/picture_loader.h" -#include "../server/abstract_client.h" -#include "../server/pending_command.h" -#include "../settings/cache_settings.h" -#include "pb/command_deck_upload.pb.h" -#include "pb/response.pb.h" #include "tab_supervisor.h" -#include "trice_limits.h" #include #include @@ -39,6 +31,14 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include AbstractTabDeckEditor::AbstractTabDeckEditor(TabSupervisor *_tabSupervisor) : Tab(_tabSupervisor) { @@ -164,7 +164,7 @@ void AbstractTabDeckEditor::openDeck(DeckLoader *deck) void AbstractTabDeckEditor::setDeck(DeckLoader *_deck) { deckDockWidget->setDeck(_deck); - PictureLoader::cacheCardPixmaps(CardDatabaseManager::query()->getCards(getDeckList()->getCardRefList())); + CardPictureLoader::cacheCardPixmaps(CardDatabaseManager::query()->getCards(getDeckList()->getCardRefList())); setModified(false); // If they load a deck, make the deck list appear diff --git a/cockatrice/src/tabs/abstract_tab_deck_editor.h b/cockatrice/src/tabs/abstract_tab_deck_editor.h index e280d747f..9e4e6c14e 100644 --- a/cockatrice/src/tabs/abstract_tab_deck_editor.h +++ b/cockatrice/src/tabs/abstract_tab_deck_editor.h @@ -1,7 +1,6 @@ #ifndef TAB_GENERIC_DECK_EDITOR_H #define TAB_GENERIC_DECK_EDITOR_H -#include "../card/card_info.h" #include "../client/deck_editor_menu.h" #include "../interface/widgets/deck_editor/deck_editor_card_info_dock_widget.h" #include "../interface/widgets/deck_editor/deck_editor_database_display_widget.h" @@ -24,6 +23,7 @@ class DeckEditorFilterDockWidget; class DeckEditorPrintingSelectorDockWidget; class DeckPreviewDeckTagsDisplayWidget; class Response; +class FilterTree; class FilterTreeModel; class FilterBuilder; diff --git a/cockatrice/src/tabs/api/edhrec/display/cards/edhrec_api_response_card_details_display_widget.cpp b/cockatrice/src/tabs/api/edhrec/display/cards/edhrec_api_response_card_details_display_widget.cpp index cde18053b..79880b9ee 100644 --- a/cockatrice/src/tabs/api/edhrec/display/cards/edhrec_api_response_card_details_display_widget.cpp +++ b/cockatrice/src/tabs/api/edhrec/display/cards/edhrec_api_response_card_details_display_widget.cpp @@ -1,8 +1,9 @@ #include "edhrec_api_response_card_details_display_widget.h" -#include "../../../../../database/card_database_manager.h" #include "../../tab_edhrec_main.h" +#include + EdhrecApiResponseCardDetailsDisplayWidget::EdhrecApiResponseCardDetailsDisplayWidget( QWidget *parent, const EdhrecApiResponseCardDetails &_toDisplay) diff --git a/cockatrice/src/tabs/api/edhrec/display/commander/edhrec_api_response_commander_details_display_widget.cpp b/cockatrice/src/tabs/api/edhrec/display/commander/edhrec_api_response_commander_details_display_widget.cpp index bf7444b5e..6c05320e0 100644 --- a/cockatrice/src/tabs/api/edhrec/display/commander/edhrec_api_response_commander_details_display_widget.cpp +++ b/cockatrice/src/tabs/api/edhrec/display/commander/edhrec_api_response_commander_details_display_widget.cpp @@ -1,10 +1,11 @@ #include "edhrec_api_response_commander_details_display_widget.h" -#include "../../../../../database/card_database_manager.h" #include "../../../../../interface/widgets/cards/card_info_picture_widget.h" #include "../../tab_edhrec_main.h" #include "../card_prices/edhrec_api_response_card_prices_display_widget.h" +#include + EdhrecCommanderResponseCommanderDetailsDisplayWidget::EdhrecCommanderResponseCommanderDetailsDisplayWidget( QWidget *parent, const EdhrecCommanderApiResponseCommanderDetails &_commanderDetails, diff --git a/cockatrice/src/tabs/api/edhrec/tab_edhrec.h b/cockatrice/src/tabs/api/edhrec/tab_edhrec.h index ac3d7ea11..0cf48c3e0 100644 --- a/cockatrice/src/tabs/api/edhrec/tab_edhrec.h +++ b/cockatrice/src/tabs/api/edhrec/tab_edhrec.h @@ -7,12 +7,12 @@ #ifndef TAB_EDHREC_H #define TAB_EDHREC_H -#include "../../../card/card_info.h" #include "../../../interface/widgets/general/layout_containers/flow_widget.h" #include "../../tab.h" #include "display/commander/edhrec_commander_api_response_display_widget.h" #include +#include class TabEdhRec : public Tab { diff --git a/cockatrice/src/tabs/api/edhrec/tab_edhrec_main.cpp b/cockatrice/src/tabs/api/edhrec/tab_edhrec_main.cpp index 36089886a..89f17ba64 100644 --- a/cockatrice/src/tabs/api/edhrec/tab_edhrec_main.cpp +++ b/cockatrice/src/tabs/api/edhrec/tab_edhrec_main.cpp @@ -1,8 +1,5 @@ #include "tab_edhrec_main.h" -#include "../../../database/card_database_manager.h" -#include "../../../database/model/card/card_completer_proxy_model.h" -#include "../../../database/model/card/card_search_model.h" #include "../../tab_supervisor.h" #include "api_response/average_deck/edhrec_average_deck_api_response.h" #include "api_response/commander/edhrec_commander_api_response.h" @@ -25,6 +22,9 @@ #include #include #include +#include +#include +#include static bool canBeCommander(const CardInfoPtr &cardInfo) { diff --git a/cockatrice/src/tabs/api/edhrec/tab_edhrec_main.h b/cockatrice/src/tabs/api/edhrec/tab_edhrec_main.h index d9b96ac76..b6f8b5ce6 100644 --- a/cockatrice/src/tabs/api/edhrec/tab_edhrec_main.h +++ b/cockatrice/src/tabs/api/edhrec/tab_edhrec_main.h @@ -7,7 +7,6 @@ #ifndef TAB_EDHREC_MAIN_H #define TAB_EDHREC_MAIN_H -#include "../../../database/card_database.h" #include "../../../interface/widgets/cards/card_size_widget.h" #include "../../../interface/widgets/general/layout_containers/flow_widget.h" #include "../../../interface/widgets/quick_settings/settings_button_widget.h" @@ -18,6 +17,7 @@ #include #include #include +#include class TabEdhRecMain : public Tab { diff --git a/cockatrice/src/tabs/tab.h b/cockatrice/src/tabs/tab.h index a431aac75..56a9f0b7e 100644 --- a/cockatrice/src/tabs/tab.h +++ b/cockatrice/src/tabs/tab.h @@ -7,9 +7,8 @@ #ifndef TAB_H #define TAB_H -#include "card_ref.h" - #include +#include class QMenu; class TabSupervisor; diff --git a/cockatrice/src/tabs/tab_account.cpp b/cockatrice/src/tabs/tab_account.cpp index ba82857fe..fb2df4907 100644 --- a/cockatrice/src/tabs/tab_account.cpp +++ b/cockatrice/src/tabs/tab_account.cpp @@ -2,22 +2,22 @@ #include "../client/sound_engine.h" #include "../deck/custom_line_edit.h" -#include "../server/abstract_client.h" -#include "../server/pending_command.h" #include "../server/user/user_info_box.h" #include "../server/user/user_list_manager.h" #include "../server/user/user_list_widget.h" -#include "pb/event_add_to_list.pb.h" -#include "pb/event_remove_from_list.pb.h" -#include "pb/event_user_joined.pb.h" -#include "pb/event_user_left.pb.h" -#include "pb/response_list_users.pb.h" -#include "pb/session_commands.pb.h" #include "tab_supervisor.h" -#include "trice_limits.h" #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include TabAccount::TabAccount(TabSupervisor *_tabSupervisor, AbstractClient *_client, const ServerInfo_User &userInfo) : Tab(_tabSupervisor), client(_client) diff --git a/cockatrice/src/tabs/tab_account.h b/cockatrice/src/tabs/tab_account.h index 4e6abb24b..e09c12eb2 100644 --- a/cockatrice/src/tabs/tab_account.h +++ b/cockatrice/src/tabs/tab_account.h @@ -7,9 +7,10 @@ #ifndef TAB_ACCOUNT_H #define TAB_ACCOUNT_H -#include "pb/serverinfo_user.pb.h" #include "tab.h" +#include + class AbstractClient; class Event_AddToList; class Event_ListRooms; diff --git a/cockatrice/src/tabs/tab_admin.cpp b/cockatrice/src/tabs/tab_admin.cpp index a3d9e34e8..3ddb53579 100644 --- a/cockatrice/src/tabs/tab_admin.cpp +++ b/cockatrice/src/tabs/tab_admin.cpp @@ -1,12 +1,5 @@ #include "tab_admin.h" -#include "../server/abstract_client.h" -#include "../server/pending_command.h" -#include "pb/admin_commands.pb.h" -#include "pb/event_replay_added.pb.h" -#include "pb/moderator_commands.pb.h" -#include "trice_limits.h" - #include #include #include @@ -15,6 +8,12 @@ #include #include #include +#include +#include +#include +#include +#include +#include ShutdownDialog::ShutdownDialog(QWidget *parent) : QDialog(parent) { diff --git a/cockatrice/src/tabs/tab_admin.h b/cockatrice/src/tabs/tab_admin.h index 60722b778..5b44a6569 100644 --- a/cockatrice/src/tabs/tab_admin.h +++ b/cockatrice/src/tabs/tab_admin.h @@ -7,11 +7,11 @@ #ifndef TAB_ADMIN_H #define TAB_ADMIN_H -#include "pb/commands.pb.h" -#include "pb/response.pb.h" #include "tab.h" #include +#include +#include class AbstractClient; diff --git a/cockatrice/src/tabs/tab_deck_editor.cpp b/cockatrice/src/tabs/tab_deck_editor.cpp index 6d4da740d..b4202803f 100644 --- a/cockatrice/src/tabs/tab_deck_editor.cpp +++ b/cockatrice/src/tabs/tab_deck_editor.cpp @@ -2,8 +2,6 @@ #include "../client/deck_editor_menu.h" #include "../client/tapped_out_interface.h" -#include "../database/card_database_manager.h" -#include "../database/model/card_database_model.h" #include "../dialogs/dlg_load_deck.h" #include "../dialogs/dlg_load_deck_from_clipboard.h" #include "../filters/filter_builder.h" @@ -11,11 +9,7 @@ #include "../interface/pixel_map_generator.h" #include "../interface/widgets/cards/card_info_frame_widget.h" #include "../interface/widgets/deck_editor/deck_editor_filter_dock_widget.h" -#include "../server/abstract_client.h" -#include "../server/pending_command.h" -#include "../settings/cache_settings.h" #include "tab_supervisor.h" -#include "trice_limits.h" #include #include @@ -38,6 +32,12 @@ #include #include #include +#include +#include +#include +#include +#include +#include TabDeckEditor::TabDeckEditor(TabSupervisor *_tabSupervisor) : AbstractTabDeckEditor(_tabSupervisor) { diff --git a/cockatrice/src/tabs/tab_deck_editor.h b/cockatrice/src/tabs/tab_deck_editor.h index 078560da1..ec953055c 100644 --- a/cockatrice/src/tabs/tab_deck_editor.h +++ b/cockatrice/src/tabs/tab_deck_editor.h @@ -1,11 +1,12 @@ #ifndef WINDOW_DECKEDITOR_H #define WINDOW_DECKEDITOR_H -#include "../card/card_info.h" #include "../interface/widgets/visual_deck_storage/deck_preview/deck_preview_deck_tags_display_widget.h" -#include "../utility/key_signals.h" #include "abstract_tab_deck_editor.h" +#include +#include + class CardDatabaseModel; class CardDatabaseDisplayModel; class DeckListModel; diff --git a/cockatrice/src/tabs/tab_deck_storage.cpp b/cockatrice/src/tabs/tab_deck_storage.cpp index 898612e6f..5940d1210 100644 --- a/cockatrice/src/tabs/tab_deck_storage.cpp +++ b/cockatrice/src/tabs/tab_deck_storage.cpp @@ -2,18 +2,7 @@ #include "../client/get_text_with_max.h" #include "../deck/deck_loader.h" -#include "../server/pending_command.h" #include "../server/remote/remote_decklist_tree_widget.h" -#include "../settings/cache_settings.h" -#include "deck_list.h" -#include "pb/command_deck_del.pb.h" -#include "pb/command_deck_del_dir.pb.h" -#include "pb/command_deck_download.pb.h" -#include "pb/command_deck_new_dir.pb.h" -#include "pb/command_deck_upload.pb.h" -#include "pb/response.pb.h" -#include "pb/response_deck_download.pb.h" -#include "pb/response_deck_upload.pb.h" #include #include @@ -29,6 +18,17 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include TabDeckStorage::TabDeckStorage(TabSupervisor *_tabSupervisor, AbstractClient *_client, diff --git a/cockatrice/src/tabs/tab_deck_storage.h b/cockatrice/src/tabs/tab_deck_storage.h index ae52bba85..c0c4e9cfa 100644 --- a/cockatrice/src/tabs/tab_deck_storage.h +++ b/cockatrice/src/tabs/tab_deck_storage.h @@ -8,10 +8,11 @@ #ifndef TAB_DECK_STORAGE_H #define TAB_DECK_STORAGE_H -#include "../server/abstract_client.h" #include "../server/remote/remote_decklist_tree_widget.h" #include "tab.h" +#include + class ServerInfo_User; class AbstractClient; class QTreeView; diff --git a/cockatrice/src/tabs/tab_game.cpp b/cockatrice/src/tabs/tab_game.cpp index c31f548d6..7c1bb6aee 100644 --- a/cockatrice/src/tabs/tab_game.cpp +++ b/cockatrice/src/tabs/tab_game.cpp @@ -1,8 +1,6 @@ #include "tab_game.h" #include "../client/network/replay_timeline_widget.h" -#include "../database/card_database.h" -#include "../database/card_database_manager.h" #include "../dialogs/dlg_create_game.h" #include "../game/board/arrow_item.h" #include "../game/board/card_item.h" @@ -17,20 +15,13 @@ #include "../game/player/player_list_widget.h" #include "../game/replay.h" #include "../game/zones/card_zone.h" +#include "../interface/card_picture_loader/card_picture_loader.h" #include "../interface/line_edit_completer.h" #include "../interface/widgets/cards/card_info_frame_widget.h" #include "../interface/window_main.h" #include "../main.h" -#include "../picture_loader/picture_loader.h" -#include "../server/abstract_client.h" #include "../server/user/user_list_manager.h" -#include "../settings/cache_settings.h" -#include "pb/event_game_joined.pb.h" -#include "pb/game_replay.pb.h" -#include "pb/serverinfo_player.pb.h" -#include "pb/serverinfo_user.pb.h" #include "tab_supervisor.h" -#include "trice_limits.h" #include #include @@ -46,6 +37,15 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include TabGame::TabGame(TabSupervisor *_tabSupervisor, GameReplay *_replay) : Tab(_tabSupervisor), sayLabel(nullptr), sayEdit(nullptr) @@ -757,7 +757,7 @@ void TabGame::loadDeckForLocalPlayer(Player *localPlayer, int playerId, ServerIn TabbedDeckViewContainer *deckViewContainer = deckViewContainers.value(playerId); if (playerInfo.has_deck_list()) { DeckLoader newDeck(QString::fromStdString(playerInfo.deck_list())); - PictureLoader::cacheCardPixmaps(CardDatabaseManager::query()->getCards(newDeck.getCardRefList())); + CardPictureLoader::cacheCardPixmaps(CardDatabaseManager::query()->getCards(newDeck.getCardRefList())); deckViewContainer->playerDeckView->setDeck(newDeck); localPlayer->setDeck(newDeck); } diff --git a/cockatrice/src/tabs/tab_game.h b/cockatrice/src/tabs/tab_game.h index eee5769ab..956b72c9b 100644 --- a/cockatrice/src/tabs/tab_game.h +++ b/cockatrice/src/tabs/tab_game.h @@ -15,12 +15,12 @@ #include "../game/player/player.h" #include "../interface/tearoff_menu.h" #include "../interface/widgets/visual_deck_storage/visual_deck_storage_widget.h" -#include "pb/event_leave.pb.h" #include "tab.h" #include #include #include +#include class ServerInfo_PlayerProperties; class TabbedDeckViewContainer; diff --git a/cockatrice/src/tabs/tab_home.h b/cockatrice/src/tabs/tab_home.h index 26a372884..3738b73fd 100644 --- a/cockatrice/src/tabs/tab_home.h +++ b/cockatrice/src/tabs/tab_home.h @@ -8,10 +8,10 @@ #define TAB_HOME_H #include "../interface/widgets/general/home_widget.h" -#include "../server/abstract_client.h" #include "tab.h" #include +#include #include class AbstractClient; diff --git a/cockatrice/src/tabs/tab_logs.cpp b/cockatrice/src/tabs/tab_logs.cpp index 4a791a27e..c23a26be3 100644 --- a/cockatrice/src/tabs/tab_logs.cpp +++ b/cockatrice/src/tabs/tab_logs.cpp @@ -2,11 +2,6 @@ #include "../deck/custom_line_edit.h" #include "../dialogs/dlg_manage_sets.h" -#include "../server/abstract_client.h" -#include "../server/pending_command.h" -#include "pb/moderator_commands.pb.h" -#include "pb/response_viewlog_history.pb.h" -#include "trice_limits.h" #include #include @@ -20,6 +15,11 @@ #include #include #include +#include +#include +#include +#include +#include TabLog::TabLog(TabSupervisor *_tabSupervisor, AbstractClient *_client) : Tab(_tabSupervisor), client(_client) { diff --git a/cockatrice/src/tabs/tab_message.cpp b/cockatrice/src/tabs/tab_message.cpp index 6b4b7044b..671a3285d 100644 --- a/cockatrice/src/tabs/tab_message.cpp +++ b/cockatrice/src/tabs/tab_message.cpp @@ -3,21 +3,21 @@ #include "../client/sound_engine.h" #include "../deck/custom_line_edit.h" #include "../main.h" -#include "../server/abstract_client.h" #include "../server/chat_view/chat_view.h" -#include "../server/pending_command.h" #include "../server/user/user_list_manager.h" -#include "../settings/cache_settings.h" -#include "pb/event_user_message.pb.h" -#include "pb/serverinfo_user.pb.h" -#include "pb/session_commands.pb.h" -#include "trice_limits.h" #include #include #include #include #include +#include +#include +#include +#include +#include +#include +#include TabMessage::TabMessage(TabSupervisor *_tabSupervisor, AbstractClient *_client, diff --git a/cockatrice/src/tabs/tab_replays.cpp b/cockatrice/src/tabs/tab_replays.cpp index 2feb41383..eb6543e44 100644 --- a/cockatrice/src/tabs/tab_replays.cpp +++ b/cockatrice/src/tabs/tab_replays.cpp @@ -1,19 +1,6 @@ #include "tab_replays.h" -#include "../server/abstract_client.h" -#include "../server/pending_command.h" #include "../server/remote/remote_replay_list_tree_widget.h" -#include "../settings/cache_settings.h" -#include "pb/command_replay_delete_match.pb.h" -#include "pb/command_replay_download.pb.h" -#include "pb/command_replay_get_code.pb.h" -#include "pb/command_replay_modify_match.pb.h" -#include "pb/command_replay_submit_code.pb.h" -#include "pb/event_replay_added.pb.h" -#include "pb/game_replay.pb.h" -#include "pb/response.pb.h" -#include "pb/response_replay_download.pb.h" -#include "pb/response_replay_get_code.pb.h" #include "tab_game.h" #include @@ -30,6 +17,19 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include TabReplays::TabReplays(TabSupervisor *_tabSupervisor, AbstractClient *_client, const ServerInfo_User *currentUserInfo) : Tab(_tabSupervisor), client(_client) diff --git a/cockatrice/src/tabs/tab_replays.h b/cockatrice/src/tabs/tab_replays.h index 7a29abe1f..bf21ada82 100644 --- a/cockatrice/src/tabs/tab_replays.h +++ b/cockatrice/src/tabs/tab_replays.h @@ -8,9 +8,10 @@ #ifndef TAB_REPLAYS_H #define TAB_REPLAYS_H -#include "../server/abstract_client.h" #include "tab.h" +#include + class ServerInfo_User; class Response; class AbstractClient; diff --git a/cockatrice/src/tabs/tab_room.cpp b/cockatrice/src/tabs/tab_room.cpp index ff6507b29..8ecf2061b 100644 --- a/cockatrice/src/tabs/tab_room.cpp +++ b/cockatrice/src/tabs/tab_room.cpp @@ -2,24 +2,12 @@ #include "../dialogs/dlg_settings.h" #include "../main.h" -#include "../server/abstract_client.h" #include "../server/chat_view/chat_view.h" #include "../server/game_selector.h" -#include "../server/pending_command.h" #include "../server/user/user_list_manager.h" #include "../server/user/user_list_widget.h" -#include "../settings/cache_settings.h" -#include "get_pb_extension.h" -#include "pb/event_join_room.pb.h" -#include "pb/event_leave_room.pb.h" -#include "pb/event_list_games.pb.h" -#include "pb/event_remove_messages.pb.h" -#include "pb/event_room_say.pb.h" -#include "pb/room_commands.pb.h" -#include "pb/serverinfo_room.pb.h" #include "tab_account.h" #include "tab_supervisor.h" -#include "trice_limits.h" #include #include @@ -32,6 +20,18 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include TabRoom::TabRoom(TabSupervisor *_tabSupervisor, AbstractClient *_client, diff --git a/cockatrice/src/tabs/tab_server.cpp b/cockatrice/src/tabs/tab_server.cpp index 069f06313..593eb0702 100644 --- a/cockatrice/src/tabs/tab_server.cpp +++ b/cockatrice/src/tabs/tab_server.cpp @@ -1,12 +1,6 @@ #include "tab_server.h" -#include "../server/abstract_client.h" -#include "../server/pending_command.h" #include "../server/user/user_list_widget.h" -#include "pb/event_list_rooms.pb.h" -#include "pb/event_server_message.pb.h" -#include "pb/response_join_room.pb.h" -#include "pb/session_commands.pb.h" #include "tab_supervisor.h" #include @@ -20,6 +14,12 @@ #include #include #include +#include +#include +#include +#include +#include +#include RoomSelector::RoomSelector(AbstractClient *_client, QWidget *parent) : QGroupBox(parent), client(_client) { diff --git a/cockatrice/src/tabs/tab_supervisor.cpp b/cockatrice/src/tabs/tab_supervisor.cpp index 78fce4516..41d05f618 100644 --- a/cockatrice/src/tabs/tab_supervisor.cpp +++ b/cockatrice/src/tabs/tab_supervisor.cpp @@ -2,20 +2,9 @@ #include "../interface/pixel_map_generator.h" #include "../main.h" -#include "../server/abstract_client.h" #include "../server/user/user_list_manager.h" #include "../server/user/user_list_widget.h" -#include "../settings/cache_settings.h" #include "api/edhrec/tab_edhrec_main.h" -#include "pb/event_game_joined.pb.h" -#include "pb/event_notify_user.pb.h" -#include "pb/event_user_message.pb.h" -#include "pb/game_event_container.pb.h" -#include "pb/game_replay.pb.h" -#include "pb/room_commands.pb.h" -#include "pb/room_event.pb.h" -#include "pb/serverinfo_room.pb.h" -#include "pb/serverinfo_user.pb.h" #include "tab_account.h" #include "tab_admin.h" #include "tab_deck_editor.h" @@ -36,6 +25,17 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include QRect MacOSTabFixStyle::subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const { diff --git a/cockatrice/src/tabs/visual_deck_editor/tab_deck_editor_visual.cpp b/cockatrice/src/tabs/visual_deck_editor/tab_deck_editor_visual.cpp index 40b07e792..15eb54a20 100644 --- a/cockatrice/src/tabs/visual_deck_editor/tab_deck_editor_visual.cpp +++ b/cockatrice/src/tabs/visual_deck_editor/tab_deck_editor_visual.cpp @@ -1,6 +1,5 @@ #include "tab_deck_editor_visual.h" -#include "../../database/model/card_database_model.h" #include "../../deck/deck_list_model.h" #include "../../deck/deck_stats_interface.h" #include "../../filters/filter_builder.h" @@ -8,13 +7,9 @@ #include "../../interface/widgets/cards/card_info_frame_widget.h" #include "../../interface/widgets/deck_analytics/deck_analytics_widget.h" #include "../../interface/widgets/visual_deck_editor/visual_deck_editor_widget.h" -#include "../../server/pending_command.h" -#include "../../settings/cache_settings.h" #include "../tab_deck_editor.h" #include "../tab_supervisor.h" -#include "pb/command_deck_upload.pb.h" #include "tab_deck_editor_visual_tab_widget.h" -#include "trice_limits.h" #include #include @@ -33,6 +28,11 @@ #include #include #include +#include +#include +#include +#include +#include TabDeckEditorVisual::TabDeckEditorVisual(TabSupervisor *_tabSupervisor) : AbstractTabDeckEditor(_tabSupervisor) { diff --git a/cockatrice/src/tabs/visual_deck_storage/tab_deck_storage_visual.cpp b/cockatrice/src/tabs/visual_deck_storage/tab_deck_storage_visual.cpp index ea8822213..f918f61ad 100644 --- a/cockatrice/src/tabs/visual_deck_storage/tab_deck_storage_visual.cpp +++ b/cockatrice/src/tabs/visual_deck_storage/tab_deck_storage_visual.cpp @@ -1,13 +1,13 @@ #include "tab_deck_storage_visual.h" -#include "../../database/model/card_database_model.h" #include "../../interface/widgets/cards/deck_preview_card_picture_widget.h" #include "../../interface/widgets/visual_deck_storage/visual_deck_storage_widget.h" #include "../tab_supervisor.h" -#include "pb/command_deck_del.pb.h" #include #include +#include +#include TabDeckStorageVisual::TabDeckStorageVisual(TabSupervisor *_tabSupervisor) : Tab(_tabSupervisor), visualDeckStorageWidget(new VisualDeckStorageWidget(this)) diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt deleted file mode 100644 index 19651c948..000000000 --- a/common/CMakeLists.txt +++ /dev/null @@ -1,50 +0,0 @@ -# CMakeLists for common directory -# -# provides the common library - -add_subdirectory(pb) - -set(common_SOURCES - abstract_deck_list_card_node.cpp - abstract_deck_list_node.cpp - debug_pb_message.cpp - deck_list_card_node.cpp - deck_list.cpp - expression.cpp - featureset.cpp - get_pb_extension.cpp - inner_deck_list_node.cpp - passwordhasher.cpp - rng_abstract.cpp - rng_sfmt.cpp - server/game/server_abstract_participant.cpp - server/game/server_abstract_player.cpp - server/game/server_arrow.cpp - server/game/server_arrowtarget.cpp - server/game/server_card.cpp - server/game/server_cardzone.cpp - server/game/server_counter.cpp - server/game/server_game.cpp - server/game/server_player.cpp - server/game/server_spectator.cpp - server/server.cpp - server/server_abstractuserinterface.cpp - server/server_database_interface.cpp - server/server_protocolhandler.cpp - server/server_remoteuserinterface.cpp - server/server_response_containers.cpp - server/server_room.cpp - serverinfo_user_container.cpp - sfmt/SFMT.c -) - -set(ORACLE_LIBS) - -include_directories(pb) -include_directories(sfmt) -include_directories(${PROTOBUF_INCLUDE_DIR}) -include_directories(${${COCKATRICE_QT_VERSION_NAME}Core_INCLUDE_DIRS}) -include_directories(${CMAKE_CURRENT_BINARY_DIR}) - -add_library(cockatrice_common ${common_SOURCES} ${common_MOC_SRCS}) -target_link_libraries(cockatrice_common PUBLIC cockatrice_protocol) diff --git a/dbconverter/CMakeLists.txt b/dbconverter/CMakeLists.txt index 4236e1374..acf60bf03 100644 --- a/dbconverter/CMakeLists.txt +++ b/dbconverter/CMakeLists.txt @@ -1,47 +1,37 @@ -# CMakeLists for dbconverter directory - +cmake_minimum_required(VERSION 3.16) project(Dbconverter VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") -set(dbconverter_SOURCES - src/main.cpp - src/mocks.cpp - ../cockatrice/src/card/card_info.cpp - ../cockatrice/src/card/card_relation.cpp - ../cockatrice/src/card/card_set.cpp - ../cockatrice/src/card/card_set_list.cpp - ../cockatrice/src/card/exact_card.cpp - ../cockatrice/src/card/printing_info.cpp - ../cockatrice/src/database/card_database.cpp - ../cockatrice/src/database/card_database_loader.cpp - ../cockatrice/src/database/card_database_querier.cpp - ../cockatrice/src/database/parser/card_database_parser.cpp - ../cockatrice/src/database/parser/cockatrice_xml_3.cpp - ../cockatrice/src/database/parser/cockatrice_xml_4.cpp - ../cockatrice/src/settings/settings_manager.cpp - ${VERSION_STRING_CPP} +# ------------------------ +# Sources +# ------------------------ +set(dbconverter_SOURCES src/main.cpp src/mocks.cpp ${VERSION_STRING_CPP}) + +# ------------------------ +# Qt configuration +# ------------------------ +set(QT_DONT_USE_QTGUI TRUE) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTORCC ON) + +# ------------------------ +# Build executable +# ------------------------ +add_executable(dbconverter MACOSX_BUNDLE ${dbconverter_SOURCES}) + +# ------------------------ +# Link libraries +# ------------------------ +target_link_libraries( + dbconverter + PRIVATE libcockatrice_card + PRIVATE libcockatrice_settings + PRIVATE ${DB_CONVERTER_QT_MODULES} ) -set(QT_DONT_USE_QTGUI TRUE) - -if(Qt6_FOUND) - qt6_wrap_cpp( - dbconverter_SOURCES ../cockatrice/src/settings/cache_settings.h ../cockatrice/src/settings/card_database_settings.h - ) -elseif(Qt5_FOUND) - qt5_wrap_cpp( - dbconverter_SOURCES ../cockatrice/src/settings/cache_settings.h ../cockatrice/src/settings/card_database_settings.h - ) -endif() - -# Include directories -include_directories(../common) # Required due to card_ref.h - -# Build servatrice binary and link it -add_executable(dbconverter MACOSX_BUNDLE ${dbconverter_MOC_SRCS} ${dbconverter_SOURCES}) - -target_link_libraries(dbconverter ${DB_CONVERTER_QT_MODULES}) - -# install rules +# ------------------------ +# Install rules +# ------------------------ if(UNIX) if(APPLE) set(MACOSX_BUNDLE_INFO_STRING "${PROJECT_NAME}") @@ -53,19 +43,20 @@ if(UNIX) install(TARGETS dbconverter BUNDLE DESTINATION ./) else() - # Assume linux + # Linux install(TARGETS dbconverter RUNTIME DESTINATION bin/) endif() elseif(WIN32) install(TARGETS dbconverter RUNTIME DESTINATION ./) endif() +# ------------------------ +# Qt plugin handling +# ------------------------ if(APPLE) - # these needs to be relative to CMAKE_INSTALL_PREFIX set(plugin_dest_dir dbconverter.app/Contents/Plugins) set(qtconf_dest_dir dbconverter.app/Contents/Resources) - # Qt plugins: platforms install( DIRECTORY "${QT_PLUGINS_DIR}/" DESTINATION ${plugin_dest_dir} @@ -81,7 +72,7 @@ if(APPLE) file(WRITE \"\${CMAKE_INSTALL_PREFIX}/${qtconf_dest_dir}/qt.conf\" \"[Paths] Plugins = Plugins Translations = Resources/translations\") - " + " COMPONENT Runtime ) @@ -89,16 +80,15 @@ Translations = Resources/translations\") CODE " file(GLOB_RECURSE QTPLUGINS \"\${CMAKE_INSTALL_PREFIX}/${plugin_dest_dir}/*.dylib\") - set(BU_CHMOD_BUNDLE_ITEMS ON) - include(BundleUtilities) - fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/dbconverter.app\" \"\${QTPLUGINS}\" \"${QT_LIBRARY_DIR};${MYSQLCLIENT_LIBRARY_DIR}\") - " + set(BU_CHMOD_BUNDLE_ITEMS ON) + include(BundleUtilities) + fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/dbconverter.app\" \"\${QTPLUGINS}\" \"${QT_LIBRARY_DIR};${MYSQLCLIENT_LIBRARY_DIR}\") + " COMPONENT Runtime ) endif() if(WIN32) - # these needs to be relative to CMAKE_INSTALL_PREFIX set(plugin_dest_dir Plugins) set(qtconf_dest_dir .) @@ -109,7 +99,6 @@ if(WIN32) PATTERN "*.dll" ) - # Qt plugins: platforms install( DIRECTORY "${QT_PLUGINS_DIR}/" DESTINATION ${plugin_dest_dir} @@ -126,7 +115,7 @@ if(WIN32) file(WRITE \"\${CMAKE_INSTALL_PREFIX}/${qtconf_dest_dir}/qt.conf\" \"[Paths] Plugins = Plugins Translations = Resources/translations\") - " + " COMPONENT Runtime ) @@ -134,10 +123,10 @@ Translations = Resources/translations\") CODE " file(GLOB_RECURSE QTPLUGINS \"\${CMAKE_INSTALL_PREFIX}/${plugin_dest_dir}/*.dll\") - set(BU_CHMOD_BUNDLE_ITEMS ON) - include(BundleUtilities) - fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/dbconverter.exe\" \"\${QTPLUGINS}\" \"${QT_LIBRARY_DIR}\") - " + set(BU_CHMOD_BUNDLE_ITEMS ON) + include(BundleUtilities) + fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/dbconverter.exe\" \"\${QTPLUGINS}\" \"${QT_LIBRARY_DIR}\") + " COMPONENT Runtime ) endif() diff --git a/dbconverter/src/main.h b/dbconverter/src/main.h index ccde6b20e..b7b9350b5 100644 --- a/dbconverter/src/main.h +++ b/dbconverter/src/main.h @@ -1,8 +1,8 @@ #ifndef MAIN_H #define MAIN_H -#include "../../cockatrice/src/database/card_database.h" -#include "../../cockatrice/src/database/parser/cockatrice_xml_4.h" +#include +#include class CardDatabaseConverter : public CardDatabase { diff --git a/dbconverter/src/mocks.cpp b/dbconverter/src/mocks.cpp index 213b42f02..6aa108e57 100644 --- a/dbconverter/src/mocks.cpp +++ b/dbconverter/src/mocks.cpp @@ -448,7 +448,7 @@ void SettingsCache::setRoundCardCorners(bool /* _roundCardCorners */) { } -void PictureLoader::clearPixmapCache(CardInfoPtr /* card */) +void CardPictureLoader::clearPixmapCache(CardInfoPtr /* card */) { } diff --git a/dbconverter/src/mocks.h b/dbconverter/src/mocks.h index 18a50155b..3a8495fb9 100644 --- a/dbconverter/src/mocks.h +++ b/dbconverter/src/mocks.h @@ -10,13 +10,13 @@ #define PICTURELOADER_H -#include "../../cockatrice/src/database/card_database.h" -#include "../../cockatrice/src/settings/cache_settings.h" -#include "../../cockatrice/src/utility/macros.h" +#include +#include +#include extern SettingsCache *settingsCache; -class PictureLoader +class CardPictureLoader { public: static void clearPixmapCache(CardInfoPtr card); diff --git a/format.sh b/format.sh index 1e88c9862..5f4605f55 100755 --- a/format.sh +++ b/format.sh @@ -13,17 +13,23 @@ cd "${BASH_SOURCE%/*}/" || exit 2 # could not find path, this could happen with # defaults include=("cockatrice/src" \ -"common" \ "dbconverter/src" \ +"libcockatrice_card" \ +"libcockatrice_deck_list" \ +"libcockatrice_network" \ +"libcockatrice_protocol" \ +"libcockatrice_rng" \ +"libcockatrice_settings" \ +"libcockatrice_utility" \ "oracle/src" \ "servatrice/src" \ "tests") -exclude=("common/sfmt" \ -"common/lib" \ -"oracle/src/zip" \ -"oracle/src/lzma" \ -"oracle/src/qt-json" \ -"servatrice/src/smtp") +exclude=("libcockatrice_rng/libcockatrice/rng/sfmt/" \ +"libcockatrice_utility/libcockatrice/utility/peglib.h" \ +"oracle/src/lzma/" \ +"oracle/src/qt-json/" \ +"oracle/src/zip/" \ +"servatrice/src/smtp/") exts=("cpp" "h" "proto") cf_cmd="clang-format" branch="origin/master" @@ -234,7 +240,7 @@ fi # filter excludes for path in "${exclude[@]}"; do for i in "${!names[@]}"; do - rx="^$path/" + rx="^$path" if [[ ${names[$i]} =~ $rx ]]; then unset "names[$i]" fi diff --git a/libcockatrice_card/CMakeLists.txt b/libcockatrice_card/CMakeLists.txt new file mode 100644 index 000000000..6acdad8d6 --- /dev/null +++ b/libcockatrice_card/CMakeLists.txt @@ -0,0 +1,68 @@ +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTORCC ON) + +set(HEADERS + libcockatrice/card/card_info.h + libcockatrice/card/card_info_comparator.h + libcockatrice/card/card_database/card_database.h + libcockatrice/card/card_database/card_database_loader.h + libcockatrice/card/card_database/card_database_manager.h + libcockatrice/card/card_database/card_database_querier.h + libcockatrice/card/card_database/model/card_database_model.h + libcockatrice/card/card_database/model/card_database_display_model.h + libcockatrice/card/card_database/model/card/card_completer_proxy_model.h + libcockatrice/card/card_database/model/card/card_search_model.h + libcockatrice/card/card_database/model/token/token_display_model.h + libcockatrice/card/card_database/model/token/token_edit_model.h + libcockatrice/card/card_database/parser/card_database_parser.h + libcockatrice/card/card_database/parser/cockatrice_xml_3.h + libcockatrice/card/card_database/parser/cockatrice_xml_4.h + libcockatrice/card/card_printing/exact_card.h + libcockatrice/card/card_printing/printing_info.h + libcockatrice/card/card_set/card_set.h + libcockatrice/card/card_relation/card_relation.h +) + +if(Qt6_FOUND) + qt6_wrap_cpp(MOC_SOURCES ${HEADERS}) +elseif(Qt5_FOUND) + qt5_wrap_cpp(MOC_SOURCES ${HEADERS}) +endif() + +add_library( + libcockatrice_card STATIC + ${MOC_SOURCES} + libcockatrice/card/card_database/card_database.cpp + libcockatrice/card/card_database/card_database_loader.cpp + libcockatrice/card/card_database/card_database_manager.cpp + libcockatrice/card/card_database/card_database_querier.cpp + libcockatrice/card/card_database/model/card/card_completer_proxy_model.cpp + libcockatrice/card/card_database/model/card/card_search_model.cpp + libcockatrice/card/card_database/model/card_database_display_model.cpp + libcockatrice/card/card_database/model/card_database_model.cpp + libcockatrice/card/card_database/model/token/token_display_model.cpp + libcockatrice/card/card_database/model/token/token_edit_model.cpp + libcockatrice/card/card_database/parser/card_database_parser.cpp + libcockatrice/card/card_database/parser/cockatrice_xml_3.cpp + libcockatrice/card/card_database/parser/cockatrice_xml_4.cpp + libcockatrice/card/card_info.cpp + libcockatrice/card/card_info_comparator.cpp + libcockatrice/card/card_printing/exact_card.cpp + libcockatrice/card/card_printing/printing_info.cpp + libcockatrice/card/card_relation/card_relation.cpp + libcockatrice/card/card_set/card_set.cpp + libcockatrice/card/card_set/card_set_list.cpp +) + +target_include_directories( + libcockatrice_card + PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} + PUBLIC ${CMAKE_SOURCE_DIR}/cockatrice/src/filters +) + +target_link_libraries( + libcockatrice_card + PUBLIC libcockatrice_settings + PUBLIC ${COCKATRICE_QT_MODULES} +) diff --git a/cockatrice/src/database/card_database.cpp b/libcockatrice_card/libcockatrice/card/card_database/card_database.cpp similarity index 97% rename from cockatrice/src/database/card_database.cpp rename to libcockatrice_card/libcockatrice/card/card_database/card_database.cpp index faa9f5113..212397c17 100644 --- a/cockatrice/src/database/card_database.cpp +++ b/libcockatrice_card/libcockatrice/card/card_database/card_database.cpp @@ -1,8 +1,6 @@ #include "card_database.h" -#include "../card/card_relation.h" -#include "../picture_loader/picture_loader.h" -#include "../settings/cache_settings.h" +#include "../card_relation/card_relation.h" #include "parser/cockatrice_xml_3.h" #include "parser/cockatrice_xml_4.h" @@ -14,6 +12,7 @@ #include #include #include +#include #include CardDatabase::CardDatabase(QObject *parent) : QObject(parent), loadStatus(NotLoaded) diff --git a/cockatrice/src/database/card_database.h b/libcockatrice_card/libcockatrice/card/card_database/card_database.h similarity index 95% rename from cockatrice/src/database/card_database.h rename to libcockatrice_card/libcockatrice/card/card_database/card_database.h index 151019143..01d1c61e4 100644 --- a/cockatrice/src/database/card_database.h +++ b/libcockatrice_card/libcockatrice/card/card_database/card_database.h @@ -7,9 +7,7 @@ #ifndef CARDDATABASE_H #define CARDDATABASE_H -#include "../card/card_set_list.h" -#include "../card/exact_card.h" -#include "../common/card_ref.h" +#include "../card_set/card_set_list.h" #include "card_database_loader.h" #include "card_database_querier.h" @@ -20,6 +18,7 @@ #include #include #include +#include #include inline Q_LOGGING_CATEGORY(CardDatabaseLog, "card_database"); diff --git a/cockatrice/src/database/card_database_loader.cpp b/libcockatrice_card/libcockatrice/card/card_database/card_database_loader.cpp similarity index 98% rename from cockatrice/src/database/card_database_loader.cpp rename to libcockatrice_card/libcockatrice/card/card_database/card_database_loader.cpp index fbb3e6b67..0c9557418 100644 --- a/cockatrice/src/database/card_database_loader.cpp +++ b/libcockatrice_card/libcockatrice/card/card_database/card_database_loader.cpp @@ -1,6 +1,5 @@ #include "card_database_loader.h" -#include "../settings/cache_settings.h" #include "card_database.h" #include "parser/cockatrice_xml_3.h" #include "parser/cockatrice_xml_4.h" @@ -9,6 +8,7 @@ #include #include #include +#include CardDatabaseLoader::CardDatabaseLoader(QObject *parent, CardDatabase *db) : QObject(parent), database(db) { diff --git a/cockatrice/src/database/card_database_loader.h b/libcockatrice_card/libcockatrice/card/card_database/card_database_loader.h similarity index 100% rename from cockatrice/src/database/card_database_loader.h rename to libcockatrice_card/libcockatrice/card/card_database/card_database_loader.h diff --git a/cockatrice/src/database/card_database_manager.cpp b/libcockatrice_card/libcockatrice/card/card_database/card_database_manager.cpp similarity index 100% rename from cockatrice/src/database/card_database_manager.cpp rename to libcockatrice_card/libcockatrice/card/card_database/card_database_manager.cpp diff --git a/cockatrice/src/database/card_database_manager.h b/libcockatrice_card/libcockatrice/card/card_database/card_database_manager.h similarity index 100% rename from cockatrice/src/database/card_database_manager.h rename to libcockatrice_card/libcockatrice/card/card_database/card_database_manager.h diff --git a/cockatrice/src/database/card_database_querier.cpp b/libcockatrice_card/libcockatrice/card/card_database/card_database_querier.cpp similarity index 98% rename from cockatrice/src/database/card_database_querier.cpp rename to libcockatrice_card/libcockatrice/card/card_database/card_database_querier.cpp index 68cc39c9d..2eb6c6e92 100644 --- a/cockatrice/src/database/card_database_querier.cpp +++ b/libcockatrice_card/libcockatrice/card/card_database/card_database_querier.cpp @@ -1,6 +1,8 @@ #include "card_database_querier.h" -#include "../utility/card_set_comparator.h" +#include "../card_info.h" +#include "../card_printing/exact_card.h" +#include "../card_set/card_set_comparator.h" #include "card_database.h" #include diff --git a/cockatrice/src/database/card_database_querier.h b/libcockatrice_card/libcockatrice/card/card_database/card_database_querier.h similarity index 95% rename from cockatrice/src/database/card_database_querier.h rename to libcockatrice_card/libcockatrice/card/card_database/card_database_querier.h index c30cf49c2..11e485695 100644 --- a/cockatrice/src/database/card_database_querier.h +++ b/libcockatrice_card/libcockatrice/card/card_database/card_database_querier.h @@ -7,10 +7,11 @@ #ifndef COCKATRICE_CARD_DATABASE_QUERIER_H #define COCKATRICE_CARD_DATABASE_QUERIER_H -#include "../card/exact_card.h" -#include "../common/card_ref.h" +#include "../card_info.h" +#include "../card_printing/exact_card.h" #include +#include class CardDatabase; class CardDatabaseQuerier : public QObject diff --git a/cockatrice/src/database/model/card/card_completer_proxy_model.cpp b/libcockatrice_card/libcockatrice/card/card_database/model/card/card_completer_proxy_model.cpp similarity index 100% rename from cockatrice/src/database/model/card/card_completer_proxy_model.cpp rename to libcockatrice_card/libcockatrice/card/card_database/model/card/card_completer_proxy_model.cpp diff --git a/cockatrice/src/database/model/card/card_completer_proxy_model.h b/libcockatrice_card/libcockatrice/card/card_database/model/card/card_completer_proxy_model.h similarity index 100% rename from cockatrice/src/database/model/card/card_completer_proxy_model.h rename to libcockatrice_card/libcockatrice/card/card_database/model/card/card_completer_proxy_model.h diff --git a/cockatrice/src/database/model/card/card_search_model.cpp b/libcockatrice_card/libcockatrice/card/card_database/model/card/card_search_model.cpp similarity index 95% rename from cockatrice/src/database/model/card/card_search_model.cpp rename to libcockatrice_card/libcockatrice/card/card_database/model/card/card_search_model.cpp index d39a2207d..6a930c1da 100644 --- a/cockatrice/src/database/model/card/card_search_model.cpp +++ b/libcockatrice_card/libcockatrice/card/card_database/model/card/card_search_model.cpp @@ -1,9 +1,10 @@ #include "card_search_model.h" -#include "../../../utility/levenshtein.h" +#include "../card_database_display_model.h" #include "../card_database_model.h" #include +#include CardSearchModel::CardSearchModel(CardDatabaseDisplayModel *sourceModel, QObject *parent) : QAbstractListModel(parent), sourceModel(sourceModel) diff --git a/cockatrice/src/database/model/card/card_search_model.h b/libcockatrice_card/libcockatrice/card/card_database/model/card/card_search_model.h similarity index 100% rename from cockatrice/src/database/model/card/card_search_model.h rename to libcockatrice_card/libcockatrice/card/card_database/model/card/card_search_model.h diff --git a/cockatrice/src/database/model/card_database_display_model.cpp b/libcockatrice_card/libcockatrice/card/card_database/model/card_database_display_model.cpp similarity index 100% rename from cockatrice/src/database/model/card_database_display_model.cpp rename to libcockatrice_card/libcockatrice/card/card_database/model/card_database_display_model.cpp diff --git a/cockatrice/src/database/model/card_database_display_model.h b/libcockatrice_card/libcockatrice/card/card_database/model/card_database_display_model.h similarity index 98% rename from cockatrice/src/database/model/card_database_display_model.h rename to libcockatrice_card/libcockatrice/card/card_database/model/card_database_display_model.h index a1f9366e2..a1e949eba 100644 --- a/cockatrice/src/database/model/card_database_display_model.h +++ b/libcockatrice_card/libcockatrice/card/card_database/model/card_database_display_model.h @@ -8,7 +8,7 @@ #ifndef COCKATRICE_CARD_DATABASE_DISPLAY_MODEL_H #define COCKATRICE_CARD_DATABASE_DISPLAY_MODEL_H -#include "../../filters/filter_string.h" +#include "filter_string.h" #include #include diff --git a/cockatrice/src/database/model/card_database_model.cpp b/libcockatrice_card/libcockatrice/card/card_database/model/card_database_model.cpp similarity index 99% rename from cockatrice/src/database/model/card_database_model.cpp rename to libcockatrice_card/libcockatrice/card/card_database/model/card_database_model.cpp index 02175081b..6144121ac 100644 --- a/cockatrice/src/database/model/card_database_model.cpp +++ b/libcockatrice_card/libcockatrice/card/card_database/model/card_database_model.cpp @@ -1,5 +1,7 @@ #include "card_database_model.h" +#include "../card_database.h" + #include #define CARDDBMODEL_COLUMNS 6 diff --git a/cockatrice/src/database/model/card_database_model.h b/libcockatrice_card/libcockatrice/card/card_database/model/card_database_model.h similarity index 100% rename from cockatrice/src/database/model/card_database_model.h rename to libcockatrice_card/libcockatrice/card/card_database/model/card_database_model.h diff --git a/cockatrice/src/database/model/token/token_display_model.cpp b/libcockatrice_card/libcockatrice/card/card_database/model/token/token_display_model.cpp similarity index 100% rename from cockatrice/src/database/model/token/token_display_model.cpp rename to libcockatrice_card/libcockatrice/card/card_database/model/token/token_display_model.cpp diff --git a/cockatrice/src/database/model/token/token_display_model.h b/libcockatrice_card/libcockatrice/card/card_database/model/token/token_display_model.h similarity index 100% rename from cockatrice/src/database/model/token/token_display_model.h rename to libcockatrice_card/libcockatrice/card/card_database/model/token/token_display_model.h diff --git a/cockatrice/src/database/model/token/token_edit_model.cpp b/libcockatrice_card/libcockatrice/card/card_database/model/token/token_edit_model.cpp similarity index 83% rename from cockatrice/src/database/model/token/token_edit_model.cpp rename to libcockatrice_card/libcockatrice/card/card_database/model/token/token_edit_model.cpp index ad6891d2e..8ce290b03 100644 --- a/cockatrice/src/database/model/token/token_edit_model.cpp +++ b/libcockatrice_card/libcockatrice/card/card_database/model/token/token_edit_model.cpp @@ -1,5 +1,7 @@ -#include "token_edit_model.h" +#include "../token/token_edit_model.h" +#include "../../../card_info.h" +#include "../card_database_display_model.h" #include "../card_database_model.h" TokenEditModel::TokenEditModel(QObject *parent) : CardDatabaseDisplayModel(parent) diff --git a/cockatrice/src/database/model/token/token_edit_model.h b/libcockatrice_card/libcockatrice/card/card_database/model/token/token_edit_model.h similarity index 100% rename from cockatrice/src/database/model/token/token_edit_model.h rename to libcockatrice_card/libcockatrice/card/card_database/model/token/token_edit_model.h diff --git a/cockatrice/src/database/parser/card_database_parser.cpp b/libcockatrice_card/libcockatrice/card/card_database/parser/card_database_parser.cpp similarity index 100% rename from cockatrice/src/database/parser/card_database_parser.cpp rename to libcockatrice_card/libcockatrice/card/card_database/parser/card_database_parser.cpp diff --git a/cockatrice/src/database/parser/card_database_parser.h b/libcockatrice_card/libcockatrice/card/card_database/parser/card_database_parser.h similarity index 97% rename from cockatrice/src/database/parser/card_database_parser.h rename to libcockatrice_card/libcockatrice/card/card_database/parser/card_database_parser.h index 15a86fbfa..c67e3dafe 100644 --- a/cockatrice/src/database/parser/card_database_parser.h +++ b/libcockatrice_card/libcockatrice/card/card_database/parser/card_database_parser.h @@ -7,7 +7,7 @@ #ifndef CARDDATABASE_PARSER_H #define CARDDATABASE_PARSER_H -#include "../../card/card_info.h" +#include "../../card_info.h" #include #include diff --git a/cockatrice/src/database/parser/cockatrice_xml_3.cpp b/libcockatrice_card/libcockatrice/card/card_database/parser/cockatrice_xml_3.cpp similarity index 99% rename from cockatrice/src/database/parser/cockatrice_xml_3.cpp rename to libcockatrice_card/libcockatrice/card/card_database/parser/cockatrice_xml_3.cpp index 7b584bc22..295d307b6 100644 --- a/cockatrice/src/database/parser/cockatrice_xml_3.cpp +++ b/libcockatrice_card/libcockatrice/card/card_database/parser/cockatrice_xml_3.cpp @@ -1,7 +1,7 @@ #include "cockatrice_xml_3.h" -#include "../../card/card_relation.h" -#include "../../card/card_relation_type.h" +#include "../../card_relation/card_relation.h" +#include "../../card_relation/card_relation_type.h" #include #include diff --git a/cockatrice/src/database/parser/cockatrice_xml_3.h b/libcockatrice_card/libcockatrice/card/card_database/parser/cockatrice_xml_3.h similarity index 96% rename from cockatrice/src/database/parser/cockatrice_xml_3.h rename to libcockatrice_card/libcockatrice/card/card_database/parser/cockatrice_xml_3.h index 90130f4d1..50fa9c587 100644 --- a/cockatrice/src/database/parser/cockatrice_xml_3.h +++ b/libcockatrice_card/libcockatrice/card/card_database/parser/cockatrice_xml_3.h @@ -17,7 +17,6 @@ inline Q_LOGGING_CATEGORY(CockatriceXml3Log, "cockatrice_xml.xml_3_parser"); class CockatriceXml3Parser : public ICardDatabaseParser { Q_OBJECT - Q_INTERFACES(ICardDatabaseParser) public: CockatriceXml3Parser() = default; ~CockatriceXml3Parser() override = default; diff --git a/cockatrice/src/database/parser/cockatrice_xml_4.cpp b/libcockatrice_card/libcockatrice/card/card_database/parser/cockatrice_xml_4.cpp similarity index 99% rename from cockatrice/src/database/parser/cockatrice_xml_4.cpp rename to libcockatrice_card/libcockatrice/card/card_database/parser/cockatrice_xml_4.cpp index 1c68e80c3..d4870f3b3 100644 --- a/cockatrice/src/database/parser/cockatrice_xml_4.cpp +++ b/libcockatrice_card/libcockatrice/card/card_database/parser/cockatrice_xml_4.cpp @@ -1,12 +1,12 @@ #include "cockatrice_xml_4.h" -#include "../../card/card_relation.h" -#include "../../settings/cache_settings.h" +#include "../../card_relation/card_relation.h" #include #include #include #include +#include #include #define COCKATRICE_XML4_TAGNAME "cockatrice_carddatabase" diff --git a/cockatrice/src/database/parser/cockatrice_xml_4.h b/libcockatrice_card/libcockatrice/card/card_database/parser/cockatrice_xml_4.h similarity index 96% rename from cockatrice/src/database/parser/cockatrice_xml_4.h rename to libcockatrice_card/libcockatrice/card/card_database/parser/cockatrice_xml_4.h index 389e23712..f438f94b2 100644 --- a/cockatrice/src/database/parser/cockatrice_xml_4.h +++ b/libcockatrice_card/libcockatrice/card/card_database/parser/cockatrice_xml_4.h @@ -17,7 +17,6 @@ inline Q_LOGGING_CATEGORY(CockatriceXml4Log, "cockatrice_xml.xml_4_parser"); class CockatriceXml4Parser : public ICardDatabaseParser { Q_OBJECT - Q_INTERFACES(ICardDatabaseParser) public: CockatriceXml4Parser() = default; ~CockatriceXml4Parser() override = default; diff --git a/cockatrice/src/card/card_info.cpp b/libcockatrice_card/libcockatrice/card/card_info.cpp similarity index 97% rename from cockatrice/src/card/card_info.cpp rename to libcockatrice_card/libcockatrice/card/card_info.cpp index 47621e65e..0434bcf00 100644 --- a/cockatrice/src/card/card_info.cpp +++ b/libcockatrice_card/libcockatrice/card/card_info.cpp @@ -1,10 +1,9 @@ #include "card_info.h" -#include "../picture_loader/picture_loader.h" -#include "../settings/cache_settings.h" -#include "card_relation.h" +#include "card_printing/printing_info.h" +#include "card_relation/card_relation.h" +#include "card_set/card_set.h" #include "game_specific_terms.h" -#include "printing_info.h" #include #include @@ -12,6 +11,7 @@ #include #include #include +#include #include class CardRelation; diff --git a/cockatrice/src/card/card_info.h b/libcockatrice_card/libcockatrice/card/card_info.h similarity index 99% rename from cockatrice/src/card/card_info.h rename to libcockatrice_card/libcockatrice/card/card_info.h index b9b5e62c4..771f07464 100644 --- a/cockatrice/src/card/card_info.h +++ b/libcockatrice_card/libcockatrice/card/card_info.h @@ -7,7 +7,7 @@ #ifndef CARD_INFO_H #define CARD_INFO_H -#include "printing_info.h" +#include "card_printing/printing_info.h" #include #include diff --git a/cockatrice/src/utility/card_info_comparator.cpp b/libcockatrice_card/libcockatrice/card/card_info_comparator.cpp similarity index 100% rename from cockatrice/src/utility/card_info_comparator.cpp rename to libcockatrice_card/libcockatrice/card/card_info_comparator.cpp diff --git a/cockatrice/src/utility/card_info_comparator.h b/libcockatrice_card/libcockatrice/card/card_info_comparator.h similarity index 95% rename from cockatrice/src/utility/card_info_comparator.h rename to libcockatrice_card/libcockatrice/card/card_info_comparator.h index 8b02afaf3..bafc303a5 100644 --- a/cockatrice/src/utility/card_info_comparator.h +++ b/libcockatrice_card/libcockatrice/card/card_info_comparator.h @@ -7,7 +7,7 @@ #ifndef CARD_INFO_COMPARATOR_H #define CARD_INFO_COMPARATOR_H -#include "../card/card_info.h" +#include "card_info.h" #include #include diff --git a/cockatrice/src/card/exact_card.cpp b/libcockatrice_card/libcockatrice/card/card_printing/exact_card.cpp similarity index 96% rename from cockatrice/src/card/exact_card.cpp rename to libcockatrice_card/libcockatrice/card/card_printing/exact_card.cpp index fbd60071e..993b5b96e 100644 --- a/cockatrice/src/card/exact_card.cpp +++ b/libcockatrice_card/libcockatrice/card/card_printing/exact_card.cpp @@ -1,5 +1,8 @@ #include "exact_card.h" +#include "../card_info.h" +#include "printing_info.h" + /** * Default constructor. * This will set the CardInfoPtr to null. diff --git a/cockatrice/src/card/exact_card.h b/libcockatrice_card/libcockatrice/card/card_printing/exact_card.h similarity index 97% rename from cockatrice/src/card/exact_card.h rename to libcockatrice_card/libcockatrice/card/card_printing/exact_card.h index f0ba25c02..e3d5d828a 100644 --- a/cockatrice/src/card/exact_card.h +++ b/libcockatrice_card/libcockatrice/card/card_printing/exact_card.h @@ -1,7 +1,7 @@ #ifndef EXACT_CARD_H #define EXACT_CARD_H -#include "card_info.h" +#include "../card_info.h" /** * @class ExactCard diff --git a/cockatrice/src/card/printing_info.cpp b/libcockatrice_card/libcockatrice/card/card_printing/printing_info.cpp similarity index 88% rename from cockatrice/src/card/printing_info.cpp rename to libcockatrice_card/libcockatrice/card/card_printing/printing_info.cpp index 3e7735e6b..17a0d6317 100644 --- a/cockatrice/src/card/printing_info.cpp +++ b/libcockatrice_card/libcockatrice/card/card_printing/printing_info.cpp @@ -1,5 +1,7 @@ #include "printing_info.h" +#include "../card_set/card_set.h" + PrintingInfo::PrintingInfo(const CardSetPtr &_set) : set(_set) { } diff --git a/cockatrice/src/card/printing_info.h b/libcockatrice_card/libcockatrice/card/card_printing/printing_info.h similarity index 97% rename from cockatrice/src/card/printing_info.h rename to libcockatrice_card/libcockatrice/card/card_printing/printing_info.h index cf262b6bb..0b5a14a0a 100644 --- a/cockatrice/src/card/printing_info.h +++ b/libcockatrice_card/libcockatrice/card/card_printing/printing_info.h @@ -1,7 +1,7 @@ #ifndef COCKATRICE_PRINTING_INFO_H #define COCKATRICE_PRINTING_INFO_H -#include "card_set.h" +#include "../card_set/card_set.h" #include #include diff --git a/cockatrice/src/card/card_relation.cpp b/libcockatrice_card/libcockatrice/card/card_relation/card_relation.cpp similarity index 93% rename from cockatrice/src/card/card_relation.cpp rename to libcockatrice_card/libcockatrice/card/card_relation/card_relation.cpp index 41fbb5617..90e59e439 100644 --- a/cockatrice/src/card/card_relation.cpp +++ b/libcockatrice_card/libcockatrice/card/card_relation/card_relation.cpp @@ -1,5 +1,7 @@ #include "card_relation.h" +#include "card_relation_type.h" + CardRelation::CardRelation(const QString &_name, CardRelationType _attachType, bool _isCreateAllExclusion, diff --git a/cockatrice/src/card/card_relation.h b/libcockatrice_card/libcockatrice/card/card_relation/card_relation.h similarity index 100% rename from cockatrice/src/card/card_relation.h rename to libcockatrice_card/libcockatrice/card/card_relation/card_relation.h diff --git a/cockatrice/src/card/card_relation_type.h b/libcockatrice_card/libcockatrice/card/card_relation/card_relation_type.h similarity index 100% rename from cockatrice/src/card/card_relation_type.h rename to libcockatrice_card/libcockatrice/card/card_relation/card_relation_type.h diff --git a/cockatrice/src/card/card_set.cpp b/libcockatrice_card/libcockatrice/card/card_set/card_set.cpp similarity index 97% rename from cockatrice/src/card/card_set.cpp rename to libcockatrice_card/libcockatrice/card/card_set/card_set.cpp index 89bc0f6e5..6b4a8f764 100644 --- a/cockatrice/src/card/card_set.cpp +++ b/libcockatrice_card/libcockatrice/card/card_set/card_set.cpp @@ -1,6 +1,6 @@ #include "card_set.h" -#include "../settings/cache_settings.h" +#include const char *CardSet::TOKENS_SETNAME = "TK"; diff --git a/cockatrice/src/card/card_set.h b/libcockatrice_card/libcockatrice/card/card_set/card_set.h similarity index 100% rename from cockatrice/src/card/card_set.h rename to libcockatrice_card/libcockatrice/card/card_set/card_set.h diff --git a/cockatrice/src/utility/card_set_comparator.h b/libcockatrice_card/libcockatrice/card/card_set/card_set_comparator.h similarity index 96% rename from cockatrice/src/utility/card_set_comparator.h rename to libcockatrice_card/libcockatrice/card/card_set/card_set_comparator.h index 4089cf42b..53e2cb97d 100644 --- a/cockatrice/src/utility/card_set_comparator.h +++ b/libcockatrice_card/libcockatrice/card/card_set/card_set_comparator.h @@ -7,7 +7,7 @@ #ifndef SET_PRIORITY_COMPARATOR_H #define SET_PRIORITY_COMPARATOR_H -#include "../card/card_info.h" +#include "../card_info.h" class SetPriorityComparator { diff --git a/cockatrice/src/card/card_set_list.cpp b/libcockatrice_card/libcockatrice/card/card_set/card_set_list.cpp similarity index 100% rename from cockatrice/src/card/card_set_list.cpp rename to libcockatrice_card/libcockatrice/card/card_set/card_set_list.cpp diff --git a/cockatrice/src/card/card_set_list.h b/libcockatrice_card/libcockatrice/card/card_set/card_set_list.h similarity index 100% rename from cockatrice/src/card/card_set_list.h rename to libcockatrice_card/libcockatrice/card/card_set/card_set_list.h diff --git a/cockatrice/src/card/game_specific_terms.h b/libcockatrice_card/libcockatrice/card/game_specific_terms.h similarity index 100% rename from cockatrice/src/card/game_specific_terms.h rename to libcockatrice_card/libcockatrice/card/game_specific_terms.h diff --git a/libcockatrice_deck_list/CMakeLists.txt b/libcockatrice_deck_list/CMakeLists.txt new file mode 100644 index 000000000..0523343f6 --- /dev/null +++ b/libcockatrice_deck_list/CMakeLists.txt @@ -0,0 +1,30 @@ +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTORCC ON) + +set(HEADERS + libcockatrice/deck_list/abstract_deck_list_card_node.h libcockatrice/deck_list/abstract_deck_list_node.h + libcockatrice/deck_list/deck_list.h libcockatrice/deck_list/deck_list_card_node.h + libcockatrice/deck_list/inner_deck_list_node.h +) + +if(Qt6_FOUND) + qt6_wrap_cpp(MOC_SOURCES ${HEADERS}) +elseif(Qt5_FOUND) + qt5_wrap_cpp(MOC_SOURCES ${HEADERS}) +endif() + +add_library( + libcockatrice_deck_list STATIC + ${MOC_SOURCES} libcockatrice/deck_list/abstract_deck_list_card_node.cpp + libcockatrice/deck_list/abstract_deck_list_node.cpp libcockatrice/deck_list/deck_list.cpp + libcockatrice/deck_list/deck_list_card_node.cpp libcockatrice/deck_list/inner_deck_list_node.cpp +) + +add_dependencies(libcockatrice_deck_list libcockatrice_protocol) + +target_include_directories(libcockatrice_deck_list PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) + +target_link_libraries( + libcockatrice_deck_list PUBLIC libcockatrice_protocol libcockatrice_utility ${COCKATRICE_QT_MODULES} +) diff --git a/common/abstract_deck_list_card_node.cpp b/libcockatrice_deck_list/libcockatrice/deck_list/abstract_deck_list_card_node.cpp similarity index 100% rename from common/abstract_deck_list_card_node.cpp rename to libcockatrice_deck_list/libcockatrice/deck_list/abstract_deck_list_card_node.cpp diff --git a/common/abstract_deck_list_card_node.h b/libcockatrice_deck_list/libcockatrice/deck_list/abstract_deck_list_card_node.h similarity index 100% rename from common/abstract_deck_list_card_node.h rename to libcockatrice_deck_list/libcockatrice/deck_list/abstract_deck_list_card_node.h diff --git a/common/abstract_deck_list_node.cpp b/libcockatrice_deck_list/libcockatrice/deck_list/abstract_deck_list_node.cpp similarity index 100% rename from common/abstract_deck_list_node.cpp rename to libcockatrice_deck_list/libcockatrice/deck_list/abstract_deck_list_node.cpp diff --git a/common/abstract_deck_list_node.h b/libcockatrice_deck_list/libcockatrice/deck_list/abstract_deck_list_node.h similarity index 100% rename from common/abstract_deck_list_node.h rename to libcockatrice_deck_list/libcockatrice/deck_list/abstract_deck_list_node.h diff --git a/common/deck_list.cpp b/libcockatrice_deck_list/libcockatrice/deck_list/deck_list.cpp similarity index 100% rename from common/deck_list.cpp rename to libcockatrice_deck_list/libcockatrice/deck_list/deck_list.cpp diff --git a/common/deck_list.h b/libcockatrice_deck_list/libcockatrice/deck_list/deck_list.h similarity index 98% rename from common/deck_list.h rename to libcockatrice_deck_list/libcockatrice/deck_list/deck_list.h index 2a70ea4b1..fc0c07405 100644 --- a/common/deck_list.h +++ b/libcockatrice_deck_list/libcockatrice/deck_list/deck_list.h @@ -10,14 +10,14 @@ #ifndef DECKLIST_H #define DECKLIST_H -#include "card_ref.h" #include "inner_deck_list_node.h" #include #include #include #include -#include +#include +#include class AbstractDecklistNode; class DecklistCardNode; diff --git a/common/deck_list_card_node.cpp b/libcockatrice_deck_list/libcockatrice/deck_list/deck_list_card_node.cpp similarity index 100% rename from common/deck_list_card_node.cpp rename to libcockatrice_deck_list/libcockatrice/deck_list/deck_list_card_node.cpp diff --git a/common/deck_list_card_node.h b/libcockatrice_deck_list/libcockatrice/deck_list/deck_list_card_node.h similarity index 99% rename from common/deck_list_card_node.h rename to libcockatrice_deck_list/libcockatrice/deck_list/deck_list_card_node.h index 84a396daf..6d61ed970 100644 --- a/common/deck_list_card_node.h +++ b/libcockatrice_deck_list/libcockatrice/deck_list/deck_list_card_node.h @@ -13,7 +13,8 @@ #define COCKATRICE_DECK_LIST_CARD_NODE_H #include "abstract_deck_list_card_node.h" -#include "card_ref.h" + +#include /** * @class DecklistCardNode diff --git a/common/inner_deck_list_node.cpp b/libcockatrice_deck_list/libcockatrice/deck_list/inner_deck_list_node.cpp similarity index 100% rename from common/inner_deck_list_node.cpp rename to libcockatrice_deck_list/libcockatrice/deck_list/inner_deck_list_node.cpp diff --git a/common/inner_deck_list_node.h b/libcockatrice_deck_list/libcockatrice/deck_list/inner_deck_list_node.h similarity index 100% rename from common/inner_deck_list_node.h rename to libcockatrice_deck_list/libcockatrice/deck_list/inner_deck_list_node.h diff --git a/libcockatrice_network/CMakeLists.txt b/libcockatrice_network/CMakeLists.txt new file mode 100644 index 000000000..3069c0db4 --- /dev/null +++ b/libcockatrice_network/CMakeLists.txt @@ -0,0 +1,14 @@ +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTORCC ON) + +add_subdirectory(libcockatrice/network/client) +add_subdirectory(libcockatrice/network/server) + +add_library(libcockatrice_network INTERFACE) + +target_include_directories(libcockatrice_network INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) + +target_link_libraries( + libcockatrice_network INTERFACE ${COCKATRICE_QT_MODULES} libcockatrice_network_client libcockatrice_network_server +) diff --git a/libcockatrice_network/libcockatrice/network/client/CMakeLists.txt b/libcockatrice_network/libcockatrice/network/client/CMakeLists.txt new file mode 100644 index 000000000..d86210edd --- /dev/null +++ b/libcockatrice_network/libcockatrice/network/client/CMakeLists.txt @@ -0,0 +1,16 @@ +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTORCC ON) + +add_subdirectory(abstract) +add_subdirectory(local) +add_subdirectory(remote) + +add_library(libcockatrice_network_client INTERFACE) + +target_include_directories(libcockatrice_network_client INTERFACE .) + +target_link_libraries( + libcockatrice_network_client INTERFACE ${COCKATRICE_QT_MODULES} libcockatrice_network_client_abstract + libcockatrice_network_client_local libcockatrice_network_client_remote +) diff --git a/libcockatrice_network/libcockatrice/network/client/abstract/CMakeLists.txt b/libcockatrice_network/libcockatrice/network/client/abstract/CMakeLists.txt new file mode 100644 index 000000000..54e4d83e0 --- /dev/null +++ b/libcockatrice_network/libcockatrice/network/client/abstract/CMakeLists.txt @@ -0,0 +1,24 @@ +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTORCC ON) + +set(HEADERS abstract_client.h) + +set(SOURCES abstract_client.cpp) + +if(Qt6_FOUND) + qt6_wrap_cpp(MOC_SOURCES ${HEADERS}) +elseif(Qt5_FOUND) + qt5_wrap_cpp(MOC_SOURCES ${HEADERS}) +endif() + +add_library(libcockatrice_network_client_abstract STATIC ${MOC_SOURCES} ${SOURCES}) + +add_dependencies(libcockatrice_network_client_abstract libcockatrice_protocol libcockatrice_network_server_remote) + +target_include_directories(libcockatrice_network_client_abstract PUBLIC .) + +target_link_libraries( + libcockatrice_network_client_abstract PUBLIC ${COCKATRICE_QT_MODULES} libcockatrice_protocol + libcockatrice_network_server_remote +) diff --git a/cockatrice/src/server/abstract_client.cpp b/libcockatrice_network/libcockatrice/network/client/abstract/abstract_client.cpp similarity index 87% rename from cockatrice/src/server/abstract_client.cpp rename to libcockatrice_network/libcockatrice/network/client/abstract/abstract_client.cpp index 4f3098871..11458768d 100644 --- a/cockatrice/src/server/abstract_client.cpp +++ b/libcockatrice_network/libcockatrice/network/client/abstract/abstract_client.cpp @@ -1,25 +1,24 @@ #include "abstract_client.h" -#include "featureset.h" -#include "get_pb_extension.h" -#include "pb/commands.pb.h" -#include "pb/event_add_to_list.pb.h" -#include "pb/event_connection_closed.pb.h" -#include "pb/event_game_joined.pb.h" -#include "pb/event_list_rooms.pb.h" -#include "pb/event_notify_user.pb.h" -#include "pb/event_remove_from_list.pb.h" -#include "pb/event_replay_added.pb.h" -#include "pb/event_server_identification.pb.h" -#include "pb/event_server_message.pb.h" -#include "pb/event_server_shutdown.pb.h" -#include "pb/event_user_joined.pb.h" -#include "pb/event_user_left.pb.h" -#include "pb/event_user_message.pb.h" -#include "pb/server_message.pb.h" -#include "pending_command.h" - #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include AbstractClient::AbstractClient(QObject *parent) : QObject(parent), nextCmdId(0), status(StatusDisconnected), serverSupportsPasswordHash(false) diff --git a/cockatrice/src/server/abstract_client.h b/libcockatrice_network/libcockatrice/network/client/abstract/abstract_client.h similarity index 97% rename from cockatrice/src/server/abstract_client.h rename to libcockatrice_network/libcockatrice/network/client/abstract/abstract_client.h index e6a812df1..165737e95 100644 --- a/cockatrice/src/server/abstract_client.h +++ b/libcockatrice_network/libcockatrice/network/client/abstract/abstract_client.h @@ -7,12 +7,11 @@ #ifndef ABSTRACTCLIENT_H #define ABSTRACTCLIENT_H -#include "pb/response.pb.h" -#include "pb/serverinfo_user.pb.h" - #include #include #include +#include +#include class PendingCommand; class CommandContainer; diff --git a/libcockatrice_network/libcockatrice/network/client/local/CMakeLists.txt b/libcockatrice_network/libcockatrice/network/client/local/CMakeLists.txt new file mode 100644 index 000000000..3c202904d --- /dev/null +++ b/libcockatrice_network/libcockatrice/network/client/local/CMakeLists.txt @@ -0,0 +1,23 @@ +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTORCC ON) + +set(HEADERS local_client.h) + +set(SOURCES local_client.cpp) + +if(Qt6_FOUND) + qt6_wrap_cpp(MOC_SOURCES ${HEADERS}) +elseif(Qt5_FOUND) + qt5_wrap_cpp(MOC_SOURCES ${HEADERS}) +endif() + +add_library(libcockatrice_network_client_local STATIC ${MOC_SOURCES} ${SOURCES}) + +add_dependencies(libcockatrice_network_client_local libcockatrice_network_client_abstract) + +target_include_directories(libcockatrice_network_client_local PUBLIC .) + +target_link_libraries( + libcockatrice_network_client_local PUBLIC ${COCKATRICE_QT_MODULES} libcockatrice_network_client_abstract +) diff --git a/cockatrice/src/server/local_client.cpp b/libcockatrice_network/libcockatrice/network/client/local/local_client.cpp similarity index 86% rename from cockatrice/src/server/local_client.cpp rename to libcockatrice_network/libcockatrice/network/client/local/local_client.cpp index 734660af1..eefa3a2f3 100644 --- a/cockatrice/src/server/local_client.cpp +++ b/libcockatrice_network/libcockatrice/network/client/local/local_client.cpp @@ -1,8 +1,9 @@ #include "local_client.h" -#include "debug_pb_message.h" -#include "local_server_interface.h" -#include "pb/session_commands.pb.h" +#include "../../server/local/local_server_interface.h" + +#include +#include LocalClient::LocalClient(LocalServerInterface *_lsi, const QString &_playerName, diff --git a/cockatrice/src/server/local_client.h b/libcockatrice_network/libcockatrice/network/client/local/local_client.h similarity index 94% rename from cockatrice/src/server/local_client.h rename to libcockatrice_network/libcockatrice/network/client/local/local_client.h index 2523e1d51..e8c5330ac 100644 --- a/cockatrice/src/server/local_client.h +++ b/libcockatrice_network/libcockatrice/network/client/local/local_client.h @@ -7,7 +7,7 @@ #ifndef LOCALCLIENT_H #define LOCALCLIENT_H -#include "abstract_client.h" +#include "../abstract/abstract_client.h" #include diff --git a/libcockatrice_network/libcockatrice/network/client/remote/CMakeLists.txt b/libcockatrice_network/libcockatrice/network/client/remote/CMakeLists.txt new file mode 100644 index 000000000..01f438b08 --- /dev/null +++ b/libcockatrice_network/libcockatrice/network/client/remote/CMakeLists.txt @@ -0,0 +1,24 @@ +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTORCC ON) + +set(HEADERS remote_client.h) + +set(SOURCES remote_client.cpp) + +if(Qt6_FOUND) + qt6_wrap_cpp(MOC_SOURCES ${HEADERS}) +elseif(Qt5_FOUND) + qt5_wrap_cpp(MOC_SOURCES ${HEADERS}) +endif() + +add_library(libcockatrice_network_client_remote STATIC ${MOC_SOURCES} ${SOURCES}) + +add_dependencies(libcockatrice_network_client_remote libcockatrice_network_client_abstract libcockatrice_protocol) + +target_include_directories(libcockatrice_network_client_remote PUBLIC .) + +target_link_libraries( + libcockatrice_network_client_remote PUBLIC ${COCKATRICE_QT_MODULES} libcockatrice_network_client_abstract + libcockatrice_settings libcockatrice_utility libcockatrice_protocol +) diff --git a/cockatrice/src/server/remote/remote_client.cpp b/libcockatrice_network/libcockatrice/network/client/remote/remote_client.cpp similarity index 97% rename from cockatrice/src/server/remote/remote_client.cpp rename to libcockatrice_network/libcockatrice/network/client/remote/remote_client.cpp index 1d8579c14..fdcbfae88 100644 --- a/cockatrice/src/server/remote/remote_client.cpp +++ b/libcockatrice_network/libcockatrice/network/client/remote/remote_client.cpp @@ -1,18 +1,6 @@ #include "remote_client.h" -#include "../../main.h" -#include "../../settings/cache_settings.h" -#include "../pending_command.h" -#include "debug_pb_message.h" -#include "passwordhasher.h" -#include "pb/event_server_identification.pb.h" -#include "pb/response_activate.pb.h" -#include "pb/response_forgotpasswordrequest.pb.h" -#include "pb/response_login.pb.h" -#include "pb/response_password_salt.pb.h" -#include "pb/response_register.pb.h" -#include "pb/server_message.pb.h" -#include "pb/session_commands.pb.h" +#include "../../../../cockatrice/src/main.h" #include "version_string.h" #include @@ -23,6 +11,18 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include static const unsigned int protocolVersion = 14; diff --git a/cockatrice/src/server/remote/remote_client.h b/libcockatrice_network/libcockatrice/network/client/remote/remote_client.h similarity index 98% rename from cockatrice/src/server/remote/remote_client.h rename to libcockatrice_network/libcockatrice/network/client/remote/remote_client.h index 365b5b520..d3984d5dd 100644 --- a/cockatrice/src/server/remote/remote_client.h +++ b/libcockatrice_network/libcockatrice/network/client/remote/remote_client.h @@ -7,12 +7,12 @@ #ifndef REMOTECLIENT_H #define REMOTECLIENT_H -#include "../abstract_client.h" -#include "pb/commands.pb.h" +#include "../abstract/abstract_client.h" #include #include #include +#include inline Q_LOGGING_CATEGORY(RemoteClientLog, "remote_client"); diff --git a/libcockatrice_network/libcockatrice/network/server/CMakeLists.txt b/libcockatrice_network/libcockatrice/network/server/CMakeLists.txt new file mode 100644 index 000000000..cbb717ad8 --- /dev/null +++ b/libcockatrice_network/libcockatrice/network/server/CMakeLists.txt @@ -0,0 +1,15 @@ +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTORCC ON) + +add_subdirectory(local) +add_subdirectory(remote) + +add_library(libcockatrice_network_server INTERFACE) + +target_include_directories(libcockatrice_network_server INTERFACE .) + +target_link_libraries( + libcockatrice_network_server INTERFACE ${COCKATRICE_QT_MODULES} libcockatrice_network_server_local + libcockatrice_network_server_remote +) diff --git a/libcockatrice_network/libcockatrice/network/server/local/CMakeLists.txt b/libcockatrice_network/libcockatrice/network/server/local/CMakeLists.txt new file mode 100644 index 000000000..80fb379a4 --- /dev/null +++ b/libcockatrice_network/libcockatrice/network/server/local/CMakeLists.txt @@ -0,0 +1,21 @@ +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTORCC ON) + +set(HEADERS local_server.h local_server_interface.h) + +set(SOURCES local_server.cpp local_server_interface.cpp) + +if(Qt6_FOUND) + qt6_wrap_cpp(MOC_SOURCES ${HEADERS}) +elseif(Qt5_FOUND) + qt5_wrap_cpp(MOC_SOURCES ${HEADERS}) +endif() + +add_library(libcockatrice_network_server_local STATIC ${MOC_SOURCES} ${SOURCES}) + +add_dependencies(libcockatrice_network_server_local libcockatrice_protocol) + +target_include_directories(libcockatrice_network_server_local PUBLIC .) + +target_link_libraries(libcockatrice_network_server_local PUBLIC ${COCKATRICE_QT_MODULES} libcockatrice_protocol) diff --git a/cockatrice/src/server/local_server.cpp b/libcockatrice_network/libcockatrice/network/server/local/local_server.cpp similarity index 98% rename from cockatrice/src/server/local_server.cpp rename to libcockatrice_network/libcockatrice/network/server/local/local_server.cpp index 74ee8601d..8f9d82aa4 100644 --- a/cockatrice/src/server/local_server.cpp +++ b/libcockatrice_network/libcockatrice/network/server/local/local_server.cpp @@ -1,7 +1,8 @@ #include "local_server.h" #include "local_server_interface.h" -#include "server/server_room.h" + +#include <../remote/server_room.h> LocalServer::LocalServer(QObject *parent) : Server(parent) { diff --git a/cockatrice/src/server/local_server.h b/libcockatrice_network/libcockatrice/network/server/local/local_server.h similarity index 94% rename from cockatrice/src/server/local_server.h rename to libcockatrice_network/libcockatrice/network/server/local/local_server.h index 9546e3f9c..70586f6c1 100644 --- a/cockatrice/src/server/local_server.h +++ b/libcockatrice_network/libcockatrice/network/server/local/local_server.h @@ -7,8 +7,8 @@ #ifndef LOCALSERVER_H #define LOCALSERVER_H -#include "server/server.h" -#include "server/server_database_interface.h" +#include <../remote/server.h> +#include <../remote/server_database_interface.h> class LocalServerInterface; diff --git a/cockatrice/src/server/local_server_interface.cpp b/libcockatrice_network/libcockatrice/network/server/local/local_server_interface.cpp similarity index 100% rename from cockatrice/src/server/local_server_interface.cpp rename to libcockatrice_network/libcockatrice/network/server/local/local_server_interface.cpp diff --git a/cockatrice/src/server/local_server_interface.h b/libcockatrice_network/libcockatrice/network/server/local/local_server_interface.h similarity index 94% rename from cockatrice/src/server/local_server_interface.h rename to libcockatrice_network/libcockatrice/network/server/local/local_server_interface.h index 5551b47a5..1ddf5a85a 100644 --- a/cockatrice/src/server/local_server_interface.h +++ b/libcockatrice_network/libcockatrice/network/server/local/local_server_interface.h @@ -7,7 +7,7 @@ #ifndef LOCALSERVERINTERFACE_H #define LOCALSERVERINTERFACE_H -#include "server/server_protocolhandler.h" +#include <../remote/server_protocolhandler.h> class LocalServer; diff --git a/libcockatrice_network/libcockatrice/network/server/remote/CMakeLists.txt b/libcockatrice_network/libcockatrice/network/server/remote/CMakeLists.txt new file mode 100644 index 000000000..e883baa0d --- /dev/null +++ b/libcockatrice_network/libcockatrice/network/server/remote/CMakeLists.txt @@ -0,0 +1,63 @@ +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTORCC ON) + +set(HEADERS + game/server_abstract_participant.h + game/server_abstract_player.h + game/server_arrow.h + game/server_arrowtarget.h + game/server_card.h + game/server_cardzone.h + game/server_counter.h + game/server_game.h + game/server_player.h + game/server_spectator.h + server.h + server_abstractuserinterface.h + server_database_interface.h + server_protocolhandler.h + server_remoteuserinterface.h + server_response_containers.h + server_room.h + serverinfo_user_container.h +) + +if(Qt6_FOUND) + qt6_wrap_cpp(MOC_SOURCES ${HEADERS}) +elseif(Qt5_FOUND) + qt5_wrap_cpp(MOC_SOURCES ${HEADERS}) +endif() + +add_library( + libcockatrice_network_server_remote STATIC + ${MOC_SOURCES} + game/server_abstract_participant.cpp + game/server_abstract_player.cpp + game/server_arrow.cpp + game/server_arrowtarget.cpp + game/server_card.cpp + game/server_cardzone.cpp + game/server_counter.cpp + game/server_game.cpp + game/server_player.cpp + game/server_spectator.cpp + server.cpp + server_abstractuserinterface.cpp + server_database_interface.cpp + server_protocolhandler.cpp + server_remoteuserinterface.cpp + server_response_containers.cpp + server_room.cpp + serverinfo_user_container.cpp +) + +add_dependencies(libcockatrice_network_server_remote libcockatrice_protocol) + +target_include_directories(libcockatrice_network_server_remote PUBLIC .) + +# Make cockatrice_server depend on cockatrice_protocol +target_link_libraries( + libcockatrice_network_server_remote PUBLIC libcockatrice_protocol libcockatrice_utility libcockatrice_rng + libcockatrice_deck_list ${COCKATRICE_QT_MODULES} +) diff --git a/common/server/game/server_abstract_participant.cpp b/libcockatrice_network/libcockatrice/network/server/remote/game/server_abstract_participant.cpp similarity index 83% rename from common/server/game/server_abstract_participant.cpp rename to libcockatrice_network/libcockatrice/network/server/remote/game/server_abstract_participant.cpp index cdbf29d47..c6a29b275 100644 --- a/common/server/game/server_abstract_participant.cpp +++ b/libcockatrice_network/libcockatrice/network/server/remote/game/server_abstract_participant.cpp @@ -1,81 +1,9 @@ #include "server_abstract_participant.h" -#include "../../color.h" -#include "../../deck_list.h" -#include "../../deck_list_card_node.h" -#include "../../get_pb_extension.h" -#include "../../rng_abstract.h" -#include "../../trice_limits.h" #include "../server.h" #include "../server_abstractuserinterface.h" #include "../server_database_interface.h" #include "../server_room.h" -#include "pb/command_attach_card.pb.h" -#include "pb/command_change_zone_properties.pb.h" -#include "pb/command_concede.pb.h" -#include "pb/command_create_arrow.pb.h" -#include "pb/command_create_counter.pb.h" -#include "pb/command_create_token.pb.h" -#include "pb/command_deck_select.pb.h" -#include "pb/command_del_counter.pb.h" -#include "pb/command_delete_arrow.pb.h" -#include "pb/command_draw_cards.pb.h" -#include "pb/command_dump_zone.pb.h" -#include "pb/command_flip_card.pb.h" -#include "pb/command_game_say.pb.h" -#include "pb/command_inc_card_counter.pb.h" -#include "pb/command_inc_counter.pb.h" -#include "pb/command_kick_from_game.pb.h" -#include "pb/command_leave_game.pb.h" -#include "pb/command_move_card.pb.h" -#include "pb/command_mulligan.pb.h" -#include "pb/command_next_turn.pb.h" -#include "pb/command_ready_start.pb.h" -#include "pb/command_reveal_cards.pb.h" -#include "pb/command_reverse_turn.pb.h" -#include "pb/command_roll_die.pb.h" -#include "pb/command_set_active_phase.pb.h" -#include "pb/command_set_card_attr.pb.h" -#include "pb/command_set_card_counter.pb.h" -#include "pb/command_set_counter.pb.h" -#include "pb/command_set_sideboard_lock.pb.h" -#include "pb/command_set_sideboard_plan.pb.h" -#include "pb/command_shuffle.pb.h" -#include "pb/command_undo_draw.pb.h" -#include "pb/context_concede.pb.h" -#include "pb/context_connection_state_changed.pb.h" -#include "pb/context_deck_select.pb.h" -#include "pb/context_move_card.pb.h" -#include "pb/context_mulligan.pb.h" -#include "pb/context_ready_start.pb.h" -#include "pb/context_set_sideboard_lock.pb.h" -#include "pb/context_undo_draw.pb.h" -#include "pb/event_attach_card.pb.h" -#include "pb/event_change_zone_properties.pb.h" -#include "pb/event_create_arrow.pb.h" -#include "pb/event_create_counter.pb.h" -#include "pb/event_create_token.pb.h" -#include "pb/event_del_counter.pb.h" -#include "pb/event_delete_arrow.pb.h" -#include "pb/event_destroy_card.pb.h" -#include "pb/event_draw_cards.pb.h" -#include "pb/event_dump_zone.pb.h" -#include "pb/event_flip_card.pb.h" -#include "pb/event_game_say.pb.h" -#include "pb/event_move_card.pb.h" -#include "pb/event_player_properties_changed.pb.h" -#include "pb/event_reveal_cards.pb.h" -#include "pb/event_reverse_turn.pb.h" -#include "pb/event_roll_die.pb.h" -#include "pb/event_set_card_attr.pb.h" -#include "pb/event_set_card_counter.pb.h" -#include "pb/event_set_counter.pb.h" -#include "pb/event_shuffle.pb.h" -#include "pb/response.pb.h" -#include "pb/response_deck_download.pb.h" -#include "pb/response_dump_zone.pb.h" -#include "pb/serverinfo_player.pb.h" -#include "pb/serverinfo_user.pb.h" #include "server_arrow.h" #include "server_card.h" #include "server_cardzone.h" @@ -86,6 +14,78 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include Server_AbstractParticipant::Server_AbstractParticipant(Server_Game *_game, int _playerId, diff --git a/common/server/game/server_abstract_participant.h b/libcockatrice_network/libcockatrice/network/server/remote/game/server_abstract_participant.h similarity index 98% rename from common/server/game/server_abstract_participant.h rename to libcockatrice_network/libcockatrice/network/server/remote/game/server_abstract_participant.h index dcae09741..10fbb3349 100644 --- a/common/server/game/server_abstract_participant.h +++ b/libcockatrice_network/libcockatrice/network/server/remote/game/server_abstract_participant.h @@ -1,12 +1,12 @@ #ifndef ABSTRACT_PARTICIPANT_H #define ABSTRACT_PARTICIPANT_H -#include "../../serverinfo_user_container.h" -#include "pb/card_attributes.pb.h" -#include "pb/response.pb.h" +#include "../serverinfo_user_container.h" #include "server_arrowtarget.h" #include +#include +#include class Server_Game; class Server_AbstractUserInterface; diff --git a/common/server/game/server_abstract_player.cpp b/libcockatrice_network/libcockatrice/network/server/remote/game/server_abstract_player.cpp similarity index 96% rename from common/server/game/server_abstract_player.cpp rename to libcockatrice_network/libcockatrice/network/server/remote/game/server_abstract_player.cpp index c94e54f10..5ac0a26ad 100644 --- a/common/server/game/server_abstract_player.cpp +++ b/libcockatrice_network/libcockatrice/network/server/remote/game/server_abstract_player.cpp @@ -1,47 +1,5 @@ #include "server_abstract_player.h" -#include "../../deck_list.h" -#include "../../rng_abstract.h" -#include "../../trice_limits.h" -#include "pb/command_attach_card.pb.h" -#include "pb/command_change_zone_properties.pb.h" -#include "pb/command_create_arrow.pb.h" -#include "pb/command_create_token.pb.h" -#include "pb/command_delete_arrow.pb.h" -#include "pb/command_dump_zone.pb.h" -#include "pb/command_flip_card.pb.h" -#include "pb/command_game_say.pb.h" -#include "pb/command_inc_card_counter.pb.h" -#include "pb/command_inc_counter.pb.h" -#include "pb/command_move_card.pb.h" -#include "pb/command_next_turn.pb.h" -#include "pb/command_ready_start.pb.h" -#include "pb/command_reveal_cards.pb.h" -#include "pb/command_roll_die.pb.h" -#include "pb/command_set_card_attr.pb.h" -#include "pb/command_set_card_counter.pb.h" -#include "pb/context_concede.pb.h" -#include "pb/context_move_card.pb.h" -#include "pb/context_ready_start.pb.h" -#include "pb/context_undo_draw.pb.h" -#include "pb/event_attach_card.pb.h" -#include "pb/event_change_zone_properties.pb.h" -#include "pb/event_create_arrow.pb.h" -#include "pb/event_create_token.pb.h" -#include "pb/event_delete_arrow.pb.h" -#include "pb/event_destroy_card.pb.h" -#include "pb/event_dump_zone.pb.h" -#include "pb/event_flip_card.pb.h" -#include "pb/event_move_card.pb.h" -#include "pb/event_player_properties_changed.pb.h" -#include "pb/event_reveal_cards.pb.h" -#include "pb/event_roll_die.pb.h" -#include "pb/event_set_card_attr.pb.h" -#include "pb/event_set_card_counter.pb.h" -#include "pb/response.pb.h" -#include "pb/response_dump_zone.pb.h" -#include "pb/serverinfo_player.pb.h" -#include "pb/serverinfo_user.pb.h" #include "server_arrow.h" #include "server_card.h" #include "server_cardzone.h" @@ -51,6 +9,45 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include Server_AbstractPlayer::Server_AbstractPlayer(Server_Game *_game, int _playerId, diff --git a/common/server/game/server_abstract_player.h b/libcockatrice_network/libcockatrice/network/server/remote/game/server_abstract_player.h similarity index 99% rename from common/server/game/server_abstract_player.h rename to libcockatrice_network/libcockatrice/network/server/remote/game/server_abstract_player.h index 51828adf7..4a32b6fef 100644 --- a/common/server/game/server_abstract_player.h +++ b/libcockatrice_network/libcockatrice/network/server/remote/game/server_abstract_player.h @@ -1,7 +1,7 @@ #ifndef ABSTRACT_PLAYER_H #define ABSTRACT_PLAYER_H -#include "../../serverinfo_user_container.h" +#include "../serverinfo_user_container.h" #include "server_abstract_participant.h" #include diff --git a/common/server/game/server_arrow.cpp b/libcockatrice_network/libcockatrice/network/server/remote/game/server_arrow.cpp similarity index 94% rename from common/server/game/server_arrow.cpp rename to libcockatrice_network/libcockatrice/network/server/remote/game/server_arrow.cpp index fe02995d3..e077416bc 100644 --- a/common/server/game/server_arrow.cpp +++ b/libcockatrice_network/libcockatrice/network/server/remote/game/server_arrow.cpp @@ -1,10 +1,11 @@ #include "server_arrow.h" -#include "pb/serverinfo_arrow.pb.h" #include "server_card.h" #include "server_cardzone.h" #include "server_player.h" +#include + Server_Arrow::Server_Arrow(int _id, Server_Card *_startCard, Server_ArrowTarget *_targetItem, const color &_arrowColor) : id(_id), startCard(_startCard), targetItem(_targetItem), arrowColor(_arrowColor) { diff --git a/common/server/game/server_arrow.h b/libcockatrice_network/libcockatrice/network/server/remote/game/server_arrow.h similarity index 95% rename from common/server/game/server_arrow.h rename to libcockatrice_network/libcockatrice/network/server/remote/game/server_arrow.h index 13a6ea2d8..0b3e63550 100644 --- a/common/server/game/server_arrow.h +++ b/libcockatrice_network/libcockatrice/network/server/remote/game/server_arrow.h @@ -1,7 +1,7 @@ #ifndef SERVER_ARROW_H #define SERVER_ARROW_H -#include "pb/color.pb.h" +#include class Server_Card; class Server_ArrowTarget; diff --git a/common/server/game/server_arrowtarget.cpp b/libcockatrice_network/libcockatrice/network/server/remote/game/server_arrowtarget.cpp similarity index 100% rename from common/server/game/server_arrowtarget.cpp rename to libcockatrice_network/libcockatrice/network/server/remote/game/server_arrowtarget.cpp diff --git a/common/server/game/server_arrowtarget.h b/libcockatrice_network/libcockatrice/network/server/remote/game/server_arrowtarget.h similarity index 100% rename from common/server/game/server_arrowtarget.h rename to libcockatrice_network/libcockatrice/network/server/remote/game/server_arrowtarget.h diff --git a/common/server/game/server_card.cpp b/libcockatrice_network/libcockatrice/network/server/remote/game/server_card.cpp similarity index 96% rename from common/server/game/server_card.cpp rename to libcockatrice_network/libcockatrice/network/server/remote/game/server_card.cpp index 323b4d827..86ff2f008 100644 --- a/common/server/game/server_card.cpp +++ b/libcockatrice_network/libcockatrice/network/server/remote/game/server_card.cpp @@ -19,13 +19,13 @@ ***************************************************************************/ #include "server_card.h" -#include "pb/event_set_card_attr.pb.h" -#include "pb/event_set_card_counter.pb.h" -#include "pb/serverinfo_card.pb.h" #include "server_cardzone.h" #include "server_player.h" #include +#include +#include +#include Server_Card::Server_Card(const CardRef &cardRef, int _id, int _coord_x, int _coord_y, Server_CardZone *_zone) : zone(_zone), id(_id), coord_x(_coord_x), coord_y(_coord_y), cardRef(cardRef), tapped(false), attacking(false), diff --git a/common/server/game/server_card.h b/libcockatrice_network/libcockatrice/network/server/remote/game/server_card.h similarity index 97% rename from common/server/game/server_card.h rename to libcockatrice_network/libcockatrice/network/server/remote/game/server_card.h index a24be2046..bc326bbc4 100644 --- a/common/server/game/server_card.h +++ b/libcockatrice_network/libcockatrice/network/server/remote/game/server_card.h @@ -20,13 +20,13 @@ #ifndef SERVER_CARD_H #define SERVER_CARD_H -#include "../../card_ref.h" -#include "pb/card_attributes.pb.h" -#include "pb/serverinfo_card.pb.h" #include "server_arrowtarget.h" #include #include +#include +#include +#include class Server_CardZone; class Event_SetCardCounter; diff --git a/common/server/game/server_cardzone.cpp b/libcockatrice_network/libcockatrice/network/server/remote/game/server_cardzone.cpp similarity index 99% rename from common/server/game/server_cardzone.cpp rename to libcockatrice_network/libcockatrice/network/server/remote/game/server_cardzone.cpp index 8f019f746..68dcadd35 100644 --- a/common/server/game/server_cardzone.cpp +++ b/libcockatrice_network/libcockatrice/network/server/remote/game/server_cardzone.cpp @@ -19,13 +19,13 @@ ***************************************************************************/ #include "server_cardzone.h" -#include "../rng_abstract.h" -#include "pb/command_move_card.pb.h" #include "server_abstract_player.h" #include "server_card.h" #include #include +#include +#include Server_CardZone::Server_CardZone(Server_AbstractPlayer *_player, const QString &_name, diff --git a/common/server/game/server_cardzone.h b/libcockatrice_network/libcockatrice/network/server/remote/game/server_cardzone.h similarity index 98% rename from common/server/game/server_cardzone.h rename to libcockatrice_network/libcockatrice/network/server/remote/game/server_cardzone.h index 3f83be9d4..2a30de53d 100644 --- a/common/server/game/server_cardzone.h +++ b/libcockatrice_network/libcockatrice/network/server/remote/game/server_cardzone.h @@ -20,12 +20,11 @@ #ifndef SERVER_CARDZONE_H #define SERVER_CARDZONE_H -#include "pb/serverinfo_zone.pb.h" - #include #include #include #include +#include class Server_Card; class Server_AbstractPlayer; diff --git a/common/server/game/server_counter.cpp b/libcockatrice_network/libcockatrice/network/server/remote/game/server_counter.cpp similarity index 88% rename from common/server/game/server_counter.cpp rename to libcockatrice_network/libcockatrice/network/server/remote/game/server_counter.cpp index 3dc5c6d66..b18e11c2b 100644 --- a/common/server/game/server_counter.cpp +++ b/libcockatrice_network/libcockatrice/network/server/remote/game/server_counter.cpp @@ -1,6 +1,6 @@ #include "server_counter.h" -#include "pb/serverinfo_counter.pb.h" +#include Server_Counter::Server_Counter(int _id, const QString &_name, const color &_counterColor, int _radius, int _count) : id(_id), name(_name), counterColor(_counterColor), radius(_radius), count(_count) diff --git a/common/server/game/server_counter.h b/libcockatrice_network/libcockatrice/network/server/remote/game/server_counter.h similarity index 97% rename from common/server/game/server_counter.h rename to libcockatrice_network/libcockatrice/network/server/remote/game/server_counter.h index 3a5f837ae..55aad991c 100644 --- a/common/server/game/server_counter.h +++ b/libcockatrice_network/libcockatrice/network/server/remote/game/server_counter.h @@ -20,9 +20,8 @@ #ifndef SERVER_COUNTER_H #define SERVER_COUNTER_H -#include "pb/color.pb.h" - #include +#include class ServerInfo_Counter; diff --git a/common/server/game/server_game.cpp b/libcockatrice_network/libcockatrice/network/server/remote/game/server_game.cpp similarity index 96% rename from common/server/game/server_game.cpp rename to libcockatrice_network/libcockatrice/network/server/remote/game/server_game.cpp index 278fcfdc1..67c1aa8d6 100644 --- a/common/server/game/server_game.cpp +++ b/libcockatrice_network/libcockatrice/network/server/remote/game/server_game.cpp @@ -19,28 +19,10 @@ ***************************************************************************/ #include "server_game.h" -#include "../../deck_list.h" #include "../server.h" #include "../server_database_interface.h" #include "../server_protocolhandler.h" #include "../server_room.h" -#include "pb/context_connection_state_changed.pb.h" -#include "pb/context_deck_select.pb.h" -#include "pb/context_ping_changed.pb.h" -#include "pb/event_delete_arrow.pb.h" -#include "pb/event_game_closed.pb.h" -#include "pb/event_game_host_changed.pb.h" -#include "pb/event_game_joined.pb.h" -#include "pb/event_game_state_changed.pb.h" -#include "pb/event_join.pb.h" -#include "pb/event_kicked.pb.h" -#include "pb/event_leave.pb.h" -#include "pb/event_player_properties_changed.pb.h" -#include "pb/event_replay_added.pb.h" -#include "pb/event_set_active_phase.pb.h" -#include "pb/event_set_active_player.pb.h" -#include "pb/game_replay.pb.h" -#include "pb/serverinfo_playerping.pb.h" #include "server_abstract_player.h" #include "server_arrow.h" #include "server_card.h" @@ -51,6 +33,24 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include Server_Game::Server_Game(const ServerInfo_User &_creatorInfo, int _gameId, diff --git a/common/server/game/server_game.h b/libcockatrice_network/libcockatrice/network/server/remote/game/server_game.h similarity index 97% rename from common/server/game/server_game.h rename to libcockatrice_network/libcockatrice/network/server/remote/game/server_game.h index b3a56be3e..50ffbef36 100644 --- a/common/server/game/server_game.h +++ b/libcockatrice_network/libcockatrice/network/server/remote/game/server_game.h @@ -21,9 +21,6 @@ #define SERVERGAME_H #include "../server_response_containers.h" -#include "pb/event_leave.pb.h" -#include "pb/response.pb.h" -#include "pb/serverinfo_game.pb.h" #include #include @@ -31,6 +28,9 @@ #include #include #include +#include +#include +#include class QTimer; class GameEventContainer; diff --git a/common/server/game/server_move_card_struct.h b/libcockatrice_network/libcockatrice/network/server/remote/game/server_move_card_struct.h similarity index 100% rename from common/server/game/server_move_card_struct.h rename to libcockatrice_network/libcockatrice/network/server/remote/game/server_move_card_struct.h diff --git a/common/server/game/server_player.cpp b/libcockatrice_network/libcockatrice/network/server/remote/game/server_player.cpp similarity index 80% rename from common/server/game/server_player.cpp rename to libcockatrice_network/libcockatrice/network/server/remote/game/server_player.cpp index d5598e138..b840a172c 100644 --- a/common/server/game/server_player.cpp +++ b/libcockatrice_network/libcockatrice/network/server/remote/game/server_player.cpp @@ -1,46 +1,92 @@ #include "server_player.h" -#include "../../color.h" -#include "../../deck_list.h" -#include "../../deck_list_card_node.h" -#include "../../trice_limits.h" #include "../server.h" +#include "../server_abstractuserinterface.h" #include "../server_database_interface.h" #include "../server_room.h" -#include "pb/command_change_zone_properties.pb.h" -#include "pb/command_create_counter.pb.h" -#include "pb/command_deck_select.pb.h" -#include "pb/command_del_counter.pb.h" -#include "pb/command_draw_cards.pb.h" -#include "pb/command_inc_counter.pb.h" -#include "pb/command_move_card.pb.h" -#include "pb/command_mulligan.pb.h" -#include "pb/command_reverse_turn.pb.h" -#include "pb/command_set_active_phase.pb.h" -#include "pb/command_set_counter.pb.h" -#include "pb/command_set_sideboard_lock.pb.h" -#include "pb/command_set_sideboard_plan.pb.h" -#include "pb/command_shuffle.pb.h" -#include "pb/command_undo_draw.pb.h" -#include "pb/context_deck_select.pb.h" -#include "pb/context_mulligan.pb.h" -#include "pb/context_set_sideboard_lock.pb.h" -#include "pb/context_undo_draw.pb.h" -#include "pb/event_create_counter.pb.h" -#include "pb/event_del_counter.pb.h" -#include "pb/event_draw_cards.pb.h" -#include "pb/event_player_properties_changed.pb.h" -#include "pb/event_reverse_turn.pb.h" -#include "pb/event_set_counter.pb.h" -#include "pb/event_shuffle.pb.h" -#include "pb/response_deck_download.pb.h" -#include "pb/serverinfo_player.pb.h" +#include "server_arrow.h" #include "server_card.h" #include "server_cardzone.h" #include "server_counter.h" #include "server_game.h" #include "server_move_card_struct.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + Server_Player::Server_Player(Server_Game *_game, int _playerId, const ServerInfo_User &_userInfo, diff --git a/common/server/game/server_player.h b/libcockatrice_network/libcockatrice/network/server/remote/game/server_player.h similarity index 100% rename from common/server/game/server_player.h rename to libcockatrice_network/libcockatrice/network/server/remote/game/server_player.h diff --git a/common/server/game/server_spectator.cpp b/libcockatrice_network/libcockatrice/network/server/remote/game/server_spectator.cpp similarity index 100% rename from common/server/game/server_spectator.cpp rename to libcockatrice_network/libcockatrice/network/server/remote/game/server_spectator.cpp diff --git a/common/server/game/server_spectator.h b/libcockatrice_network/libcockatrice/network/server/remote/game/server_spectator.h similarity index 100% rename from common/server/game/server_spectator.h rename to libcockatrice_network/libcockatrice/network/server/remote/game/server_spectator.h diff --git a/common/room_message_type.h b/libcockatrice_network/libcockatrice/network/server/remote/room_message_type.h similarity index 86% rename from common/room_message_type.h rename to libcockatrice_network/libcockatrice/network/server/remote/room_message_type.h index 7b7ad9aca..5559db965 100644 --- a/common/room_message_type.h +++ b/libcockatrice_network/libcockatrice/network/server/remote/room_message_type.h @@ -6,9 +6,8 @@ // https://github.com/protocolbuffers/protobuf/issues/119 #undef TYPE_BOOL #endif -#include "pb/event_room_say.pb.h" - #include +#include Q_DECLARE_FLAGS(RoomMessageTypeFlags, Event_RoomSay::RoomMessageType) Q_DECLARE_OPERATORS_FOR_FLAGS(RoomMessageTypeFlags) diff --git a/common/server/server.cpp b/libcockatrice_network/libcockatrice/network/server/remote/server.cpp similarity index 98% rename from common/server/server.cpp rename to libcockatrice_network/libcockatrice/network/server/remote/server.cpp index a80c9ee8f..2f1232b8f 100644 --- a/common/server/server.cpp +++ b/libcockatrice_network/libcockatrice/network/server/remote/server.cpp @@ -19,16 +19,8 @@ ***************************************************************************/ #include "server.h" -#include "../debug_pb_message.h" -#include "../featureset.h" #include "game/server_game.h" #include "game/server_player.h" -#include "pb/event_connection_closed.pb.h" -#include "pb/event_list_rooms.pb.h" -#include "pb/event_user_joined.pb.h" -#include "pb/event_user_left.pb.h" -#include "pb/isl_message.pb.h" -#include "pb/session_event.pb.h" #include "server_database_interface.h" #include "server_protocolhandler.h" #include "server_remoteuserinterface.h" @@ -37,6 +29,14 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include Server::Server(QObject *parent) : QObject(parent), nextLocalGameId(0), tcpUserCount(0), webSocketUserCount(0) { diff --git a/common/server/server.h b/libcockatrice_network/libcockatrice/network/server/remote/server.h similarity index 96% rename from common/server/server.h rename to libcockatrice_network/libcockatrice/network/server/remote/server.h index 293aeb5b2..f9dada801 100644 --- a/common/server/server.h +++ b/libcockatrice_network/libcockatrice/network/server/remote/server.h @@ -1,11 +1,6 @@ #ifndef SERVER_H #define SERVER_H -#include "pb/commands.pb.h" -#include "pb/serverinfo_ban.pb.h" -#include "pb/serverinfo_chat_message.pb.h" -#include "pb/serverinfo_user.pb.h" -#include "pb/serverinfo_warning.pb.h" #include "server_player_reference.h" #include @@ -14,6 +9,11 @@ #include #include #include +#include +#include +#include +#include +#include class Server_DatabaseInterface; class Server_Game; diff --git a/common/server/server_abstractuserinterface.cpp b/libcockatrice_network/libcockatrice/network/server/remote/server_abstractuserinterface.cpp similarity index 97% rename from common/server/server_abstractuserinterface.cpp rename to libcockatrice_network/libcockatrice/network/server/remote/server_abstractuserinterface.cpp index 5016a8867..96626a4bf 100644 --- a/common/server/server_abstractuserinterface.cpp +++ b/libcockatrice_network/libcockatrice/network/server/remote/server_abstractuserinterface.cpp @@ -2,8 +2,6 @@ #include "game/server_game.h" #include "game/server_player.h" -#include "pb/event_game_joined.pb.h" -#include "pb/event_game_state_changed.pb.h" #include "server.h" #include "server_player_reference.h" #include "server_response_containers.h" @@ -13,6 +11,8 @@ #include #include #include +#include +#include void Server_AbstractUserInterface::sendProtocolItemByType(ServerMessage::MessageType type, const ::google::protobuf::Message &item) diff --git a/common/server/server_abstractuserinterface.h b/libcockatrice_network/libcockatrice/network/server/remote/server_abstractuserinterface.h similarity index 92% rename from common/server/server_abstractuserinterface.h rename to libcockatrice_network/libcockatrice/network/server/remote/server_abstractuserinterface.h index c65d8a5c4..10a2aee62 100644 --- a/common/server/server_abstractuserinterface.h +++ b/libcockatrice_network/libcockatrice/network/server/remote/server_abstractuserinterface.h @@ -1,13 +1,13 @@ #ifndef SERVER_ABSTRACTUSERINTERFACE #define SERVER_ABSTRACTUSERINTERFACE -#include "../serverinfo_user_container.h" -#include "pb/response.pb.h" -#include "pb/server_message.pb.h" +#include "serverinfo_user_container.h" #include #include #include +#include +#include class SessionEvent; class GameEventContainer; diff --git a/common/server/server_database_interface.cpp b/libcockatrice_network/libcockatrice/network/server/remote/server_database_interface.cpp similarity index 100% rename from common/server/server_database_interface.cpp rename to libcockatrice_network/libcockatrice/network/server/remote/server_database_interface.cpp diff --git a/common/server/server_database_interface.h b/libcockatrice_network/libcockatrice/network/server/remote/server_database_interface.h similarity index 100% rename from common/server/server_database_interface.h rename to libcockatrice_network/libcockatrice/network/server/remote/server_database_interface.h diff --git a/common/server/server_player_reference.h b/libcockatrice_network/libcockatrice/network/server/remote/server_player_reference.h similarity index 100% rename from common/server/server_player_reference.h rename to libcockatrice_network/libcockatrice/network/server/remote/server_player_reference.h diff --git a/common/server/server_protocolhandler.cpp b/libcockatrice_network/libcockatrice/network/server/remote/server_protocolhandler.cpp similarity index 96% rename from common/server/server_protocolhandler.cpp rename to libcockatrice_network/libcockatrice/network/server/remote/server_protocolhandler.cpp index c06ee7624..92dcf4230 100644 --- a/common/server/server_protocolhandler.cpp +++ b/libcockatrice_network/libcockatrice/network/server/remote/server_protocolhandler.cpp @@ -1,25 +1,7 @@ #include "server_protocolhandler.h" -#include "../debug_pb_message.h" -#include "../featureset.h" -#include "../get_pb_extension.h" -#include "../trice_limits.h" #include "game/server_game.h" #include "game/server_player.h" -#include "pb/commands.pb.h" -#include "pb/event_game_joined.pb.h" -#include "pb/event_list_rooms.pb.h" -#include "pb/event_notify_user.pb.h" -#include "pb/event_room_say.pb.h" -#include "pb/event_server_message.pb.h" -#include "pb/event_user_message.pb.h" -#include "pb/response.pb.h" -#include "pb/response_get_games_of_user.pb.h" -#include "pb/response_get_user_info.pb.h" -#include "pb/response_join_room.pb.h" -#include "pb/response_list_users.pb.h" -#include "pb/response_login.pb.h" -#include "pb/serverinfo_user.pb.h" #include "server_database_interface.h" #include "server_room.h" @@ -27,6 +9,24 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include Server_ProtocolHandler::Server_ProtocolHandler(Server *_server, Server_DatabaseInterface *_databaseInterface, diff --git a/common/server/server_protocolhandler.h b/libcockatrice_network/libcockatrice/network/server/remote/server_protocolhandler.h similarity index 97% rename from common/server/server_protocolhandler.h rename to libcockatrice_network/libcockatrice/network/server/remote/server_protocolhandler.h index b80e08c7e..9f3b1f4e7 100644 --- a/common/server/server_protocolhandler.h +++ b/libcockatrice_network/libcockatrice/network/server/remote/server_protocolhandler.h @@ -1,13 +1,13 @@ #ifndef SERVER_PROTOCOLHANDLER_H #define SERVER_PROTOCOLHANDLER_H -#include "pb/response.pb.h" -#include "pb/server_message.pb.h" #include "server.h" #include "server_abstractuserinterface.h" #include #include +#include +#include class Features; class Server_DatabaseInterface; diff --git a/common/server/server_remoteuserinterface.cpp b/libcockatrice_network/libcockatrice/network/server/remote/server_remoteuserinterface.cpp similarity index 92% rename from common/server/server_remoteuserinterface.cpp rename to libcockatrice_network/libcockatrice/network/server/remote/server_remoteuserinterface.cpp index ec9b5d88a..54af5a265 100644 --- a/common/server/server_remoteuserinterface.cpp +++ b/libcockatrice_network/libcockatrice/network/server/remote/server_remoteuserinterface.cpp @@ -1,8 +1,9 @@ #include "server_remoteuserinterface.h" -#include "pb/serverinfo_user.pb.h" #include "server.h" +#include + void Server_RemoteUserInterface::sendProtocolItem(const Response &item) { server->sendIsl_Response(item, userInfo->server_id(), userInfo->session_id()); diff --git a/common/server/server_remoteuserinterface.h b/libcockatrice_network/libcockatrice/network/server/remote/server_remoteuserinterface.h similarity index 100% rename from common/server/server_remoteuserinterface.h rename to libcockatrice_network/libcockatrice/network/server/remote/server_remoteuserinterface.h diff --git a/common/server/server_response_containers.cpp b/libcockatrice_network/libcockatrice/network/server/remote/server_response_containers.cpp similarity index 100% rename from common/server/server_response_containers.cpp rename to libcockatrice_network/libcockatrice/network/server/remote/server_response_containers.cpp diff --git a/common/server/server_response_containers.h b/libcockatrice_network/libcockatrice/network/server/remote/server_response_containers.h similarity index 98% rename from common/server/server_response_containers.h rename to libcockatrice_network/libcockatrice/network/server/remote/server_response_containers.h index 31e00c54e..e533d6692 100644 --- a/common/server/server_response_containers.h +++ b/libcockatrice_network/libcockatrice/network/server/remote/server_response_containers.h @@ -1,10 +1,9 @@ #ifndef SERVER_RESPONSE_CONTAINERS_H #define SERVER_RESPONSE_CONTAINERS_H -#include "pb/server_message.pb.h" - #include #include +#include namespace google { diff --git a/common/server/server_room.cpp b/libcockatrice_network/libcockatrice/network/server/remote/server_room.cpp similarity index 96% rename from common/server/server_room.cpp rename to libcockatrice_network/libcockatrice/network/server/remote/server_room.cpp index badb37642..e94b255bd 100644 --- a/common/server/server_room.cpp +++ b/libcockatrice_network/libcockatrice/network/server/remote/server_room.cpp @@ -1,21 +1,21 @@ #include "server_room.h" -#include "../trice_limits.h" #include "game/server_game.h" -#include "pb/commands.pb.h" -#include "pb/event_join_room.pb.h" -#include "pb/event_leave_room.pb.h" -#include "pb/event_list_games.pb.h" -#include "pb/event_remove_messages.pb.h" -#include "pb/event_room_say.pb.h" -#include "pb/room_commands.pb.h" -#include "pb/serverinfo_chat_message.pb.h" -#include "pb/serverinfo_room.pb.h" #include "server_protocolhandler.h" #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include Server_Room::Server_Room(int _id, int _chatHistorySize, diff --git a/common/server/server_room.h b/libcockatrice_network/libcockatrice/network/server/remote/server_room.h similarity index 96% rename from common/server/server_room.h rename to libcockatrice_network/libcockatrice/network/server/remote/server_room.h index 7e256dc15..34b9063e9 100644 --- a/common/server/server_room.h +++ b/libcockatrice_network/libcockatrice/network/server/remote/server_room.h @@ -1,9 +1,7 @@ #ifndef SERVER_ROOM_H #define SERVER_ROOM_H -#include "../serverinfo_user_container.h" -#include "pb/response.pb.h" -#include "pb/serverinfo_chat_message.pb.h" +#include "serverinfo_user_container.h" #include #include @@ -11,6 +9,8 @@ #include #include #include +#include +#include class Server_DatabaseInterface; class Server_ProtocolHandler; diff --git a/common/serverinfo_user_container.cpp b/libcockatrice_network/libcockatrice/network/server/remote/serverinfo_user_container.cpp similarity index 96% rename from common/serverinfo_user_container.cpp rename to libcockatrice_network/libcockatrice/network/server/remote/serverinfo_user_container.cpp index 597ebd01a..77ff38906 100644 --- a/common/serverinfo_user_container.cpp +++ b/libcockatrice_network/libcockatrice/network/server/remote/serverinfo_user_container.cpp @@ -1,6 +1,6 @@ #include "serverinfo_user_container.h" -#include "pb/serverinfo_user.pb.h" +#include ServerInfo_User_Container::ServerInfo_User_Container(ServerInfo_User *_userInfo) : userInfo(_userInfo) { diff --git a/common/serverinfo_user_container.h b/libcockatrice_network/libcockatrice/network/server/remote/serverinfo_user_container.h similarity index 100% rename from common/serverinfo_user_container.h rename to libcockatrice_network/libcockatrice/network/server/remote/serverinfo_user_container.h diff --git a/common/user_level.h b/libcockatrice_network/libcockatrice/network/server/remote/user_level.h similarity index 85% rename from common/user_level.h rename to libcockatrice_network/libcockatrice/network/server/remote/user_level.h index 5d720c0aa..9b7a0ca88 100644 --- a/common/user_level.h +++ b/libcockatrice_network/libcockatrice/network/server/remote/user_level.h @@ -6,9 +6,8 @@ // https://github.com/protocolbuffers/protobuf/issues/119 #undef TYPE_BOOL #endif -#include "pb/serverinfo_user.pb.h" - #include +#include Q_DECLARE_FLAGS(UserLevelFlags, ServerInfo_User::UserLevelFlag) Q_DECLARE_OPERATORS_FOR_FLAGS(UserLevelFlags) diff --git a/libcockatrice_protocol/CMakeLists.txt b/libcockatrice_protocol/CMakeLists.txt new file mode 100644 index 000000000..64f1ee270 --- /dev/null +++ b/libcockatrice_protocol/CMakeLists.txt @@ -0,0 +1,28 @@ +# Top-level wrapper for the protobuf library + +add_subdirectory(libcockatrice/protocol/pb) + +add_library(libcockatrice_protocol STATIC) + +set(SOURCES libcockatrice/protocol/debug_pb_message.cpp libcockatrice/protocol/featureset.cpp + libcockatrice/protocol/get_pb_extension.cpp libcockatrice/protocol/pending_command.cpp +) + +set(HEADERS libcockatrice/protocol/debug_pb_message.h libcockatrice/protocol/featureset.h + libcockatrice/protocol/get_pb_extension.h libcockatrice/protocol/pending_command.h +) + +target_sources(libcockatrice_protocol PRIVATE ${SOURCES} ${HEADERS}) + +add_dependencies(libcockatrice_protocol libcockatrice_protocol_pb) + +# Link the actual generated protobuf library +target_link_libraries( + libcockatrice_protocol PUBLIC ${COCKATRICE_QT_MODULES} libcockatrice_protocol_pb libcockatrice_utility +) + +# Expose include paths +target_include_directories( + libcockatrice_protocol PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_BINARY_DIR} # points to the generated headers +) diff --git a/common/debug_pb_message.cpp b/libcockatrice_protocol/libcockatrice/protocol/debug_pb_message.cpp similarity index 98% rename from common/debug_pb_message.cpp rename to libcockatrice_protocol/libcockatrice/protocol/debug_pb_message.cpp index dda672689..f0c3448b5 100644 --- a/common/debug_pb_message.cpp +++ b/libcockatrice_protocol/libcockatrice/protocol/debug_pb_message.cpp @@ -1,12 +1,11 @@ #include "debug_pb_message.h" -#include "trice_limits.h" - #include #include #include #include #include +#include // FastFieldValuePrinter is added in protobuf 3.4, going out of our way to add the old FieldValuePrinter is not worth it #if GOOGLE_PROTOBUF_VERSION > 3004000 diff --git a/common/debug_pb_message.h b/libcockatrice_protocol/libcockatrice/protocol/debug_pb_message.h similarity index 100% rename from common/debug_pb_message.h rename to libcockatrice_protocol/libcockatrice/protocol/debug_pb_message.h diff --git a/common/featureset.cpp b/libcockatrice_protocol/libcockatrice/protocol/featureset.cpp similarity index 100% rename from common/featureset.cpp rename to libcockatrice_protocol/libcockatrice/protocol/featureset.cpp diff --git a/common/featureset.h b/libcockatrice_protocol/libcockatrice/protocol/featureset.h similarity index 94% rename from common/featureset.h rename to libcockatrice_protocol/libcockatrice/protocol/featureset.h index da495c4b7..424d0b975 100644 --- a/common/featureset.h +++ b/libcockatrice_protocol/libcockatrice/protocol/featureset.h @@ -2,10 +2,11 @@ #define FEATURESET_H #include +#include #include #include -class FeatureSet +class FeatureSet : public QObject { public: FeatureSet(); diff --git a/common/get_pb_extension.cpp b/libcockatrice_protocol/libcockatrice/protocol/get_pb_extension.cpp similarity index 100% rename from common/get_pb_extension.cpp rename to libcockatrice_protocol/libcockatrice/protocol/get_pb_extension.cpp diff --git a/common/get_pb_extension.h b/libcockatrice_protocol/libcockatrice/protocol/get_pb_extension.h similarity index 100% rename from common/get_pb_extension.h rename to libcockatrice_protocol/libcockatrice/protocol/get_pb_extension.h diff --git a/common/pb/CMakeLists.txt b/libcockatrice_protocol/libcockatrice/protocol/pb/CMakeLists.txt similarity index 90% rename from common/pb/CMakeLists.txt rename to libcockatrice_protocol/libcockatrice/protocol/pb/CMakeLists.txt index dc48823fd..32e7f3238 100644 --- a/common/pb/CMakeLists.txt +++ b/libcockatrice_protocol/libcockatrice/protocol/pb/CMakeLists.txt @@ -171,12 +171,12 @@ if(${Protobuf_VERSION} VERSION_LESS "3.21.0.0") include_directories(${CMAKE_CURRENT_BINARY_DIR}) protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS ${PROTO_FILES}) - add_library(cockatrice_protocol ${PROTO_SRCS} ${PROTO_HDRS}) - set(cockatrice_protocol_LIBS ${PROTOBUF_LIBRARIES}) + add_library(libcockatrice_protocol_pb ${PROTO_SRCS} ${PROTO_HDRS}) + set(libcockatrice_protocol_pb_LIBS ${PROTOBUF_LIBRARIES}) if(UNIX) - set(cockatrice_protocol_LIBS ${cockatrice_protocol_LIBS} -lpthread) + set(libcockatrice_protocol_pb_LIBS ${libcockatrice_protocol_pb_LIBS} -lpthread) endif(UNIX) - target_link_libraries(cockatrice_protocol ${cockatrice_protocol_LIBS}) + target_link_libraries(libcockatrice_protocol_pb ${libcockatrice_protocol_pb_LIBS}) # ubuntu uses an outdated package for protobuf, 3.1.0 is required if(${Protobuf_VERSION} VERSION_LESS "3.1.0") @@ -188,12 +188,10 @@ if(${Protobuf_VERSION} VERSION_LESS "3.21.0.0") ) endif() else() - add_library(cockatrice_protocol ${PROTO_FILES}) - target_link_libraries(cockatrice_protocol PUBLIC protobuf::libprotobuf) + add_library(libcockatrice_protocol_pb ${PROTO_FILES}) + target_link_libraries(libcockatrice_protocol_pb PUBLIC protobuf::libprotobuf) set(PROTO_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}") - target_include_directories(cockatrice_protocol PUBLIC "${PROTOBUF_INCLUDE_DIRS}") + target_include_directories(libcockatrice_protocol_pb PUBLIC "${PROTOBUF_INCLUDE_DIRS}") - protobuf_generate( - TARGET cockatrice_protocol IMPORT_DIRS "${CMAKE_CURRENT_LIST_DIR}" PROTOC_OUT_DIR "${PROTO_BINARY_DIR}" - ) + protobuf_generate(TARGET libcockatrice_protocol_pb IMPORT_DIRS "." PROTOC_OUT_DIR "${PROTO_BINARY_DIR}") endif() diff --git a/common/pb/admin_commands.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/admin_commands.proto similarity index 100% rename from common/pb/admin_commands.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/admin_commands.proto diff --git a/common/pb/card_attributes.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/card_attributes.proto similarity index 100% rename from common/pb/card_attributes.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/card_attributes.proto diff --git a/common/pb/color.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/color.proto similarity index 100% rename from common/pb/color.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/color.proto diff --git a/common/pb/command_attach_card.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/command_attach_card.proto similarity index 100% rename from common/pb/command_attach_card.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/command_attach_card.proto diff --git a/common/pb/command_change_zone_properties.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/command_change_zone_properties.proto similarity index 100% rename from common/pb/command_change_zone_properties.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/command_change_zone_properties.proto diff --git a/common/pb/command_concede.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/command_concede.proto similarity index 100% rename from common/pb/command_concede.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/command_concede.proto diff --git a/common/pb/command_create_arrow.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/command_create_arrow.proto similarity index 100% rename from common/pb/command_create_arrow.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/command_create_arrow.proto diff --git a/common/pb/command_create_counter.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/command_create_counter.proto similarity index 100% rename from common/pb/command_create_counter.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/command_create_counter.proto diff --git a/common/pb/command_create_token.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/command_create_token.proto similarity index 100% rename from common/pb/command_create_token.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/command_create_token.proto diff --git a/common/pb/command_deck_del.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/command_deck_del.proto similarity index 100% rename from common/pb/command_deck_del.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/command_deck_del.proto diff --git a/common/pb/command_deck_del_dir.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/command_deck_del_dir.proto similarity index 100% rename from common/pb/command_deck_del_dir.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/command_deck_del_dir.proto diff --git a/common/pb/command_deck_download.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/command_deck_download.proto similarity index 100% rename from common/pb/command_deck_download.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/command_deck_download.proto diff --git a/common/pb/command_deck_list.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/command_deck_list.proto similarity index 100% rename from common/pb/command_deck_list.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/command_deck_list.proto diff --git a/common/pb/command_deck_new_dir.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/command_deck_new_dir.proto similarity index 100% rename from common/pb/command_deck_new_dir.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/command_deck_new_dir.proto diff --git a/common/pb/command_deck_select.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/command_deck_select.proto similarity index 100% rename from common/pb/command_deck_select.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/command_deck_select.proto diff --git a/common/pb/command_deck_upload.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/command_deck_upload.proto similarity index 100% rename from common/pb/command_deck_upload.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/command_deck_upload.proto diff --git a/common/pb/command_del_counter.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/command_del_counter.proto similarity index 100% rename from common/pb/command_del_counter.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/command_del_counter.proto diff --git a/common/pb/command_delete_arrow.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/command_delete_arrow.proto similarity index 100% rename from common/pb/command_delete_arrow.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/command_delete_arrow.proto diff --git a/common/pb/command_draw_cards.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/command_draw_cards.proto similarity index 100% rename from common/pb/command_draw_cards.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/command_draw_cards.proto diff --git a/common/pb/command_dump_zone.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/command_dump_zone.proto similarity index 100% rename from common/pb/command_dump_zone.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/command_dump_zone.proto diff --git a/common/pb/command_flip_card.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/command_flip_card.proto similarity index 100% rename from common/pb/command_flip_card.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/command_flip_card.proto diff --git a/common/pb/command_game_say.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/command_game_say.proto similarity index 100% rename from common/pb/command_game_say.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/command_game_say.proto diff --git a/common/pb/command_inc_card_counter.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/command_inc_card_counter.proto similarity index 100% rename from common/pb/command_inc_card_counter.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/command_inc_card_counter.proto diff --git a/common/pb/command_inc_counter.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/command_inc_counter.proto similarity index 100% rename from common/pb/command_inc_counter.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/command_inc_counter.proto diff --git a/common/pb/command_kick_from_game.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/command_kick_from_game.proto similarity index 100% rename from common/pb/command_kick_from_game.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/command_kick_from_game.proto diff --git a/common/pb/command_leave_game.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/command_leave_game.proto similarity index 100% rename from common/pb/command_leave_game.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/command_leave_game.proto diff --git a/common/pb/command_move_card.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/command_move_card.proto similarity index 100% rename from common/pb/command_move_card.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/command_move_card.proto diff --git a/common/pb/command_mulligan.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/command_mulligan.proto similarity index 100% rename from common/pb/command_mulligan.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/command_mulligan.proto diff --git a/common/pb/command_next_turn.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/command_next_turn.proto similarity index 100% rename from common/pb/command_next_turn.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/command_next_turn.proto diff --git a/common/pb/command_ready_start.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/command_ready_start.proto similarity index 100% rename from common/pb/command_ready_start.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/command_ready_start.proto diff --git a/common/pb/command_replay_delete_match.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/command_replay_delete_match.proto similarity index 100% rename from common/pb/command_replay_delete_match.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/command_replay_delete_match.proto diff --git a/common/pb/command_replay_download.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/command_replay_download.proto similarity index 100% rename from common/pb/command_replay_download.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/command_replay_download.proto diff --git a/common/pb/command_replay_get_code.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/command_replay_get_code.proto similarity index 100% rename from common/pb/command_replay_get_code.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/command_replay_get_code.proto diff --git a/common/pb/command_replay_list.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/command_replay_list.proto similarity index 100% rename from common/pb/command_replay_list.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/command_replay_list.proto diff --git a/common/pb/command_replay_modify_match.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/command_replay_modify_match.proto similarity index 100% rename from common/pb/command_replay_modify_match.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/command_replay_modify_match.proto diff --git a/common/pb/command_replay_submit_code.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/command_replay_submit_code.proto similarity index 100% rename from common/pb/command_replay_submit_code.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/command_replay_submit_code.proto diff --git a/common/pb/command_reveal_cards.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/command_reveal_cards.proto similarity index 100% rename from common/pb/command_reveal_cards.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/command_reveal_cards.proto diff --git a/common/pb/command_reverse_turn.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/command_reverse_turn.proto similarity index 100% rename from common/pb/command_reverse_turn.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/command_reverse_turn.proto diff --git a/common/pb/command_roll_die.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/command_roll_die.proto similarity index 100% rename from common/pb/command_roll_die.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/command_roll_die.proto diff --git a/common/pb/command_set_active_phase.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/command_set_active_phase.proto similarity index 100% rename from common/pb/command_set_active_phase.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/command_set_active_phase.proto diff --git a/common/pb/command_set_card_attr.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/command_set_card_attr.proto similarity index 100% rename from common/pb/command_set_card_attr.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/command_set_card_attr.proto diff --git a/common/pb/command_set_card_counter.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/command_set_card_counter.proto similarity index 100% rename from common/pb/command_set_card_counter.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/command_set_card_counter.proto diff --git a/common/pb/command_set_counter.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/command_set_counter.proto similarity index 100% rename from common/pb/command_set_counter.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/command_set_counter.proto diff --git a/common/pb/command_set_sideboard_lock.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/command_set_sideboard_lock.proto similarity index 100% rename from common/pb/command_set_sideboard_lock.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/command_set_sideboard_lock.proto diff --git a/common/pb/command_set_sideboard_plan.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/command_set_sideboard_plan.proto similarity index 100% rename from common/pb/command_set_sideboard_plan.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/command_set_sideboard_plan.proto diff --git a/common/pb/command_shuffle.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/command_shuffle.proto similarity index 100% rename from common/pb/command_shuffle.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/command_shuffle.proto diff --git a/common/pb/command_undo_draw.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/command_undo_draw.proto similarity index 100% rename from common/pb/command_undo_draw.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/command_undo_draw.proto diff --git a/common/pb/commands.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/commands.proto similarity index 100% rename from common/pb/commands.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/commands.proto diff --git a/common/pb/context_concede.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/context_concede.proto similarity index 100% rename from common/pb/context_concede.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/context_concede.proto diff --git a/common/pb/context_connection_state_changed.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/context_connection_state_changed.proto similarity index 100% rename from common/pb/context_connection_state_changed.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/context_connection_state_changed.proto diff --git a/common/pb/context_deck_select.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/context_deck_select.proto similarity index 100% rename from common/pb/context_deck_select.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/context_deck_select.proto diff --git a/common/pb/context_move_card.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/context_move_card.proto similarity index 100% rename from common/pb/context_move_card.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/context_move_card.proto diff --git a/common/pb/context_mulligan.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/context_mulligan.proto similarity index 100% rename from common/pb/context_mulligan.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/context_mulligan.proto diff --git a/common/pb/context_ping_changed.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/context_ping_changed.proto similarity index 100% rename from common/pb/context_ping_changed.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/context_ping_changed.proto diff --git a/common/pb/context_ready_start.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/context_ready_start.proto similarity index 100% rename from common/pb/context_ready_start.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/context_ready_start.proto diff --git a/common/pb/context_set_sideboard_lock.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/context_set_sideboard_lock.proto similarity index 100% rename from common/pb/context_set_sideboard_lock.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/context_set_sideboard_lock.proto diff --git a/common/pb/context_undo_draw.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/context_undo_draw.proto similarity index 100% rename from common/pb/context_undo_draw.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/context_undo_draw.proto diff --git a/common/pb/event_add_to_list.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_add_to_list.proto similarity index 100% rename from common/pb/event_add_to_list.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_add_to_list.proto diff --git a/common/pb/event_attach_card.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_attach_card.proto similarity index 100% rename from common/pb/event_attach_card.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_attach_card.proto diff --git a/common/pb/event_change_zone_properties.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_change_zone_properties.proto similarity index 100% rename from common/pb/event_change_zone_properties.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_change_zone_properties.proto diff --git a/common/pb/event_connection_closed.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_connection_closed.proto similarity index 100% rename from common/pb/event_connection_closed.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_connection_closed.proto diff --git a/common/pb/event_create_arrow.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_create_arrow.proto similarity index 100% rename from common/pb/event_create_arrow.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_create_arrow.proto diff --git a/common/pb/event_create_counter.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_create_counter.proto similarity index 100% rename from common/pb/event_create_counter.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_create_counter.proto diff --git a/common/pb/event_create_token.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_create_token.proto similarity index 100% rename from common/pb/event_create_token.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_create_token.proto diff --git a/common/pb/event_del_counter.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_del_counter.proto similarity index 100% rename from common/pb/event_del_counter.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_del_counter.proto diff --git a/common/pb/event_delete_arrow.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_delete_arrow.proto similarity index 100% rename from common/pb/event_delete_arrow.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_delete_arrow.proto diff --git a/common/pb/event_destroy_card.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_destroy_card.proto similarity index 100% rename from common/pb/event_destroy_card.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_destroy_card.proto diff --git a/common/pb/event_draw_cards.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_draw_cards.proto similarity index 100% rename from common/pb/event_draw_cards.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_draw_cards.proto diff --git a/common/pb/event_dump_zone.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_dump_zone.proto similarity index 100% rename from common/pb/event_dump_zone.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_dump_zone.proto diff --git a/common/pb/event_flip_card.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_flip_card.proto similarity index 100% rename from common/pb/event_flip_card.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_flip_card.proto diff --git a/common/pb/event_game_closed.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_game_closed.proto similarity index 100% rename from common/pb/event_game_closed.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_game_closed.proto diff --git a/common/pb/event_game_host_changed.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_game_host_changed.proto similarity index 100% rename from common/pb/event_game_host_changed.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_game_host_changed.proto diff --git a/common/pb/event_game_joined.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_game_joined.proto similarity index 100% rename from common/pb/event_game_joined.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_game_joined.proto diff --git a/common/pb/event_game_say.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_game_say.proto similarity index 100% rename from common/pb/event_game_say.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_game_say.proto diff --git a/common/pb/event_game_state_changed.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_game_state_changed.proto similarity index 100% rename from common/pb/event_game_state_changed.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_game_state_changed.proto diff --git a/common/pb/event_join.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_join.proto similarity index 100% rename from common/pb/event_join.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_join.proto diff --git a/common/pb/event_join_room.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_join_room.proto similarity index 100% rename from common/pb/event_join_room.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_join_room.proto diff --git a/common/pb/event_kicked.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_kicked.proto similarity index 100% rename from common/pb/event_kicked.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_kicked.proto diff --git a/common/pb/event_leave.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_leave.proto similarity index 100% rename from common/pb/event_leave.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_leave.proto diff --git a/common/pb/event_leave_room.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_leave_room.proto similarity index 100% rename from common/pb/event_leave_room.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_leave_room.proto diff --git a/common/pb/event_list_games.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_list_games.proto similarity index 100% rename from common/pb/event_list_games.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_list_games.proto diff --git a/common/pb/event_list_rooms.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_list_rooms.proto similarity index 100% rename from common/pb/event_list_rooms.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_list_rooms.proto diff --git a/common/pb/event_move_card.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_move_card.proto similarity index 100% rename from common/pb/event_move_card.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_move_card.proto diff --git a/common/pb/event_notify_user.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_notify_user.proto similarity index 100% rename from common/pb/event_notify_user.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_notify_user.proto diff --git a/common/pb/event_player_properties_changed.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_player_properties_changed.proto similarity index 100% rename from common/pb/event_player_properties_changed.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_player_properties_changed.proto diff --git a/common/pb/event_remove_from_list.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_remove_from_list.proto similarity index 100% rename from common/pb/event_remove_from_list.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_remove_from_list.proto diff --git a/common/pb/event_remove_messages.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_remove_messages.proto similarity index 100% rename from common/pb/event_remove_messages.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_remove_messages.proto diff --git a/common/pb/event_replay_added.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_replay_added.proto similarity index 100% rename from common/pb/event_replay_added.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_replay_added.proto diff --git a/common/pb/event_reveal_cards.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_reveal_cards.proto similarity index 100% rename from common/pb/event_reveal_cards.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_reveal_cards.proto diff --git a/common/pb/event_reverse_turn.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_reverse_turn.proto similarity index 100% rename from common/pb/event_reverse_turn.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_reverse_turn.proto diff --git a/common/pb/event_roll_die.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_roll_die.proto similarity index 100% rename from common/pb/event_roll_die.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_roll_die.proto diff --git a/common/pb/event_room_say.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_room_say.proto similarity index 100% rename from common/pb/event_room_say.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_room_say.proto diff --git a/common/pb/event_server_complete_list.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_server_complete_list.proto similarity index 100% rename from common/pb/event_server_complete_list.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_server_complete_list.proto diff --git a/common/pb/event_server_identification.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_server_identification.proto similarity index 100% rename from common/pb/event_server_identification.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_server_identification.proto diff --git a/common/pb/event_server_message.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_server_message.proto similarity index 100% rename from common/pb/event_server_message.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_server_message.proto diff --git a/common/pb/event_server_shutdown.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_server_shutdown.proto similarity index 100% rename from common/pb/event_server_shutdown.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_server_shutdown.proto diff --git a/common/pb/event_set_active_phase.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_set_active_phase.proto similarity index 100% rename from common/pb/event_set_active_phase.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_set_active_phase.proto diff --git a/common/pb/event_set_active_player.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_set_active_player.proto similarity index 100% rename from common/pb/event_set_active_player.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_set_active_player.proto diff --git a/common/pb/event_set_card_attr.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_set_card_attr.proto similarity index 100% rename from common/pb/event_set_card_attr.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_set_card_attr.proto diff --git a/common/pb/event_set_card_counter.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_set_card_counter.proto similarity index 100% rename from common/pb/event_set_card_counter.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_set_card_counter.proto diff --git a/common/pb/event_set_counter.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_set_counter.proto similarity index 100% rename from common/pb/event_set_counter.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_set_counter.proto diff --git a/common/pb/event_shuffle.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_shuffle.proto similarity index 100% rename from common/pb/event_shuffle.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_shuffle.proto diff --git a/common/pb/event_user_joined.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_user_joined.proto similarity index 100% rename from common/pb/event_user_joined.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_user_joined.proto diff --git a/common/pb/event_user_left.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_user_left.proto similarity index 100% rename from common/pb/event_user_left.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_user_left.proto diff --git a/common/pb/event_user_message.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/event_user_message.proto similarity index 100% rename from common/pb/event_user_message.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/event_user_message.proto diff --git a/common/pb/game_commands.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/game_commands.proto similarity index 100% rename from common/pb/game_commands.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/game_commands.proto diff --git a/common/pb/game_event.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/game_event.proto similarity index 100% rename from common/pb/game_event.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/game_event.proto diff --git a/common/pb/game_event_container.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/game_event_container.proto similarity index 100% rename from common/pb/game_event_container.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/game_event_container.proto diff --git a/common/pb/game_event_context.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/game_event_context.proto similarity index 100% rename from common/pb/game_event_context.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/game_event_context.proto diff --git a/common/pb/game_replay.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/game_replay.proto similarity index 100% rename from common/pb/game_replay.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/game_replay.proto diff --git a/common/pb/isl_message.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/isl_message.proto similarity index 100% rename from common/pb/isl_message.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/isl_message.proto diff --git a/common/pb/moderator_commands.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/moderator_commands.proto similarity index 100% rename from common/pb/moderator_commands.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/moderator_commands.proto diff --git a/common/pb/move_card_to_zone.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/move_card_to_zone.proto similarity index 100% rename from common/pb/move_card_to_zone.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/move_card_to_zone.proto diff --git a/common/pb/response.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/response.proto similarity index 100% rename from common/pb/response.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/response.proto diff --git a/common/pb/response_activate.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/response_activate.proto similarity index 100% rename from common/pb/response_activate.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/response_activate.proto diff --git a/common/pb/response_adjust_mod.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/response_adjust_mod.proto similarity index 100% rename from common/pb/response_adjust_mod.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/response_adjust_mod.proto diff --git a/common/pb/response_ban_history.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/response_ban_history.proto similarity index 100% rename from common/pb/response_ban_history.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/response_ban_history.proto diff --git a/common/pb/response_deck_download.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/response_deck_download.proto similarity index 100% rename from common/pb/response_deck_download.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/response_deck_download.proto diff --git a/common/pb/response_deck_list.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/response_deck_list.proto similarity index 100% rename from common/pb/response_deck_list.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/response_deck_list.proto diff --git a/common/pb/response_deck_upload.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/response_deck_upload.proto similarity index 100% rename from common/pb/response_deck_upload.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/response_deck_upload.proto diff --git a/common/pb/response_dump_zone.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/response_dump_zone.proto similarity index 100% rename from common/pb/response_dump_zone.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/response_dump_zone.proto diff --git a/common/pb/response_forgotpasswordrequest.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/response_forgotpasswordrequest.proto similarity index 100% rename from common/pb/response_forgotpasswordrequest.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/response_forgotpasswordrequest.proto diff --git a/common/pb/response_get_admin_notes.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/response_get_admin_notes.proto similarity index 100% rename from common/pb/response_get_admin_notes.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/response_get_admin_notes.proto diff --git a/common/pb/response_get_games_of_user.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/response_get_games_of_user.proto similarity index 100% rename from common/pb/response_get_games_of_user.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/response_get_games_of_user.proto diff --git a/common/pb/response_get_user_info.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/response_get_user_info.proto similarity index 100% rename from common/pb/response_get_user_info.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/response_get_user_info.proto diff --git a/common/pb/response_join_room.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/response_join_room.proto similarity index 100% rename from common/pb/response_join_room.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/response_join_room.proto diff --git a/common/pb/response_list_users.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/response_list_users.proto similarity index 100% rename from common/pb/response_list_users.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/response_list_users.proto diff --git a/common/pb/response_login.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/response_login.proto similarity index 100% rename from common/pb/response_login.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/response_login.proto diff --git a/common/pb/response_password_salt.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/response_password_salt.proto similarity index 100% rename from common/pb/response_password_salt.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/response_password_salt.proto diff --git a/common/pb/response_register.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/response_register.proto similarity index 100% rename from common/pb/response_register.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/response_register.proto diff --git a/common/pb/response_replay_download.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/response_replay_download.proto similarity index 100% rename from common/pb/response_replay_download.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/response_replay_download.proto diff --git a/common/pb/response_replay_get_code.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/response_replay_get_code.proto similarity index 100% rename from common/pb/response_replay_get_code.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/response_replay_get_code.proto diff --git a/common/pb/response_replay_list.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/response_replay_list.proto similarity index 100% rename from common/pb/response_replay_list.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/response_replay_list.proto diff --git a/common/pb/response_viewlog_history.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/response_viewlog_history.proto similarity index 100% rename from common/pb/response_viewlog_history.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/response_viewlog_history.proto diff --git a/common/pb/response_warn_history.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/response_warn_history.proto similarity index 100% rename from common/pb/response_warn_history.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/response_warn_history.proto diff --git a/common/pb/response_warn_list.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/response_warn_list.proto similarity index 100% rename from common/pb/response_warn_list.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/response_warn_list.proto diff --git a/common/pb/room_commands.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/room_commands.proto similarity index 100% rename from common/pb/room_commands.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/room_commands.proto diff --git a/common/pb/room_event.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/room_event.proto similarity index 100% rename from common/pb/room_event.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/room_event.proto diff --git a/common/pb/server_message.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/server_message.proto similarity index 100% rename from common/pb/server_message.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/server_message.proto diff --git a/common/pb/serverinfo_arrow.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/serverinfo_arrow.proto similarity index 100% rename from common/pb/serverinfo_arrow.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/serverinfo_arrow.proto diff --git a/common/pb/serverinfo_ban.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/serverinfo_ban.proto similarity index 100% rename from common/pb/serverinfo_ban.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/serverinfo_ban.proto diff --git a/common/pb/serverinfo_card.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/serverinfo_card.proto similarity index 100% rename from common/pb/serverinfo_card.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/serverinfo_card.proto diff --git a/common/pb/serverinfo_cardcounter.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/serverinfo_cardcounter.proto similarity index 100% rename from common/pb/serverinfo_cardcounter.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/serverinfo_cardcounter.proto diff --git a/common/pb/serverinfo_chat_message.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/serverinfo_chat_message.proto similarity index 100% rename from common/pb/serverinfo_chat_message.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/serverinfo_chat_message.proto diff --git a/common/pb/serverinfo_counter.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/serverinfo_counter.proto similarity index 100% rename from common/pb/serverinfo_counter.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/serverinfo_counter.proto diff --git a/common/pb/serverinfo_deckstorage.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/serverinfo_deckstorage.proto similarity index 100% rename from common/pb/serverinfo_deckstorage.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/serverinfo_deckstorage.proto diff --git a/common/pb/serverinfo_game.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/serverinfo_game.proto similarity index 100% rename from common/pb/serverinfo_game.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/serverinfo_game.proto diff --git a/common/pb/serverinfo_gametype.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/serverinfo_gametype.proto similarity index 100% rename from common/pb/serverinfo_gametype.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/serverinfo_gametype.proto diff --git a/common/pb/serverinfo_player.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/serverinfo_player.proto similarity index 100% rename from common/pb/serverinfo_player.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/serverinfo_player.proto diff --git a/common/pb/serverinfo_playerping.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/serverinfo_playerping.proto similarity index 100% rename from common/pb/serverinfo_playerping.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/serverinfo_playerping.proto diff --git a/common/pb/serverinfo_playerproperties.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/serverinfo_playerproperties.proto similarity index 100% rename from common/pb/serverinfo_playerproperties.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/serverinfo_playerproperties.proto diff --git a/common/pb/serverinfo_replay.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/serverinfo_replay.proto similarity index 100% rename from common/pb/serverinfo_replay.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/serverinfo_replay.proto diff --git a/common/pb/serverinfo_replay_match.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/serverinfo_replay_match.proto similarity index 100% rename from common/pb/serverinfo_replay_match.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/serverinfo_replay_match.proto diff --git a/common/pb/serverinfo_room.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/serverinfo_room.proto similarity index 100% rename from common/pb/serverinfo_room.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/serverinfo_room.proto diff --git a/common/pb/serverinfo_user.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/serverinfo_user.proto similarity index 100% rename from common/pb/serverinfo_user.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/serverinfo_user.proto diff --git a/common/pb/serverinfo_warning.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/serverinfo_warning.proto similarity index 100% rename from common/pb/serverinfo_warning.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/serverinfo_warning.proto diff --git a/common/pb/serverinfo_zone.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/serverinfo_zone.proto similarity index 100% rename from common/pb/serverinfo_zone.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/serverinfo_zone.proto diff --git a/common/pb/session_commands.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/session_commands.proto similarity index 100% rename from common/pb/session_commands.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/session_commands.proto diff --git a/common/pb/session_event.proto b/libcockatrice_protocol/libcockatrice/protocol/pb/session_event.proto similarity index 100% rename from common/pb/session_event.proto rename to libcockatrice_protocol/libcockatrice/protocol/pb/session_event.proto diff --git a/cockatrice/src/server/pending_command.cpp b/libcockatrice_protocol/libcockatrice/protocol/pending_command.cpp similarity index 100% rename from cockatrice/src/server/pending_command.cpp rename to libcockatrice_protocol/libcockatrice/protocol/pending_command.cpp diff --git a/cockatrice/src/server/pending_command.h b/libcockatrice_protocol/libcockatrice/protocol/pending_command.h similarity index 88% rename from cockatrice/src/server/pending_command.h rename to libcockatrice_protocol/libcockatrice/protocol/pending_command.h index df452b10a..1d2d9ff17 100644 --- a/cockatrice/src/server/pending_command.h +++ b/libcockatrice_protocol/libcockatrice/protocol/pending_command.h @@ -7,10 +7,9 @@ #ifndef PENDING_COMMAND_H #define PENDING_COMMAND_H -#include "pb/commands.pb.h" -#include "pb/response.pb.h" - #include +#include +#include class PendingCommand : public QObject { diff --git a/libcockatrice_rng/CMakeLists.txt b/libcockatrice_rng/CMakeLists.txt new file mode 100644 index 000000000..0e29e96f2 --- /dev/null +++ b/libcockatrice_rng/CMakeLists.txt @@ -0,0 +1,20 @@ +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTORCC ON) + +set(HEADERS libcockatrice/rng/rng_abstract.h libcockatrice/rng/rng_sfmt.h libcockatrice/rng/sfmt/SFMT.h) + +if(Qt6_FOUND) + qt6_wrap_cpp(MOC_SOURCES ${HEADERS}) +elseif(Qt5_FOUND) + qt5_wrap_cpp(MOC_SOURCES ${HEADERS}) +endif() + +add_library( + libcockatrice_rng STATIC ${MOC_SOURCES} libcockatrice/rng/rng_abstract.cpp libcockatrice/rng/rng_sfmt.cpp + libcockatrice/rng/sfmt/SFMT.c +) + +target_include_directories(libcockatrice_rng PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) + +target_link_libraries(libcockatrice_rng PUBLIC ${COCKATRICE_QT_MODULES}) diff --git a/common/rng_abstract.cpp b/libcockatrice_rng/libcockatrice/rng/rng_abstract.cpp similarity index 100% rename from common/rng_abstract.cpp rename to libcockatrice_rng/libcockatrice/rng/rng_abstract.cpp diff --git a/common/rng_abstract.h b/libcockatrice_rng/libcockatrice/rng/rng_abstract.h similarity index 100% rename from common/rng_abstract.h rename to libcockatrice_rng/libcockatrice/rng/rng_abstract.h diff --git a/common/rng_sfmt.cpp b/libcockatrice_rng/libcockatrice/rng/rng_sfmt.cpp similarity index 100% rename from common/rng_sfmt.cpp rename to libcockatrice_rng/libcockatrice/rng/rng_sfmt.cpp diff --git a/common/rng_sfmt.h b/libcockatrice_rng/libcockatrice/rng/rng_sfmt.h similarity index 100% rename from common/rng_sfmt.h rename to libcockatrice_rng/libcockatrice/rng/rng_sfmt.h diff --git a/common/sfmt/LICENSE.txt b/libcockatrice_rng/libcockatrice/rng/sfmt/LICENSE.txt similarity index 100% rename from common/sfmt/LICENSE.txt rename to libcockatrice_rng/libcockatrice/rng/sfmt/LICENSE.txt diff --git a/common/sfmt/SFMT-common.h b/libcockatrice_rng/libcockatrice/rng/sfmt/SFMT-common.h similarity index 100% rename from common/sfmt/SFMT-common.h rename to libcockatrice_rng/libcockatrice/rng/sfmt/SFMT-common.h diff --git a/common/sfmt/SFMT-params.h b/libcockatrice_rng/libcockatrice/rng/sfmt/SFMT-params.h similarity index 100% rename from common/sfmt/SFMT-params.h rename to libcockatrice_rng/libcockatrice/rng/sfmt/SFMT-params.h diff --git a/common/sfmt/SFMT-params19937.h b/libcockatrice_rng/libcockatrice/rng/sfmt/SFMT-params19937.h similarity index 100% rename from common/sfmt/SFMT-params19937.h rename to libcockatrice_rng/libcockatrice/rng/sfmt/SFMT-params19937.h diff --git a/common/sfmt/SFMT.c b/libcockatrice_rng/libcockatrice/rng/sfmt/SFMT.c similarity index 100% rename from common/sfmt/SFMT.c rename to libcockatrice_rng/libcockatrice/rng/sfmt/SFMT.c diff --git a/common/sfmt/SFMT.h b/libcockatrice_rng/libcockatrice/rng/sfmt/SFMT.h similarity index 100% rename from common/sfmt/SFMT.h rename to libcockatrice_rng/libcockatrice/rng/sfmt/SFMT.h diff --git a/libcockatrice_settings/CMakeLists.txt b/libcockatrice_settings/CMakeLists.txt new file mode 100644 index 000000000..bacb397bf --- /dev/null +++ b/libcockatrice_settings/CMakeLists.txt @@ -0,0 +1,53 @@ +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTORCC ON) + +set(HEADERS + libcockatrice/settings/cache_settings.h + libcockatrice/settings/card_counter_settings.h + libcockatrice/settings/card_database_settings.h + libcockatrice/settings/card_override_settings.h + libcockatrice/settings/debug_settings.h + libcockatrice/settings/download_settings.h + libcockatrice/settings/game_filters_settings.h + libcockatrice/settings/layouts_settings.h + libcockatrice/settings/message_settings.h + libcockatrice/settings/recents_settings.h + libcockatrice/settings/servers_settings.h + libcockatrice/settings/settings_manager.h + libcockatrice/settings/shortcut_treeview.h + libcockatrice/settings/shortcuts_settings.h +) + +if(Qt6_FOUND) + qt6_wrap_cpp(MOC_SOURCES ${HEADERS}) +elseif(Qt5_FOUND) + qt5_wrap_cpp(MOC_SOURCES ${HEADERS}) +endif() + +add_library( + libcockatrice_settings STATIC + ${MOC_SOURCES} + libcockatrice/settings/cache_settings.cpp + libcockatrice/settings/card_counter_settings.cpp + libcockatrice/settings/card_database_settings.cpp + libcockatrice/settings/card_override_settings.cpp + libcockatrice/settings/debug_settings.cpp + libcockatrice/settings/download_settings.cpp + libcockatrice/settings/game_filters_settings.cpp + libcockatrice/settings/layouts_settings.cpp + libcockatrice/settings/message_settings.cpp + libcockatrice/settings/recents_settings.cpp + libcockatrice/settings/servers_settings.cpp + libcockatrice/settings/settings_manager.cpp + libcockatrice/settings/shortcut_treeview.cpp + libcockatrice/settings/shortcuts_settings.cpp +) + +target_include_directories( + libcockatrice_settings + PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} + PUBLIC ${CMAKE_SOURCE_DIR}/cockatrice/src/client/network +) + +target_link_libraries(libcockatrice_settings PUBLIC libcockatrice_utility ${COCKATRICE_QT_MODULES}) diff --git a/cockatrice/src/settings/cache_settings.cpp b/libcockatrice_settings/libcockatrice/settings/cache_settings.cpp similarity index 99% rename from cockatrice/src/settings/cache_settings.cpp rename to libcockatrice_settings/libcockatrice/settings/cache_settings.cpp index 942881958..65b410daf 100644 --- a/cockatrice/src/settings/cache_settings.cpp +++ b/libcockatrice_settings/libcockatrice/settings/cache_settings.cpp @@ -1,8 +1,8 @@ #include "cache_settings.h" -#include "../client/network/release_channel.h" #include "card_counter_settings.h" #include "card_override_settings.h" +#include "release_channel.h" #include #include diff --git a/cockatrice/src/settings/cache_settings.h b/libcockatrice_settings/libcockatrice/settings/cache_settings.h similarity index 99% rename from cockatrice/src/settings/cache_settings.h rename to libcockatrice_settings/libcockatrice/settings/cache_settings.h index 93cd5a837..90eba0cb1 100644 --- a/cockatrice/src/settings/cache_settings.h +++ b/libcockatrice_settings/libcockatrice/settings/cache_settings.h @@ -7,7 +7,6 @@ #ifndef SETTINGSCACHE_H #define SETTINGSCACHE_H -#include "../utility/macros.h" #include "card_database_settings.h" #include "card_override_settings.h" #include "debug_settings.h" @@ -24,6 +23,7 @@ #include #include #include +#include inline Q_LOGGING_CATEGORY(SettingsCacheLog, "settings_cache"); diff --git a/cockatrice/src/settings/card_counter_settings.cpp b/libcockatrice_settings/libcockatrice/settings/card_counter_settings.cpp similarity index 100% rename from cockatrice/src/settings/card_counter_settings.cpp rename to libcockatrice_settings/libcockatrice/settings/card_counter_settings.cpp diff --git a/cockatrice/src/settings/card_counter_settings.h b/libcockatrice_settings/libcockatrice/settings/card_counter_settings.h similarity index 100% rename from cockatrice/src/settings/card_counter_settings.h rename to libcockatrice_settings/libcockatrice/settings/card_counter_settings.h diff --git a/cockatrice/src/settings/card_database_settings.cpp b/libcockatrice_settings/libcockatrice/settings/card_database_settings.cpp similarity index 100% rename from cockatrice/src/settings/card_database_settings.cpp rename to libcockatrice_settings/libcockatrice/settings/card_database_settings.cpp diff --git a/cockatrice/src/settings/card_database_settings.h b/libcockatrice_settings/libcockatrice/settings/card_database_settings.h similarity index 100% rename from cockatrice/src/settings/card_database_settings.h rename to libcockatrice_settings/libcockatrice/settings/card_database_settings.h diff --git a/cockatrice/src/settings/card_override_settings.cpp b/libcockatrice_settings/libcockatrice/settings/card_override_settings.cpp similarity index 100% rename from cockatrice/src/settings/card_override_settings.cpp rename to libcockatrice_settings/libcockatrice/settings/card_override_settings.cpp diff --git a/cockatrice/src/settings/card_override_settings.h b/libcockatrice_settings/libcockatrice/settings/card_override_settings.h similarity index 94% rename from cockatrice/src/settings/card_override_settings.h rename to libcockatrice_settings/libcockatrice/settings/card_override_settings.h index 90a1a1681..d5ee0287b 100644 --- a/cockatrice/src/settings/card_override_settings.h +++ b/libcockatrice_settings/libcockatrice/settings/card_override_settings.h @@ -7,10 +7,10 @@ #ifndef COCKATRICE_CARD_OVERRIDE_SETTINGS_H #define COCKATRICE_CARD_OVERRIDE_SETTINGS_H -#include "../common/card_ref.h" #include "settings_manager.h" #include +#include class CardOverrideSettings : public SettingsManager { diff --git a/cockatrice/src/settings/debug_settings.cpp b/libcockatrice_settings/libcockatrice/settings/debug_settings.cpp similarity index 100% rename from cockatrice/src/settings/debug_settings.cpp rename to libcockatrice_settings/libcockatrice/settings/debug_settings.cpp diff --git a/cockatrice/src/settings/debug_settings.h b/libcockatrice_settings/libcockatrice/settings/debug_settings.h similarity index 100% rename from cockatrice/src/settings/debug_settings.h rename to libcockatrice_settings/libcockatrice/settings/debug_settings.h diff --git a/cockatrice/src/settings/download_settings.cpp b/libcockatrice_settings/libcockatrice/settings/download_settings.cpp similarity index 100% rename from cockatrice/src/settings/download_settings.cpp rename to libcockatrice_settings/libcockatrice/settings/download_settings.cpp diff --git a/cockatrice/src/settings/download_settings.h b/libcockatrice_settings/libcockatrice/settings/download_settings.h similarity index 100% rename from cockatrice/src/settings/download_settings.h rename to libcockatrice_settings/libcockatrice/settings/download_settings.h diff --git a/cockatrice/src/settings/game_filters_settings.cpp b/libcockatrice_settings/libcockatrice/settings/game_filters_settings.cpp similarity index 100% rename from cockatrice/src/settings/game_filters_settings.cpp rename to libcockatrice_settings/libcockatrice/settings/game_filters_settings.cpp diff --git a/cockatrice/src/settings/game_filters_settings.h b/libcockatrice_settings/libcockatrice/settings/game_filters_settings.h similarity index 100% rename from cockatrice/src/settings/game_filters_settings.h rename to libcockatrice_settings/libcockatrice/settings/game_filters_settings.h diff --git a/cockatrice/src/settings/layouts_settings.cpp b/libcockatrice_settings/libcockatrice/settings/layouts_settings.cpp similarity index 100% rename from cockatrice/src/settings/layouts_settings.cpp rename to libcockatrice_settings/libcockatrice/settings/layouts_settings.cpp diff --git a/cockatrice/src/settings/layouts_settings.h b/libcockatrice_settings/libcockatrice/settings/layouts_settings.h similarity index 100% rename from cockatrice/src/settings/layouts_settings.h rename to libcockatrice_settings/libcockatrice/settings/layouts_settings.h diff --git a/cockatrice/src/settings/message_settings.cpp b/libcockatrice_settings/libcockatrice/settings/message_settings.cpp similarity index 100% rename from cockatrice/src/settings/message_settings.cpp rename to libcockatrice_settings/libcockatrice/settings/message_settings.cpp diff --git a/cockatrice/src/settings/message_settings.h b/libcockatrice_settings/libcockatrice/settings/message_settings.h similarity index 100% rename from cockatrice/src/settings/message_settings.h rename to libcockatrice_settings/libcockatrice/settings/message_settings.h diff --git a/cockatrice/src/settings/recents_settings.cpp b/libcockatrice_settings/libcockatrice/settings/recents_settings.cpp similarity index 100% rename from cockatrice/src/settings/recents_settings.cpp rename to libcockatrice_settings/libcockatrice/settings/recents_settings.cpp diff --git a/cockatrice/src/settings/recents_settings.h b/libcockatrice_settings/libcockatrice/settings/recents_settings.h similarity index 100% rename from cockatrice/src/settings/recents_settings.h rename to libcockatrice_settings/libcockatrice/settings/recents_settings.h diff --git a/cockatrice/src/settings/servers_settings.cpp b/libcockatrice_settings/libcockatrice/settings/servers_settings.cpp similarity index 100% rename from cockatrice/src/settings/servers_settings.cpp rename to libcockatrice_settings/libcockatrice/settings/servers_settings.cpp diff --git a/cockatrice/src/settings/servers_settings.h b/libcockatrice_settings/libcockatrice/settings/servers_settings.h similarity index 100% rename from cockatrice/src/settings/servers_settings.h rename to libcockatrice_settings/libcockatrice/settings/servers_settings.h diff --git a/cockatrice/src/settings/settings_manager.cpp b/libcockatrice_settings/libcockatrice/settings/settings_manager.cpp similarity index 100% rename from cockatrice/src/settings/settings_manager.cpp rename to libcockatrice_settings/libcockatrice/settings/settings_manager.cpp diff --git a/cockatrice/src/settings/settings_manager.h b/libcockatrice_settings/libcockatrice/settings/settings_manager.h similarity index 100% rename from cockatrice/src/settings/settings_manager.h rename to libcockatrice_settings/libcockatrice/settings/settings_manager.h diff --git a/cockatrice/src/settings/shortcut_treeview.cpp b/libcockatrice_settings/libcockatrice/settings/shortcut_treeview.cpp similarity index 100% rename from cockatrice/src/settings/shortcut_treeview.cpp rename to libcockatrice_settings/libcockatrice/settings/shortcut_treeview.cpp diff --git a/cockatrice/src/settings/shortcut_treeview.h b/libcockatrice_settings/libcockatrice/settings/shortcut_treeview.h similarity index 100% rename from cockatrice/src/settings/shortcut_treeview.h rename to libcockatrice_settings/libcockatrice/settings/shortcut_treeview.h diff --git a/cockatrice/src/settings/shortcuts_settings.cpp b/libcockatrice_settings/libcockatrice/settings/shortcuts_settings.cpp similarity index 100% rename from cockatrice/src/settings/shortcuts_settings.cpp rename to libcockatrice_settings/libcockatrice/settings/shortcuts_settings.cpp diff --git a/cockatrice/src/settings/shortcuts_settings.h b/libcockatrice_settings/libcockatrice/settings/shortcuts_settings.h similarity index 100% rename from cockatrice/src/settings/shortcuts_settings.h rename to libcockatrice_settings/libcockatrice/settings/shortcuts_settings.h diff --git a/libcockatrice_utility/CMakeLists.txt b/libcockatrice_utility/CMakeLists.txt new file mode 100644 index 000000000..f1e1d4a62 --- /dev/null +++ b/libcockatrice_utility/CMakeLists.txt @@ -0,0 +1,32 @@ +cmake_minimum_required(VERSION 3.16) +project(Utility VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTORCC ON) + +set(UTILITY_SOURCES + libcockatrice/utility/expression.cpp libcockatrice/utility/key_signals.cpp libcockatrice/utility/levenshtein.cpp + libcockatrice/utility/logger.cpp libcockatrice/utility/passwordhasher.cpp +) + +set(UTILITY_HEADERS + libcockatrice/utility/color.h + libcockatrice/utility/expression.h + libcockatrice/utility/key_signals.h + libcockatrice/utility/levenshtein.h + libcockatrice/utility/logger.h + libcockatrice/utility/macros.h + libcockatrice/utility/passwordhasher.h + libcockatrice/utility/trice_limits.h +) + +add_library(libcockatrice_utility STATIC ${UTILITY_SOURCES} ${UTILITY_HEADERS}) + +target_include_directories(libcockatrice_utility PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) + +target_link_libraries(libcockatrice_utility PUBLIC libcockatrice_rng ${COCKATRICE_QT_MODULES}) + +set(ORACLE_LIBS) + +include_directories(${${COCKATRICE_QT_VERSION_NAME}Core_INCLUDE_DIRS}) diff --git a/common/card_ref.h b/libcockatrice_utility/libcockatrice/utility/card_ref.h similarity index 100% rename from common/card_ref.h rename to libcockatrice_utility/libcockatrice/utility/card_ref.h diff --git a/common/color.h b/libcockatrice_utility/libcockatrice/utility/color.h similarity index 91% rename from common/color.h rename to libcockatrice_utility/libcockatrice/utility/color.h index 1ea3e33df..164c6ffd7 100644 --- a/common/color.h +++ b/libcockatrice_utility/libcockatrice/utility/color.h @@ -5,7 +5,7 @@ #include #endif -#include "pb/color.pb.h" +#include #ifdef QT_GUI_LIB inline QColor convertColorToQColor(const color &c) diff --git a/common/expression.cpp b/libcockatrice_utility/libcockatrice/utility/expression.cpp similarity index 99% rename from common/expression.cpp rename to libcockatrice_utility/libcockatrice/utility/expression.cpp index 9cb40ea3c..3b2e815d1 100644 --- a/common/expression.cpp +++ b/libcockatrice_utility/libcockatrice/utility/expression.cpp @@ -1,6 +1,6 @@ #include "expression.h" -#include "./lib/peglib.h" +#include "peglib.h" #include #include diff --git a/common/expression.h b/libcockatrice_utility/libcockatrice/utility/expression.h similarity index 100% rename from common/expression.h rename to libcockatrice_utility/libcockatrice/utility/expression.h diff --git a/cockatrice/src/utility/key_signals.cpp b/libcockatrice_utility/libcockatrice/utility/key_signals.cpp similarity index 100% rename from cockatrice/src/utility/key_signals.cpp rename to libcockatrice_utility/libcockatrice/utility/key_signals.cpp diff --git a/cockatrice/src/utility/key_signals.h b/libcockatrice_utility/libcockatrice/utility/key_signals.h similarity index 100% rename from cockatrice/src/utility/key_signals.h rename to libcockatrice_utility/libcockatrice/utility/key_signals.h diff --git a/cockatrice/src/utility/levenshtein.cpp b/libcockatrice_utility/libcockatrice/utility/levenshtein.cpp similarity index 100% rename from cockatrice/src/utility/levenshtein.cpp rename to libcockatrice_utility/libcockatrice/utility/levenshtein.cpp diff --git a/cockatrice/src/utility/levenshtein.h b/libcockatrice_utility/libcockatrice/utility/levenshtein.h similarity index 100% rename from cockatrice/src/utility/levenshtein.h rename to libcockatrice_utility/libcockatrice/utility/levenshtein.h diff --git a/cockatrice/src/utility/logger.cpp b/libcockatrice_utility/libcockatrice/utility/logger.cpp similarity index 100% rename from cockatrice/src/utility/logger.cpp rename to libcockatrice_utility/libcockatrice/utility/logger.cpp diff --git a/cockatrice/src/utility/logger.h b/libcockatrice_utility/libcockatrice/utility/logger.h similarity index 100% rename from cockatrice/src/utility/logger.h rename to libcockatrice_utility/libcockatrice/utility/logger.h diff --git a/cockatrice/src/utility/macros.h b/libcockatrice_utility/libcockatrice/utility/macros.h similarity index 100% rename from cockatrice/src/utility/macros.h rename to libcockatrice_utility/libcockatrice/utility/macros.h diff --git a/common/passwordhasher.cpp b/libcockatrice_utility/libcockatrice/utility/passwordhasher.cpp similarity index 96% rename from common/passwordhasher.cpp rename to libcockatrice_utility/libcockatrice/utility/passwordhasher.cpp index bc5f072e8..c40c5f94f 100644 --- a/common/passwordhasher.cpp +++ b/libcockatrice_utility/libcockatrice/utility/passwordhasher.cpp @@ -1,8 +1,7 @@ #include "passwordhasher.h" -#include "rng_sfmt.h" - #include +#include QString PasswordHasher::computeHash(const QString &password, const QString &salt) { diff --git a/common/passwordhasher.h b/libcockatrice_utility/libcockatrice/utility/passwordhasher.h similarity index 100% rename from common/passwordhasher.h rename to libcockatrice_utility/libcockatrice/utility/passwordhasher.h diff --git a/common/lib/peglib.h b/libcockatrice_utility/libcockatrice/utility/peglib.h similarity index 100% rename from common/lib/peglib.h rename to libcockatrice_utility/libcockatrice/utility/peglib.h diff --git a/common/trice_limits.h b/libcockatrice_utility/libcockatrice/utility/trice_limits.h similarity index 100% rename from common/trice_limits.h rename to libcockatrice_utility/libcockatrice/utility/trice_limits.h diff --git a/oracle/CMakeLists.txt b/oracle/CMakeLists.txt index 63b1974e4..a67632022 100644 --- a/oracle/CMakeLists.txt +++ b/oracle/CMakeLists.txt @@ -1,15 +1,21 @@ -# CMakeLists for oracle directory -# -# provides the oracle binary - +cmake_minimum_required(VERSION 3.16) project(Oracle VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") -# paths +# ------------------------ +# Paths and directories +# ------------------------ set(DESKTOPDIR share/applications CACHE STRING "path to .desktop files" ) +set(ORACLE_MAC_QM_INSTALL_DIR "oracle.app/Contents/Resources/translations") +set(ORACLE_UNIX_QM_INSTALL_DIR "share/oracle/translations") +set(ORACLE_WIN32_QM_INSTALL_DIR "translations") + +# ------------------------ +# Sources +# ------------------------ set(oracle_SOURCES src/main.cpp src/oraclewizard.cpp @@ -17,34 +23,16 @@ set(oracle_SOURCES src/pagetemplates.cpp src/parsehelpers.cpp src/qt-json/json.cpp - ../cockatrice/src/card/card_info.cpp - ../cockatrice/src/card/card_relation.cpp - ../cockatrice/src/card/card_set.cpp - ../cockatrice/src/card/printing_info.cpp ../cockatrice/src/client/network/release_channel.cpp - ../cockatrice/src/database/parser/card_database_parser.cpp - ../cockatrice/src/database/parser/cockatrice_xml_3.cpp - ../cockatrice/src/database/parser/cockatrice_xml_4.cpp ../cockatrice/src/interface/theme_manager.cpp ../cockatrice/src/interface/widgets/quick_settings/settings_button_widget.cpp ../cockatrice/src/interface/widgets/quick_settings/settings_popup_widget.cpp - ../cockatrice/src/settings/cache_settings.cpp - ../cockatrice/src/settings/card_counter_settings.cpp - ../cockatrice/src/settings/card_database_settings.cpp - ../cockatrice/src/settings/card_override_settings.cpp - ../cockatrice/src/settings/debug_settings.cpp - ../cockatrice/src/settings/download_settings.cpp - ../cockatrice/src/settings/game_filters_settings.cpp - ../cockatrice/src/settings/layouts_settings.cpp - ../cockatrice/src/settings/message_settings.cpp - ../cockatrice/src/settings/recents_settings.cpp - ../cockatrice/src/settings/servers_settings.cpp - ../cockatrice/src/settings/settings_manager.cpp - ../cockatrice/src/settings/shortcuts_settings.cpp ${VERSION_STRING_CPP} ) -set(oracle_RESOURCES oracle.qrc) +# ------------------------ +# Translations +# ------------------------ if(UPDATE_TRANSLATIONS) file(GLOB_RECURSE translate_oracle_SRCS src/*.cpp src/*.h ../cockatrice/src/settingscache.cpp) @@ -66,37 +54,49 @@ if(APPLE) set(oracle_SOURCES ${oracle_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/resources/appicon.icns) endif(APPLE) +set(oracle_RESOURCES oracle.qrc) + +# ------------------------ +# Qt resources +# ------------------------ if(Qt6_FOUND) qt6_add_resources(oracle_RESOURCES_RCC ${oracle_RESOURCES}) elseif(Qt5_FOUND) qt5_add_resources(oracle_RESOURCES_RCC ${oracle_RESOURCES}) endif() +# ------------------------ +# Include directories +# ------------------------ include_directories(../cockatrice/src) -include_directories(../common) -# Libz is required to support zipped files +# ------------------------ +# Optional libraries +# ------------------------ +# ZLIB find_package(ZLIB) if(ZLIB_FOUND) include_directories(${ZLIB_INCLUDE_DIRS}) add_definitions("-DHAS_ZLIB") - - set(oracle_SOURCES ${oracle_SOURCES} src/zip/unzip.cpp src/zip/zipglobal.cpp) + list(APPEND oracle_SOURCES src/zip/unzip.cpp src/zip/zipglobal.cpp) else() message(STATUS "Oracle: zlib not found; ZIP support disabled") endif() -# LibLZMA is required to support xz files +# LZMA find_package(LibLZMA) if(LIBLZMA_FOUND) include_directories(${LIBLZMA_INCLUDE_DIRS}) add_definitions("-DHAS_LZMA") - - set(oracle_SOURCES ${oracle_SOURCES} src/lzma/decompress.cpp) + list(APPEND oracle_SOURCES src/lzma/decompress.cpp) else() message(STATUS "Oracle: LibLZMA not found; xz support disabled") endif() +# ------------------------ +# Build executable +# ------------------------ + set(ORACLE_MAC_QM_INSTALL_DIR "oracle.app/Contents/Resources/translations") set(ORACLE_UNIX_QM_INSTALL_DIR "share/oracle/translations") set(ORACLE_WIN32_QM_INSTALL_DIR "translations") @@ -133,7 +133,15 @@ elseif(Qt5_FOUND) endif() endif() -target_link_libraries(oracle PUBLIC ${ORACLE_QT_MODULES}) +# ------------------------ +# Link libraries +# ------------------------ +target_link_libraries( + oracle + PUBLIC libcockatrice_card + PUBLIC libcockatrice_settings + PUBLIC ${ORACLE_QT_MODULES} +) if(ZLIB_FOUND) target_link_libraries(oracle PUBLIC ${ZLIB_LIBRARIES}) @@ -143,6 +151,9 @@ if(LIBLZMA_FOUND) target_link_libraries(oracle PUBLIC ${LIBLZMA_LIBRARIES}) endif() +# ------------------------ +# Install rules +# ------------------------ if(UNIX) if(APPLE) set(MACOSX_BUNDLE_INFO_STRING "${PROJECT_NAME}") @@ -168,6 +179,9 @@ if(NOT WIN32 AND NOT APPLE) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/oracle.desktop DESTINATION ${DESKTOPDIR}) endif(NOT WIN32 AND NOT APPLE) +# ------------------------ +# Qt plugin handling +# ------------------------ if(APPLE) # these needs to be relative to CMAKE_INSTALL_PREFIX set(plugin_dest_dir oracle.app/Contents/Plugins) @@ -262,6 +276,9 @@ Translations = Resources/translations\") ) endif() +# ------------------------ +# Qt translations +# ------------------------ if(Qt6_FOUND AND Qt6LinguistTools_FOUND) #Qt6 Translations happen after the executable is built up if(UPDATE_TRANSLATIONS) diff --git a/oracle/src/main.cpp b/oracle/src/main.cpp index f2930f975..3215f1d44 100644 --- a/oracle/src/main.cpp +++ b/oracle/src/main.cpp @@ -2,7 +2,6 @@ #include "interface/theme_manager.h" #include "oraclewizard.h" -#include "settings/cache_settings.h" #include #include @@ -10,6 +9,7 @@ #include #include #include +#include QTranslator *translator, *qtTranslator; ThemeManager *themeManager; diff --git a/oracle/src/oracleimporter.cpp b/oracle/src/oracleimporter.cpp index 0c53c4ad9..6669238ae 100644 --- a/oracle/src/oracleimporter.cpp +++ b/oracle/src/oracleimporter.cpp @@ -1,14 +1,14 @@ #include "oracleimporter.h" -#include "database/parser/cockatrice_xml_4.h" #include "parsehelpers.h" #include "qt-json/json.h" #include #include #include -#include #include +#include +#include SplitCardPart::SplitCardPart(const QString &_name, const QString &_text, diff --git a/oracle/src/oracleimporter.h b/oracle/src/oracleimporter.h index 5f40af9ba..3ec6da6e1 100644 --- a/oracle/src/oracleimporter.h +++ b/oracle/src/oracleimporter.h @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include // many users prefer not to see these sets with non english arts diff --git a/oracle/src/oraclewizard.cpp b/oracle/src/oraclewizard.cpp index 0fdd4b8f1..eeadfb8be 100644 --- a/oracle/src/oraclewizard.cpp +++ b/oracle/src/oraclewizard.cpp @@ -2,7 +2,6 @@ #include "main.h" #include "oracleimporter.h" -#include "settings/cache_settings.h" #include "version_string.h" #include @@ -25,6 +24,7 @@ #include #include #include +#include #ifdef HAS_LZMA #include "lzma/decompress.h" diff --git a/servatrice/CMakeLists.txt b/servatrice/CMakeLists.txt index 2b345362a..6e4191beb 100644 --- a/servatrice/CMakeLists.txt +++ b/servatrice/CMakeLists.txt @@ -96,19 +96,18 @@ set(DESKTOPDIR CACHE STRING "desktop file destination" ) -# Include directories -include_directories(../common) -include_directories(${PROTOBUF_INCLUDE_DIR}) -include_directories(${CMAKE_CURRENT_BINARY_DIR}/../common) -include_directories(${CMAKE_CURRENT_BINARY_DIR}) - # Build servatrice binary and link it add_executable(servatrice MACOSX_BUNDLE ${servatrice_MOC_SRCS} ${servatrice_RESOURCES_RCC} ${servatrice_SOURCES}) if(CMAKE_HOST_SYSTEM MATCHES "FreeBSD") - target_link_libraries(servatrice cockatrice_common Threads::Threads ${SERVATRICE_QT_MODULES} ${LIBEXECINFO_LIBRARY}) + target_link_libraries( + servatrice libcockatrice_deck_list libcockatrice_network_server_remote Threads::Threads ${SERVATRICE_QT_MODULES} + ${LIBEXECINFO_LIBRARY} + ) else() - target_link_libraries(servatrice cockatrice_common Threads::Threads ${SERVATRICE_QT_MODULES}) + target_link_libraries( + servatrice libcockatrice_deck_list libcockatrice_network_server_remote Threads::Threads ${SERVATRICE_QT_MODULES} + ) endif() # install rules diff --git a/servatrice/src/isl_interface.cpp b/servatrice/src/isl_interface.cpp index 0c13bcd0f..2269ff314 100644 --- a/servatrice/src/isl_interface.cpp +++ b/servatrice/src/isl_interface.cpp @@ -1,25 +1,25 @@ #include "isl_interface.h" -#include "debug_pb_message.h" -#include "get_pb_extension.h" #include "main.h" -#include "pb/event_game_joined.pb.h" -#include "pb/event_join_room.pb.h" -#include "pb/event_leave_room.pb.h" -#include "pb/event_list_games.pb.h" -#include "pb/event_remove_messages.pb.h" -#include "pb/event_room_say.pb.h" -#include "pb/event_server_complete_list.pb.h" -#include "pb/event_user_joined.pb.h" -#include "pb/event_user_left.pb.h" -#include "pb/event_user_message.pb.h" -#include "pb/isl_message.pb.h" -#include "server/server_protocolhandler.h" -#include "server/server_room.h" #include "server_logger.h" #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include void IslInterface::sharedCtor(const QSslCertificate &cert, const QSslKey &privateKey) { diff --git a/servatrice/src/isl_interface.h b/servatrice/src/isl_interface.h index 19310e07b..27e5b8293 100644 --- a/servatrice/src/isl_interface.h +++ b/servatrice/src/isl_interface.h @@ -1,13 +1,13 @@ #ifndef ISL_INTERFACE_H #define ISL_INTERFACE_H -#include "pb/serverinfo_game.pb.h" -#include "pb/serverinfo_room.pb.h" -#include "pb/serverinfo_user.pb.h" #include "servatrice.h" #include #include +#include +#include +#include class Servatrice; class QSslSocket; diff --git a/servatrice/src/main.cpp b/servatrice/src/main.cpp index c8950d973..b1294a04c 100644 --- a/servatrice/src/main.cpp +++ b/servatrice/src/main.cpp @@ -18,8 +18,6 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include "passwordhasher.h" -#include "rng_sfmt.h" #include "servatrice.h" #include "server_logger.h" #include "settingscache.h" @@ -34,6 +32,8 @@ #include #include #include +#include +#include RNG_Abstract *rng; ServerLogger *logger; diff --git a/servatrice/src/servatrice.cpp b/servatrice/src/servatrice.cpp index e1288a627..ea3d783bd 100644 --- a/servatrice/src/servatrice.cpp +++ b/servatrice/src/servatrice.cpp @@ -19,17 +19,11 @@ ***************************************************************************/ #include "servatrice.h" -#include "deck_list.h" #include "email_parser.h" -#include "featureset.h" #include "isl_interface.h" #include "main.h" -#include "pb/event_connection_closed.pb.h" -#include "pb/event_server_message.pb.h" -#include "pb/event_server_shutdown.pb.h" #include "servatrice_connection_pool.h" #include "servatrice_database_interface.h" -#include "server/server_room.h" #include "server_logger.h" #include "serversocketinterface.h" #include "settingscache.h" @@ -45,6 +39,12 @@ #include #include #include +#include +#include +#include +#include +#include +#include Servatrice_GameServer::Servatrice_GameServer(Servatrice *_server, int _numberPools, diff --git a/servatrice/src/servatrice.h b/servatrice/src/servatrice.h index c68327c60..62fb382cb 100644 --- a/servatrice/src/servatrice.h +++ b/servatrice/src/servatrice.h @@ -20,8 +20,6 @@ #ifndef SERVATRICE_H #define SERVATRICE_H -#include "server/server.h" - #include #include #include @@ -31,6 +29,7 @@ #include #include #include +#include #include Q_DECLARE_METATYPE(QSqlDatabase) diff --git a/servatrice/src/servatrice_database_interface.cpp b/servatrice/src/servatrice_database_interface.cpp index 289059846..bad16bec3 100644 --- a/servatrice/src/servatrice_database_interface.cpp +++ b/servatrice/src/servatrice_database_interface.cpp @@ -1,8 +1,5 @@ #include "servatrice_database_interface.h" -#include "deck_list.h" -#include "passwordhasher.h" -#include "pb/game_replay.pb.h" #include "servatrice.h" #include "serversocketinterface.h" #include "settingscache.h" @@ -12,6 +9,9 @@ #include #include #include +#include +#include +#include Servatrice_DatabaseInterface::Servatrice_DatabaseInterface(int _instanceId, Servatrice *_server) : instanceId(_instanceId), sqlDatabase(QSqlDatabase()), server(_server) diff --git a/servatrice/src/servatrice_database_interface.h b/servatrice/src/servatrice_database_interface.h index 9eb492953..be1d1ff19 100644 --- a/servatrice/src/servatrice_database_interface.h +++ b/servatrice/src/servatrice_database_interface.h @@ -1,13 +1,12 @@ #ifndef SERVATRICE_DATABASE_INTERFACE_H #define SERVATRICE_DATABASE_INTERFACE_H -#include "server/server.h" -#include "server/server_database_interface.h" - #include #include #include #include +#include +#include #define DATABASE_SCHEMA_VERSION 34 diff --git a/servatrice/src/serversocketinterface.cpp b/servatrice/src/serversocketinterface.cpp index 9b08ee330..4b33aad12 100644 --- a/servatrice/src/serversocketinterface.cpp +++ b/servatrice/src/serversocketinterface.cpp @@ -20,57 +20,12 @@ #include "serversocketinterface.h" -#include "deck_list.h" #include "email_parser.h" #include "main.h" -#include "pb/command_deck_del.pb.h" -#include "pb/command_deck_del_dir.pb.h" -#include "pb/command_deck_download.pb.h" -#include "pb/command_deck_list.pb.h" -#include "pb/command_deck_new_dir.pb.h" -#include "pb/command_deck_upload.pb.h" -#include "pb/command_replay_delete_match.pb.h" -#include "pb/command_replay_download.pb.h" -#include "pb/command_replay_get_code.pb.h" -#include "pb/command_replay_list.pb.h" -#include "pb/command_replay_modify_match.pb.h" -#include "pb/command_replay_submit_code.pb.h" -#include "pb/commands.pb.h" -#include "pb/event_add_to_list.pb.h" -#include "pb/event_connection_closed.pb.h" -#include "pb/event_notify_user.pb.h" -#include "pb/event_remove_from_list.pb.h" -#include "pb/event_replay_added.pb.h" -#include "pb/event_server_identification.pb.h" -#include "pb/event_server_message.pb.h" -#include "pb/event_user_message.pb.h" -#include "pb/response_ban_history.pb.h" -#include "pb/response_deck_download.pb.h" -#include "pb/response_deck_list.pb.h" -#include "pb/response_deck_upload.pb.h" -#include "pb/response_forgotpasswordrequest.pb.h" -#include "pb/response_get_admin_notes.pb.h" -#include "pb/response_password_salt.pb.h" -#include "pb/response_register.pb.h" -#include "pb/response_replay_download.pb.h" -#include "pb/response_replay_get_code.pb.h" -#include "pb/response_replay_list.pb.h" -#include "pb/response_viewlog_history.pb.h" -#include "pb/response_warn_history.pb.h" -#include "pb/response_warn_list.pb.h" -#include "pb/serverinfo_ban.pb.h" -#include "pb/serverinfo_chat_message.pb.h" -#include "pb/serverinfo_deckstorage.pb.h" -#include "pb/serverinfo_replay.pb.h" -#include "pb/serverinfo_user.pb.h" #include "servatrice.h" #include "servatrice_database_interface.h" -#include "server/game/server_player.h" -#include "server/server_response_containers.h" -#include "server/server_room.h" #include "server_logger.h" #include "settingscache.h" -#include "trice_limits.h" #include "version_string.h" #include @@ -80,7 +35,52 @@ #include #include #include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include static const int protocolVersion = 14; diff --git a/servatrice/src/serversocketinterface.h b/servatrice/src/serversocketinterface.h index 9f15e62b8..edf3d9f79 100644 --- a/servatrice/src/serversocketinterface.h +++ b/servatrice/src/serversocketinterface.h @@ -20,12 +20,11 @@ #ifndef SERVERSOCKETINTERFACE_H #define SERVERSOCKETINTERFACE_H -#include "server/server_protocolhandler.h" - #include #include #include #include +#include class Servatrice; class Servatrice_DatabaseInterface; diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index f6b2d12d2..6a5eacf54 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -45,9 +45,11 @@ endif() include_directories(${GTEST_INCLUDE_DIRS}) target_link_libraries(dummy_test Threads::Threads ${GTEST_BOTH_LIBRARIES}) -target_link_libraries(expression_test cockatrice_common Threads::Threads ${GTEST_BOTH_LIBRARIES} ${TEST_QT_MODULES}) +target_link_libraries(expression_test libcockatrice_utility Threads::Threads ${GTEST_BOTH_LIBRARIES} ${TEST_QT_MODULES}) target_link_libraries(test_age_formatting Threads::Threads ${GTEST_BOTH_LIBRARIES} ${TEST_QT_MODULES}) -target_link_libraries(password_hash_test cockatrice_common Threads::Threads ${GTEST_BOTH_LIBRARIES} ${TEST_QT_MODULES}) +target_link_libraries( + password_hash_test libcockatrice_utility Threads::Threads ${GTEST_BOTH_LIBRARIES} ${TEST_QT_MODULES} +) add_subdirectory(carddatabase) add_subdirectory(loading_from_clipboard) diff --git a/tests/carddatabase/CMakeLists.txt b/tests/carddatabase/CMakeLists.txt index 913c1cc06..4030cb124 100644 --- a/tests/carddatabase/CMakeLists.txt +++ b/tests/carddatabase/CMakeLists.txt @@ -1,70 +1,63 @@ +cmake_minimum_required(VERSION 3.16) +project(CardDatabaseTests VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") + +# ------------------------ +# Definitions +# ------------------------ add_definitions("-DCARDDB_DATADIR=\"${CMAKE_CURRENT_SOURCE_DIR}/data/\"") +# ------------------------ +# Qt modules +# ------------------------ set(TEST_QT_MODULES ${COCKATRICE_QT_VERSION_NAME}::Concurrent ${COCKATRICE_QT_VERSION_NAME}::Network ${COCKATRICE_QT_VERSION_NAME}::Widgets ${COCKATRICE_QT_VERSION_NAME}::Svg ) -if(Qt6_FOUND) - qt6_wrap_cpp( - MOCKS_SOURCES ../../cockatrice/src/settings/cache_settings.h ../../cockatrice/src/settings/card_database_settings.h - ) -elseif(Qt5_FOUND) - qt5_wrap_cpp( - MOCKS_SOURCES ../../cockatrice/src/settings/cache_settings.h ../../cockatrice/src/settings/card_database_settings.h - ) -endif() +# ------------------------ +# Card Database Test +# ------------------------ +add_executable(carddatabase_test ${MOCKS_SOURCES} ${VERSION_STRING_CPP} carddatabase_test.cpp mocks.cpp) -add_executable( +target_link_libraries( carddatabase_test - ${MOCKS_SOURCES} - ${VERSION_STRING_CPP} - ../../cockatrice/src/card/card_info.cpp - ../../cockatrice/src/card/card_relation.cpp - ../../cockatrice/src/card/card_set.cpp - ../../cockatrice/src/card/card_set_list.cpp - ../../cockatrice/src/card/exact_card.cpp - ../../cockatrice/src/card/printing_info.cpp - ../../cockatrice/src/database/card_database.cpp - ../../cockatrice/src/database/card_database_loader.cpp - ../../cockatrice/src/database/card_database_querier.cpp - ../../cockatrice/src/database/parser/card_database_parser.cpp - ../../cockatrice/src/database/parser/cockatrice_xml_3.cpp - ../../cockatrice/src/database/parser/cockatrice_xml_4.cpp - ../../cockatrice/src/settings/settings_manager.cpp - carddatabase_test.cpp - mocks.cpp + PRIVATE libcockatrice_card + PRIVATE libcockatrice_settings + PRIVATE Threads::Threads + PRIVATE ${GTEST_BOTH_LIBRARIES} + PRIVATE ${TEST_QT_MODULES} ) + +add_test(NAME carddatabase_test COMMAND carddatabase_test) + +# ------------------------ +# Filter String Test +# ------------------------ add_executable( filter_string_test ${MOCKS_SOURCES} ${VERSION_STRING_CPP} - ../../cockatrice/src/card/card_info.cpp - ../../cockatrice/src/card/card_relation.cpp - ../../cockatrice/src/card/card_set.cpp - ../../cockatrice/src/card/card_set_list.cpp - ../../cockatrice/src/card/exact_card.cpp - ../../cockatrice/src/card/printing_info.cpp - ../../cockatrice/src/database/card_database.cpp - ../../cockatrice/src/database/card_database_loader.cpp - ../../cockatrice/src/database/card_database_querier.cpp - ../../cockatrice/src/database/card_database_manager.cpp - ../../cockatrice/src/database/parser/card_database_parser.cpp - ../../cockatrice/src/database/parser/cockatrice_xml_3.cpp - ../../cockatrice/src/database/parser/cockatrice_xml_4.cpp ../../cockatrice/src/filters/filter_card.cpp ../../cockatrice/src/filters/filter_string.cpp ../../cockatrice/src/filters/filter_tree.cpp - ../../cockatrice/src/settings/settings_manager.cpp filter_string_test.cpp mocks.cpp ) + +target_link_libraries( + filter_string_test + PRIVATE libcockatrice_card + PRIVATE libcockatrice_settings + PRIVATE Threads::Threads + PRIVATE ${GTEST_BOTH_LIBRARIES} + PRIVATE ${TEST_QT_MODULES} +) + +add_test(NAME filter_string_test COMMAND filter_string_test) + +# ------------------------ +# Dependencies on gtest +# ------------------------ if(NOT GTEST_FOUND) add_dependencies(carddatabase_test gtest) add_dependencies(filter_string_test gtest) endif() - -target_link_libraries(carddatabase_test cockatrice_common Threads::Threads ${GTEST_BOTH_LIBRARIES} ${TEST_QT_MODULES}) -target_link_libraries(filter_string_test cockatrice_common Threads::Threads ${GTEST_BOTH_LIBRARIES} ${TEST_QT_MODULES}) - -add_test(NAME carddatabase_test COMMAND carddatabase_test) -add_test(NAME filter_string_test COMMAND filter_string_test) diff --git a/tests/carddatabase/filter_string_test.cpp b/tests/carddatabase/filter_string_test.cpp index 3055bb76a..f18e96d0e 100644 --- a/tests/carddatabase/filter_string_test.cpp +++ b/tests/carddatabase/filter_string_test.cpp @@ -1,8 +1,8 @@ -#include "../../cockatrice/src/database/card_database_manager.h" #include "../../cockatrice/src/filters/filter_string.h" #include "mocks.h" #include "gtest/gtest.h" +#include #define QUERY(name, card, query, match) \ TEST_F(CardQuery, name) \ diff --git a/tests/carddatabase/mocks.cpp b/tests/carddatabase/mocks.cpp index 08d82d765..7d46a68c2 100644 --- a/tests/carddatabase/mocks.cpp +++ b/tests/carddatabase/mocks.cpp @@ -452,7 +452,7 @@ void SettingsCache::setRoundCardCorners(bool /* _roundCardCorners */) { } -void PictureLoader::clearPixmapCache(CardInfoPtr /* card */) +void CardPictureLoader::clearPixmapCache(CardInfoPtr /* card */) { } diff --git a/tests/carddatabase/mocks.h b/tests/carddatabase/mocks.h index 18a50155b..3a8495fb9 100644 --- a/tests/carddatabase/mocks.h +++ b/tests/carddatabase/mocks.h @@ -10,13 +10,13 @@ #define PICTURELOADER_H -#include "../../cockatrice/src/database/card_database.h" -#include "../../cockatrice/src/settings/cache_settings.h" -#include "../../cockatrice/src/utility/macros.h" +#include +#include +#include extern SettingsCache *settingsCache; -class PictureLoader +class CardPictureLoader { public: static void clearPixmapCache(CardInfoPtr card); diff --git a/tests/expression_test.cpp b/tests/expression_test.cpp index 51c4039a4..4fbe98cb9 100644 --- a/tests/expression_test.cpp +++ b/tests/expression_test.cpp @@ -1,7 +1,6 @@ -#include "../common/expression.h" - #include "gtest/gtest.h" #include +#include #define TEST_EXPR(name, a, b) \ TEST(ExpressionTest, name) \ diff --git a/tests/loading_from_clipboard/CMakeLists.txt b/tests/loading_from_clipboard/CMakeLists.txt index be8ac6374..40e85c66e 100644 --- a/tests/loading_from_clipboard/CMakeLists.txt +++ b/tests/loading_from_clipboard/CMakeLists.txt @@ -1,7 +1,5 @@ add_definitions("-DCARDDB_DATADIR=\"${CMAKE_CURRENT_SOURCE_DIR}/data/\"") -add_executable( - loading_from_clipboard_test ../../common/deck_list.cpp clipboard_testing.cpp loading_from_clipboard_test.cpp -) +add_executable(loading_from_clipboard_test clipboard_testing.cpp loading_from_clipboard_test.cpp) if(NOT GTEST_FOUND) add_dependencies(loading_from_clipboard_test gtest) @@ -12,6 +10,6 @@ set(TEST_QT_MODULES ${COCKATRICE_QT_VERSION_NAME}::Concurrent ${COCKATRICE_QT_VE ) target_link_libraries( - loading_from_clipboard_test cockatrice_common Threads::Threads ${GTEST_BOTH_LIBRARIES} ${TEST_QT_MODULES} + loading_from_clipboard_test libcockatrice_deck_list Threads::Threads ${GTEST_BOTH_LIBRARIES} ${TEST_QT_MODULES} ) add_test(NAME loading_from_clipboard_test COMMAND loading_from_clipboard_test) diff --git a/tests/loading_from_clipboard/clipboard_testing.cpp b/tests/loading_from_clipboard/clipboard_testing.cpp index 943c6a05d..df2806585 100644 --- a/tests/loading_from_clipboard/clipboard_testing.cpp +++ b/tests/loading_from_clipboard/clipboard_testing.cpp @@ -1,8 +1,7 @@ #include "clipboard_testing.h" -#include "../../common/deck_list_card_node.h" - #include +#include void testEmpty(const QString &clipboard) { diff --git a/tests/loading_from_clipboard/clipboard_testing.h b/tests/loading_from_clipboard/clipboard_testing.h index 8f1b215b8..5e9cff915 100644 --- a/tests/loading_from_clipboard/clipboard_testing.h +++ b/tests/loading_from_clipboard/clipboard_testing.h @@ -1,9 +1,8 @@ #ifndef CLIPBOARD_TESTING_H #define CLIPBOARD_TESTING_H -#include "../../common/deck_list.h" - #include "gtest/gtest.h" +#include // using std types because qt types aren't understood by gtest (without this you'll get less nice errors) using CardRows = QVector>; diff --git a/tests/oracle/CMakeLists.txt b/tests/oracle/CMakeLists.txt index 0c11eb751..b89663d6f 100644 --- a/tests/oracle/CMakeLists.txt +++ b/tests/oracle/CMakeLists.txt @@ -6,6 +6,6 @@ endif() set(TEST_QT_MODULES ${COCKATRICE_QT_VERSION_NAME}::Widgets) -target_link_libraries(parse_cipt_test cockatrice_common Threads::Threads ${GTEST_BOTH_LIBRARIES} ${TEST_QT_MODULES}) +target_link_libraries(parse_cipt_test Threads::Threads ${GTEST_BOTH_LIBRARIES} ${TEST_QT_MODULES}) add_test(NAME parse_cipt_test COMMAND parse_cipt_test) diff --git a/tests/password_hash_test.cpp b/tests/password_hash_test.cpp index 84e7c8eb1..38d9b6315 100644 --- a/tests/password_hash_test.cpp +++ b/tests/password_hash_test.cpp @@ -1,8 +1,7 @@ -#include "../common/passwordhasher.h" -#include "../common/rng_abstract.h" -#include "../common/rng_sfmt.h" - #include "gtest/gtest.h" +#include +#include +#include RNG_Abstract *rng;