Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
7e13352a
Commit
7e13352a
authored
May 22, 2009
by
brukie
Browse files
minor cleanups
parent
0ef00dd4
Changes
29
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/carditem.h
View file @
7e13352a
...
...
@@ -46,7 +46,7 @@ private:
public:
enum
{
Type
=
typeCard
};
int
type
()
const
{
return
Type
;
}
CardItem
(
CardDatabase
*
_db
,
const
QString
&
_name
,
int
_cardid
,
QGraphicsItem
*
parent
=
0
);
CardItem
(
CardDatabase
*
_db
,
const
QString
&
_name
=
QString
()
,
int
_cardid
=
-
1
,
QGraphicsItem
*
parent
=
0
);
~
CardItem
();
QRectF
boundingRect
()
const
;
void
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
);
...
...
cockatrice/src/cardzone.cpp
View file @
7e13352a
...
...
@@ -6,7 +6,7 @@
#include
"zoneviewzone.h"
CardZone
::
CardZone
(
Player
*
_p
,
const
QString
&
_name
,
bool
_hasCardAttr
,
bool
_isShufflable
,
QGraphicsItem
*
parent
,
bool
isView
)
:
QGraphicsItem
(
parent
),
player
(
_p
),
name
(
_name
),
cards
(
NULL
),
menu
(
NULL
),
hasCardAttr
(
_hasCardAttr
),
isShufflable
(
_isShufflable
)
:
QGraphicsItem
(
parent
),
player
(
_p
),
name
(
_name
),
cards
(
NULL
),
view
(
NULL
),
menu
(
NULL
),
hasCardAttr
(
_hasCardAttr
),
isShufflable
(
_isShufflable
)
{
if
(
!
isView
)
player
->
addZone
(
this
);
...
...
@@ -15,9 +15,7 @@ CardZone::CardZone(Player *_p, const QString &_name, bool _hasCardAttr, bool _is
CardZone
::~
CardZone
()
{
qDebug
(
QString
(
"CardZone destructor: %1"
).
arg
(
name
).
toLatin1
());
while
(
!
views
.
empty
())
delete
views
.
at
(
0
);
delete
view
;
clearContents
();
delete
cards
;
}
...
...
@@ -41,6 +39,17 @@ void CardZone::mousePressEvent(QGraphicsSceneMouseEvent *event)
event
->
ignore
();
}
void
CardZone
::
addCard
(
CardItem
*
card
,
bool
reorganize
,
int
x
,
int
y
)
{
if
(
view
)
view
->
addCard
(
new
CardItem
(
player
->
getDb
(),
card
->
getName
(),
card
->
getId
()),
reorganize
,
x
,
y
);
addCardImpl
(
card
,
x
,
y
);
if
(
reorganize
)
reorganizeCards
();
}
CardItem
*
CardZone
::
getCard
(
int
cardId
,
const
QString
&
cardName
)
{
CardItem
*
c
=
cards
->
findCard
(
cardId
,
false
);
...
...
@@ -60,13 +69,13 @@ CardItem *CardZone::takeCard(int position, int cardId, const QString &cardName)
return
NULL
;
CardItem
*
c
=
cards
->
takeAt
(
position
);
for
(
int
i
=
0
;
i
<
views
.
size
();
i
++
)
views
[
i
]
->
removeCard
(
position
);
if
(
view
)
view
->
removeCard
(
position
);
c
->
setId
(
cardId
);
c
->
setName
(
cardName
);
// if (c->getId() == -1) {
c
->
setId
(
cardId
);
c
->
setName
(
cardName
);
// }
reorganizeCards
();
return
c
;
}
...
...
@@ -82,14 +91,9 @@ void CardZone::hoverCardEvent(CardItem *card)
player
->
hoverCardEvent
(
card
);
}
void
CardZone
::
addView
(
ZoneViewZone
*
view
)
{
views
.
append
(
view
);
}
void
CardZone
::
removeView
(
ZoneViewZone
*
view
)
void
CardZone
::
setView
(
ZoneViewZone
*
_view
)
{
view
s
.
removeAt
(
views
.
indexOf
(
view
))
;
view
=
_view
;
}
void
CardZone
::
moveAllToZone
(
const
QString
&
targetZone
,
int
targetX
)
...
...
cockatrice/src/cardzone.h
View file @
7e13352a
...
...
@@ -14,11 +14,12 @@ protected:
Player
*
player
;
QString
name
;
CardList
*
cards
;
QList
<
ZoneViewZone
*
>
view
s
;
ZoneViewZone
*
view
;
QMenu
*
menu
;
bool
hasCardAttr
;
bool
isShufflable
;
void
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
);
virtual
void
addCardImpl
(
CardItem
*
card
,
int
x
,
int
y
)
=
0
;
public:
enum
{
Type
=
typeZone
};
int
type
()
const
{
return
Type
;
}
...
...
@@ -33,16 +34,15 @@ public:
QString
getName
()
const
{
return
name
;
}
Player
*
getPlayer
()
const
{
return
player
;
}
bool
contentsKnown
()
const
{
return
cards
->
getContentsKnown
();
}
CardList
*
const
getCards
()
const
{
return
cards
;
}
virtual
void
addCard
(
CardItem
*
card
,
bool
reorganize
=
true
,
int
x
=
-
1
,
int
y
=
-
1
)
=
0
;
CardList
*
getCards
()
const
{
return
cards
;
}
void
addCard
(
CardItem
*
card
,
bool
reorganize
,
int
x
,
int
y
=
-
1
);
// getCard() finds a card by id.
CardItem
*
getCard
(
int
cardId
,
const
QString
&
cardName
);
// takeCard() finds a card by position and removes it from the zone and from all of its views.
CardItem
*
takeCard
(
int
position
,
int
cardId
,
const
QString
&
cardName
);
void
setCardAttr
(
int
cardId
,
const
QString
&
aname
,
const
QString
&
avalue
);
void
hoverCardEvent
(
CardItem
*
card
);
void
addView
(
ZoneViewZone
*
view
);
void
removeView
(
ZoneViewZone
*
view
);
void
setView
(
ZoneViewZone
*
_view
);
virtual
void
reorganizeCards
()
=
0
;
void
moveAllToZone
(
const
QString
&
targetZone
,
int
targetX
);
};
...
...
cockatrice/src/game.cpp
View file @
7e13352a
...
...
@@ -95,7 +95,7 @@ Game::Game(CardDatabase *_db, Client *_client, QGraphicsScene *_scene, QMenu *_a
dlgStartGame
=
new
DlgStartGame
(
db
);
connect
(
dlgStartGame
,
SIGNAL
(
newDeckLoaded
(
const
QStringList
&
)),
client
,
SLOT
(
submitDeck
(
const
QStringList
&
)));
connect
(
dlgStartGame
,
SIGNAL
(
finished
(
int
)),
this
,
SLOT
(
readyStart
(
int
)));
connect
(
dlgStartGame
,
SIGNAL
(
finished
(
int
)),
this
,
SLOT
(
readyStart
()));
}
Game
::~
Game
()
...
...
@@ -144,10 +144,8 @@ void Game::playerListReceived(QList<ServerPlayer *> playerList)
restartGameDialog
();
}
void
Game
::
readyStart
(
int
foo
)
void
Game
::
readyStart
()
{
Q_UNUSED
(
foo
);
client
->
readyStart
();
}
...
...
cockatrice/src/game.h
View file @
7e13352a
...
...
@@ -49,7 +49,7 @@ private slots:
void
gameEvent
(
ServerEventData
*
msg
);
void
playerListReceived
(
QList
<
ServerPlayer
*>
playerList
);
void
readyStart
(
int
foo
);
void
readyStart
();
signals:
void
submitDecklist
();
void
hoverCard
(
QString
name
);
...
...
cockatrice/src/gamesmodel.cpp
View file @
7e13352a
...
...
@@ -6,12 +6,12 @@ GamesModel::~GamesModel()
cleanList
();
}
int
GamesModel
::
rowCount
(
const
QModelIndex
&
parent
)
const
int
GamesModel
::
rowCount
(
const
QModelIndex
&
/*
parent
*/
)
const
{
return
gameList
.
size
();
}
int
GamesModel
::
columnCount
(
const
QModelIndex
&
parent
)
const
int
GamesModel
::
columnCount
(
const
QModelIndex
&
/*
parent
*/
)
const
{
return
5
;
}
...
...
cockatrice/src/gravezone.cpp
View file @
7e13352a
...
...
@@ -16,10 +16,8 @@ QRectF GraveZone::boundingRect() const
return
QRectF
(
0
,
0
,
CARD_WIDTH
,
CARD_HEIGHT
);
}
void
GraveZone
::
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
)
void
GraveZone
::
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*/
*
option
*/
,
QWidget
*/
*
widget
*/
)
{
Q_UNUSED
(
option
);
Q_UNUSED
(
widget
);
painter
->
save
();
painter
->
fillRect
(
boundingRect
(),
QColor
(
"yellow"
));
...
...
@@ -33,22 +31,16 @@ void GraveZone::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
painter
->
restore
();
}
void
GraveZone
::
addCard
(
CardItem
*
card
,
bool
reorganize
,
int
x
,
int
y
)
void
GraveZone
::
addCard
Impl
(
CardItem
*
card
,
int
x
,
int
/*y*/
)
{
for
(
int
i
=
0
;
i
<
views
.
size
();
i
++
)
views
[
i
]
->
addCard
(
new
CardItem
(
player
->
getDb
(),
card
->
getName
(),
card
->
getId
()),
reorganize
,
x
,
y
);
cards
->
insert
(
x
,
card
);
card
->
setPos
(
0
,
0
);
card
->
setVisible
(
false
);
card
->
resetState
();
card
->
setParentItem
(
this
);
if
(
reorganize
)
reorganizeCards
();
}
void
GraveZone
::
handleDropEvent
(
int
cardId
,
CardZone
*
startZone
,
const
QPoint
&
dropPoint
,
bool
faceDown
)
void
GraveZone
::
handleDropEvent
(
int
cardId
,
CardZone
*
startZone
,
const
QPoint
&
/*
dropPoint
*/
,
bool
/*
faceDown
*/
)
{
player
->
client
->
moveCard
(
cardId
,
startZone
->
getName
(),
getName
(),
0
,
0
);
}
...
...
cockatrice/src/gravezone.h
View file @
7e13352a
...
...
@@ -9,13 +9,13 @@ public:
GraveZone
(
Player
*
_p
,
QGraphicsItem
*
parent
=
0
);
QRectF
boundingRect
()
const
;
void
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
);
void
addCard
(
CardItem
*
card
,
bool
reorganize
=
true
,
int
x
=
0
,
int
y
=
-
1
);
void
reorganizeCards
();
void
handleDropEvent
(
int
cardId
,
CardZone
*
startZone
,
const
QPoint
&
dropPoint
,
bool
faceDown
);
protected:
void
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
);
void
mouseMoveEvent
(
QGraphicsSceneMouseEvent
*
event
);
void
mouseReleaseEvent
(
QGraphicsSceneMouseEvent
*
event
);
void
addCardImpl
(
CardItem
*
card
,
int
x
,
int
y
);
};
#endif
cockatrice/src/handzone.cpp
View file @
7e13352a
...
...
@@ -45,10 +45,8 @@ void HandZone::reorganizeCards()
}
}
void
HandZone
::
addCard
(
CardItem
*
card
,
bool
reorganize
,
int
x
,
int
y
)
void
HandZone
::
addCard
Impl
(
CardItem
*
card
,
int
x
,
int
/*y*/
)
{
Q_UNUSED
(
y
);
if
(
x
==
-
1
)
x
=
cards
->
size
();
cards
->
insert
(
x
,
card
);
...
...
@@ -61,13 +59,9 @@ void HandZone::addCard(CardItem *card, bool reorganize, int x, int y)
card
->
resetState
();
card
->
setVisible
(
true
);
card
->
update
(
card
->
boundingRect
());
if
(
reorganize
)
reorganizeCards
();
}
void
HandZone
::
handleDropEvent
(
int
cardId
,
CardZone
*
startZone
,
const
QPoint
&
dropPoint
,
bool
faceDown
)
void
HandZone
::
handleDropEvent
(
int
cardId
,
CardZone
*
startZone
,
const
QPoint
&
/*
dropPoint
*/
,
bool
/*
faceDown
*/
)
{
Q_UNUSED
(
dropPoint
);
player
->
client
->
moveCard
(
cardId
,
startZone
->
getName
(),
getName
(),
cards
->
size
(),
0
);
}
cockatrice/src/handzone.h
View file @
7e13352a
...
...
@@ -9,9 +9,10 @@ public:
HandZone
(
Player
*
_p
,
QGraphicsItem
*
parent
=
0
);
QRectF
boundingRect
()
const
;
void
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
);
void
addCard
(
CardItem
*
card
,
bool
reorganize
=
true
,
int
x
=
-
1
,
int
y
=
-
1
);
void
reorganizeCards
();
void
handleDropEvent
(
int
cardId
,
CardZone
*
startZone
,
const
QPoint
&
dropPoint
,
bool
faceDown
);
protected:
void
addCardImpl
(
CardItem
*
card
,
int
x
,
int
y
);
};
#endif
cockatrice/src/libraryzone.cpp
View file @
7e13352a
...
...
@@ -40,11 +40,8 @@ void LibraryZone::paint(QPainter *painter, const QStyleOptionGraphicsItem *optio
painter
->
restore
();
}
void
LibraryZone
::
addCard
(
CardItem
*
card
,
bool
reorganize
,
int
x
,
int
y
)
void
LibraryZone
::
addCard
Impl
(
CardItem
*
card
,
int
x
,
int
/*y*/
)
{
for
(
int
i
=
0
;
i
<
views
.
size
();
i
++
)
views
[
i
]
->
addCard
(
new
CardItem
(
player
->
getDb
(),
card
->
getName
(),
card
->
getId
()),
reorganize
,
x
,
y
);
cards
->
insert
(
x
,
card
);
card
->
setId
(
-
1
);
card
->
setName
(
QString
());
...
...
@@ -52,12 +49,9 @@ void LibraryZone::addCard(CardItem *card, bool reorganize, int x, int y)
card
->
setVisible
(
false
);
card
->
resetState
();
card
->
setParentItem
(
this
);
if
(
reorganize
)
reorganizeCards
();
}
void
LibraryZone
::
handleDropEvent
(
int
cardId
,
CardZone
*
startZone
,
const
QPoint
&
dropPoint
,
bool
faceDown
)
void
LibraryZone
::
handleDropEvent
(
int
cardId
,
CardZone
*
startZone
,
const
QPoint
&
/*
dropPoint
*/
,
bool
/*
faceDown
*/
)
{
player
->
client
->
moveCard
(
cardId
,
startZone
->
getName
(),
getName
(),
0
,
0
);
}
...
...
cockatrice/src/libraryzone.h
View file @
7e13352a
...
...
@@ -9,13 +9,13 @@ public:
LibraryZone
(
Player
*
_p
,
QGraphicsItem
*
parent
=
0
);
QRectF
boundingRect
()
const
;
void
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
);
void
addCard
(
CardItem
*
card
,
bool
reorganize
=
true
,
int
x
=
0
,
int
y
=
-
1
);
void
reorganizeCards
();
void
handleDropEvent
(
int
cardId
,
CardZone
*
startZone
,
const
QPoint
&
dropPoint
,
bool
faceDown
);
protected:
void
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
);
void
mouseMoveEvent
(
QGraphicsSceneMouseEvent
*
event
);
void
mouseReleaseEvent
(
QGraphicsSceneMouseEvent
*
event
);
void
addCardImpl
(
CardItem
*
card
,
int
x
,
int
y
);
};
#endif
cockatrice/src/player.cpp
View file @
7e13352a
...
...
@@ -161,12 +161,12 @@ void Player::gameEvent(ServerEventData *event)
CardZone
*
deck
=
zones
.
findZone
(
"deck"
);
for
(;
deck_cards
;
deck_cards
--
)
deck
->
addCard
(
new
CardItem
(
db
,
QString
()
,
-
1
)
)
;
deck
->
addCard
(
new
CardItem
(
db
)
,
false
,
-
1
);
deck
->
reorganizeCards
();
CardZone
*
sb
=
zones
.
findZone
(
"sb"
);
for
(;
sb_cards
;
sb_cards
--
)
sb
->
addCard
(
new
CardItem
(
db
,
QString
()
,
-
1
)
)
;
sb
->
addCard
(
new
CardItem
(
db
)
,
false
,
-
1
);
sb
->
reorganizeCards
();
if
(
local
)
{
...
...
@@ -186,11 +186,12 @@ void Player::gameEvent(ServerEventData *event)
CardZone
*
deck
=
zones
.
findZone
(
"deck"
);
CardZone
*
hand
=
zones
.
findZone
(
"hand"
);
if
(
!
event
->
getPublic
())
{
hand
->
addCard
(
deck
->
takeCard
(
0
,
data
[
0
].
toInt
(),
data
[
1
]));
hand
->
addCard
(
deck
->
takeCard
(
0
,
data
[
0
].
toInt
(),
data
[
1
])
,
true
,
-
1
);
}
else
{
int
number
=
data
[
0
].
toInt
();
for
(;
number
;
number
--
)
hand
->
addCard
(
deck
->
takeCard
(
0
,
-
1
,
QString
()));
hand
->
addCard
(
deck
->
takeCard
(
0
,
-
1
,
QString
()),
false
,
-
1
);
hand
->
reorganizeCards
();
}
break
;
}
...
...
cockatrice/src/player.h
View file @
7e13352a
...
...
@@ -61,7 +61,7 @@ public:
int
getId
()
const
{
return
id
;
}
QString
getName
()
const
{
return
name
;
}
bool
getLocal
()
const
{
return
local
;
}
const
ZoneList
*
const
getZones
()
const
{
return
&
zones
;
}
const
ZoneList
*
getZones
()
const
{
return
&
zones
;
}
void
gameEvent
(
ServerEventData
*
event
);
void
hoverCardEvent
(
CardItem
*
card
);
CardDatabase
*
getDb
()
const
{
return
db
;
}
...
...
cockatrice/src/rfgzone.cpp
View file @
7e13352a
...
...
@@ -33,22 +33,16 @@ void RfgZone::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, Q
painter
->
restore
();
}
void
RfgZone
::
addCard
(
CardItem
*
card
,
bool
reorganize
,
int
x
,
int
y
)
void
RfgZone
::
addCard
Impl
(
CardItem
*
card
,
int
x
,
int
/*y*/
)
{
for
(
int
i
=
0
;
i
<
views
.
size
();
i
++
)
views
[
i
]
->
addCard
(
new
CardItem
(
player
->
getDb
(),
card
->
getName
(),
card
->
getId
()),
reorganize
,
x
,
y
);
cards
->
insert
(
x
,
card
);
card
->
setPos
(
0
,
0
);
card
->
setVisible
(
false
);
card
->
resetState
();
card
->
setParentItem
(
this
);
if
(
reorganize
)
reorganizeCards
();
}
void
RfgZone
::
handleDropEvent
(
int
cardId
,
CardZone
*
startZone
,
const
QPoint
&
dropPoint
,
bool
faceDown
)
void
RfgZone
::
handleDropEvent
(
int
cardId
,
CardZone
*
startZone
,
const
QPoint
&
/*
dropPoint
*/
,
bool
/*
faceDown
*/
)
{
player
->
client
->
moveCard
(
cardId
,
startZone
->
getName
(),
getName
(),
0
,
0
);
}
...
...
cockatrice/src/rfgzone.h
View file @
7e13352a
...
...
@@ -9,13 +9,13 @@ public:
RfgZone
(
Player
*
_p
,
QGraphicsItem
*
parent
=
0
);
QRectF
boundingRect
()
const
;
void
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
);
void
addCard
(
CardItem
*
card
,
bool
reorganize
=
true
,
int
x
=
0
,
int
y
=
-
1
);
void
reorganizeCards
();
void
handleDropEvent
(
int
cardId
,
CardZone
*
startZone
,
const
QPoint
&
dropPoint
,
bool
faceDown
);
protected:
void
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
);
void
mouseMoveEvent
(
QGraphicsSceneMouseEvent
*
event
);
void
mouseReleaseEvent
(
QGraphicsSceneMouseEvent
*
event
);
void
addCardImpl
(
CardItem
*
card
,
int
x
,
int
y
);
};
#endif
cockatrice/src/sideboardzone.cpp
View file @
7e13352a
...
...
@@ -15,10 +15,8 @@ QRectF SideboardZone::boundingRect() const
return
QRectF
(
0
,
0
,
50
,
50
);
}
void
SideboardZone
::
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
)
void
SideboardZone
::
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*/
*
option
*/
,
QWidget
*/
*
widget
*/
)
{
Q_UNUSED
(
option
);
Q_UNUSED
(
widget
);
painter
->
save
();
painter
->
fillRect
(
boundingRect
(),
QColor
(
"blue"
));
painter
->
setFont
(
QFont
(
"Times"
,
20
,
QFont
::
Bold
));
...
...
@@ -27,22 +25,16 @@ void SideboardZone::paint(QPainter *painter, const QStyleOptionGraphicsItem *opt
painter
->
restore
();
}
void
SideboardZone
::
addCard
(
CardItem
*
card
,
bool
reorganize
,
int
x
,
int
y
)
void
SideboardZone
::
addCard
Impl
(
CardItem
*
card
,
int
x
,
int
/*y*/
)
{
for
(
int
i
=
0
;
i
<
views
.
size
();
i
++
)
views
[
i
]
->
addCard
(
new
CardItem
(
player
->
getDb
(),
card
->
getName
(),
card
->
getId
()),
reorganize
,
x
,
y
);
cards
->
insert
(
x
,
card
);
card
->
setPos
(
0
,
0
);
card
->
setVisible
(
false
);
card
->
resetState
();
card
->
setParentItem
(
this
);
if
(
reorganize
)
reorganizeCards
();
}
void
SideboardZone
::
handleDropEvent
(
int
cardId
,
CardZone
*
startZone
,
const
QPoint
&
dropPoint
,
bool
faceDown
)
void
SideboardZone
::
handleDropEvent
(
int
cardId
,
CardZone
*
startZone
,
const
QPoint
&
/*
dropPoint
*/
,
bool
/*
faceDown
*/
)
{
player
->
client
->
moveCard
(
cardId
,
startZone
->
getName
(),
getName
(),
0
,
0
);
}
...
...
@@ -51,4 +43,3 @@ void SideboardZone::reorganizeCards()
{
update
(
boundingRect
());
}
cockatrice/src/sideboardzone.h
View file @
7e13352a
...
...
@@ -9,9 +9,10 @@ public:
SideboardZone
(
Player
*
_p
,
QGraphicsItem
*
parent
=
0
);
QRectF
boundingRect
()
const
;
void
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
);
void
addCard
(
CardItem
*
card
,
bool
reorganize
=
true
,
int
x
=
0
,
int
y
=
-
1
);
void
reorganizeCards
();
void
handleDropEvent
(
int
cardId
,
CardZone
*
startZone
,
const
QPoint
&
dropPoint
,
bool
faceDown
);
protected:
void
addCardImpl
(
CardItem
*
card
,
int
x
,
int
y
);
};
#endif
cockatrice/src/tablezone.cpp
View file @
7e13352a
...
...
@@ -21,9 +21,8 @@ void TableZone::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
painter
->
fillRect
(
boundingRect
(),
QColor
(
0
,
0
,
100
));
}
void
TableZone
::
addCard
(
CardItem
*
card
,
bool
reorganize
,
int
x
,
int
y
)
void
TableZone
::
addCard
Impl
(
CardItem
*
card
,
int
x
,
int
y
)
{
Q_UNUSED
(
reorganize
);
cards
->
append
(
card
);
if
((
x
!=
-
1
)
&&
(
y
!=
-
1
))
{
if
(
!
player
->
getLocal
())
...
...
cockatrice/src/tablezone.h
View file @
7e13352a
...
...
@@ -13,10 +13,11 @@ public:
TableZone
(
Player
*
_p
,
QGraphicsItem
*
parent
=
0
);
QRectF
boundingRect
()
const
;
void
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
);
void
addCard
(
CardItem
*
card
,
bool
reorganize
=
true
,
int
x
=
-
1
,
int
y
=
-
1
);
void
reorganizeCards
();
void
toggleTapped
();
void
handleDropEvent
(
int
cardId
,
CardZone
*
startZone
,
const
QPoint
&
dropPoint
,
bool
faceDown
);
protected:
void
addCardImpl
(
CardItem
*
card
,
int
x
,
int
y
);
};
#endif
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment