mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-03 12:03:55 -07:00
Turn Card, Deck_List, Protocol, RNG, Network (Client, Server), Settings and Utility into libraries and remove cockatrice_common. (#6212)
--------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de> Co-authored-by: ebbit1q <ebbit1q@gmail.com>
This commit is contained in:
parent
be1403c920
commit
1ef07309d6
605 changed files with 3812 additions and 3408 deletions
|
|
@ -1,11 +1,10 @@
|
|||
#include "abstract_card_drag_item.h"
|
||||
|
||||
#include "../../settings/cache_settings.h"
|
||||
|
||||
#include <QCursor>
|
||||
#include <QDebug>
|
||||
#include <QGraphicsSceneMouseEvent>
|
||||
#include <QPainter>
|
||||
#include <libcockatrice/settings/cache_settings.h>
|
||||
|
||||
static const float CARD_WIDTH_HALF = CARD_WIDTH / 2;
|
||||
static const float CARD_HEIGHT_HALF = CARD_HEIGHT / 2;
|
||||
|
|
|
|||
|
|
@ -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 <QCursor>
|
||||
|
|
@ -11,6 +8,9 @@
|
|||
#include <QGraphicsSceneMouseEvent>
|
||||
#include <QPainter>
|
||||
#include <algorithm>
|
||||
#include <libcockatrice/card/card_database/card_database.h>
|
||||
#include <libcockatrice/card/card_database/card_database_manager.h>
|
||||
#include <libcockatrice/settings/cache_settings.h>
|
||||
|
||||
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 {
|
||||
|
|
|
|||
|
|
@ -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 <libcockatrice/card/card_printing/exact_card.h>
|
||||
#include <libcockatrice/utility/card_ref.h>
|
||||
|
||||
class Player;
|
||||
|
||||
const int CARD_WIDTH = 72;
|
||||
|
|
|
|||
|
|
@ -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 <QAction>
|
||||
|
|
@ -16,6 +12,10 @@
|
|||
#include <QMenu>
|
||||
#include <QPainter>
|
||||
#include <QString>
|
||||
#include <libcockatrice/protocol/pb/command_inc_counter.pb.h>
|
||||
#include <libcockatrice/protocol/pb/command_set_counter.pb.h>
|
||||
#include <libcockatrice/settings/cache_settings.h>
|
||||
#include <libcockatrice/utility/expression.h>
|
||||
|
||||
AbstractCounter::AbstractCounter(Player *_player,
|
||||
int _id,
|
||||
|
|
|
|||
|
|
@ -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 <QDebug>
|
||||
#include <QGraphicsScene>
|
||||
#include <QGraphicsSceneMouseEvent>
|
||||
#include <QPainter>
|
||||
#include <QtMath>
|
||||
#include <libcockatrice/card/card_info.h>
|
||||
#include <libcockatrice/protocol/pb/command_attach_card.pb.h>
|
||||
#include <libcockatrice/protocol/pb/command_create_arrow.pb.h>
|
||||
#include <libcockatrice/protocol/pb/command_delete_arrow.pb.h>
|
||||
#include <libcockatrice/settings/cache_settings.h>
|
||||
#include <libcockatrice/utility/color.h>
|
||||
|
||||
ArrowItem::ArrowItem(Player *_player, int _id, ArrowTarget *_startItem, ArrowTarget *_targetItem, const QColor &_color)
|
||||
: QGraphicsItem(), player(_player), id(_id), startItem(_startItem), targetItem(_targetItem), targetLocked(false),
|
||||
|
|
|
|||
|
|
@ -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 <QApplication>
|
||||
#include <QGraphicsSceneMouseEvent>
|
||||
#include <QMenu>
|
||||
#include <QPainter>
|
||||
#include <libcockatrice/card/card_info.h>
|
||||
#include <libcockatrice/protocol/pb/serverinfo_card.pb.h>
|
||||
#include <libcockatrice/settings/cache_settings.h>
|
||||
#include <libcockatrice/settings/card_counter_settings.h>
|
||||
|
||||
CardItem::CardItem(Player *_owner, QGraphicsItem *parent, const CardRef &cardRef, int _cardid, CardZoneLogic *_zone)
|
||||
: AbstractCardItem(parent, cardRef, _owner, _cardid), zone(_zone), attacking(false), destroyOnZoneChange(false),
|
||||
|
|
|
|||
|
|
@ -9,7 +9,8 @@
|
|||
|
||||
#include "../zones/logic/card_zone_logic.h"
|
||||
#include "abstract_card_item.h"
|
||||
#include "server/game/server_card.h"
|
||||
|
||||
#include <libcockatrice/network/server/remote/game/server_card.h>
|
||||
|
||||
class CardDatabase;
|
||||
class CardDragItem;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
#include "card_list.h"
|
||||
|
||||
#include "../../card/card_info.h"
|
||||
#include "card_item.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <algorithm>
|
||||
#include <libcockatrice/card/card_info.h>
|
||||
|
||||
CardList::CardList(bool _contentsKnown) : QList<CardItem *>(), contentsKnown(_contentsKnown)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue