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
388e9255
Commit
388e9255
authored
Mar 01, 2010
by
Max-Wilhelm Bruker
Browse files
cipt code
parent
888a64b0
Changes
10
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/carditem.cpp
View file @
388e9255
...
...
@@ -173,8 +173,11 @@ void CardItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
if
(
tz
)
tz
->
toggleTapped
();
else
{
bool
faceDown
=
event
->
modifiers
().
testFlag
(
Qt
::
ShiftModifier
);
bool
tapped
=
info
->
getCipt
();
TableZone
*
table
=
zone
->
getPlayer
()
->
getTable
();
QPoint
gridPoint
=
table
->
getFreeGridPoint
(
info
->
getTableRow
());
table
->
handleDropEventByGrid
(
id
,
zone
,
gridPoint
,
fa
lse
);
table
->
handleDropEventByGrid
(
id
,
zone
,
gridPoint
,
fa
ceDown
,
tapped
);
}
}
cockatrice/src/tablezone.cpp
View file @
388e9255
...
...
@@ -66,9 +66,9 @@ void TableZone::handleDropEvent(int cardId, CardZone *startZone, const QPoint &d
handleDropEventByGrid
(
cardId
,
startZone
,
mapToGrid
(
dropPoint
),
faceDown
);
}
void
TableZone
::
handleDropEventByGrid
(
int
cardId
,
CardZone
*
startZone
,
const
QPoint
&
gridPoint
,
bool
faceDown
)
void
TableZone
::
handleDropEventByGrid
(
int
cardId
,
CardZone
*
startZone
,
const
QPoint
&
gridPoint
,
bool
faceDown
,
bool
tapped
)
{
player
->
sendGameCommand
(
new
Command_MoveCard
(
-
1
,
startZone
->
getName
(),
cardId
,
getName
(),
gridPoint
.
x
(),
gridPoint
.
y
(),
faceDown
));
player
->
sendGameCommand
(
new
Command_MoveCard
(
-
1
,
startZone
->
getName
(),
cardId
,
getName
(),
gridPoint
.
x
(),
gridPoint
.
y
(),
faceDown
,
tapped
));
}
void
TableZone
::
reorganizeCards
()
...
...
cockatrice/src/tablezone.h
View file @
388e9255
...
...
@@ -21,8 +21,8 @@ public:
void
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
);
void
reorganizeCards
();
void
toggleTapped
();
void
handleDropEvent
(
int
cardId
,
CardZone
*
startZone
,
const
QPoint
&
dropPoint
,
bool
faceDown
);
void
handleDropEventByGrid
(
int
cardId
,
CardZone
*
startZone
,
const
QPoint
&
gridPoint
,
bool
faceDown
);
void
handleDropEvent
(
int
cardId
,
CardZone
*
startZone
,
const
QPoint
&
dropPoint
,
bool
faceDown
=
false
);
void
handleDropEventByGrid
(
int
cardId
,
CardZone
*
startZone
,
const
QPoint
&
gridPoint
,
bool
faceDown
=
false
,
bool
tapped
=
false
);
CardItem
*
getCardFromGrid
(
const
QPoint
&
gridPoint
)
const
;
QPointF
mapFromGrid
(
const
QPoint
&
gridPoint
)
const
;
QPoint
mapToGrid
(
const
QPointF
&
mapPoint
)
const
;
...
...
common/protocol.cpp
View file @
388e9255
...
...
@@ -100,7 +100,7 @@ void Command::processResponse(ProtocolResponse *response)
}
CommandContainer
::
CommandContainer
(
const
QList
<
Command
*>
&
_commandList
,
int
_cmdId
)
:
ProtocolItem
(
"container"
,
"cmd"
),
ticks
(
0
),
resp
(
0
),
gameEventQueue
(
0
)
:
ProtocolItem
(
"container"
,
"cmd"
),
ticks
(
0
),
resp
(
0
),
gameEventQueue
Public
(
0
),
gameEventQueuePrivate
(
0
)
{
if
(
_cmdId
==
-
1
)
_cmdId
=
lastCmdId
++
;
...
...
@@ -126,11 +126,18 @@ void CommandContainer::setResponse(ProtocolResponse *_resp)
resp
=
_resp
;
}
void
CommandContainer
::
enqueueGameEvent
(
GameEvent
*
event
,
int
gameId
)
void
CommandContainer
::
enqueueGameEvent
Public
(
GameEvent
*
event
,
int
gameId
)
{
if
(
!
gameEventQueue
)
gameEventQueue
=
new
GameEventContainer
(
QList
<
GameEvent
*>
(),
gameId
);
gameEventQueue
->
appendItem
(
event
);
if
(
!
gameEventQueuePublic
)
gameEventQueuePublic
=
new
GameEventContainer
(
QList
<
GameEvent
*>
(),
gameId
);
gameEventQueuePublic
->
appendItem
(
event
);
}
void
CommandContainer
::
enqueueGameEventPrivate
(
GameEvent
*
event
,
int
gameId
)
{
if
(
!
gameEventQueuePrivate
)
gameEventQueuePrivate
=
new
GameEventContainer
(
QList
<
GameEvent
*>
(),
gameId
);
gameEventQueuePrivate
->
appendItem
(
event
);
}
Command_DeckUpload
::
Command_DeckUpload
(
DeckList
*
_deck
,
const
QString
&
_path
)
...
...
common/protocol.h
View file @
388e9255
...
...
@@ -99,7 +99,8 @@ private:
// These are only for processing inside the server.
ProtocolResponse
*
resp
;
QList
<
ProtocolItem
*>
itemQueue
;
GameEventContainer
*
gameEventQueue
;
GameEventContainer
*
gameEventQueuePublic
;
GameEventContainer
*
gameEventQueuePrivate
;
public:
CommandContainer
(
const
QList
<
Command
*>
&
_commandList
=
QList
<
Command
*>
(),
int
_cmdId
=
-
1
);
static
SerializableItem
*
newItem
()
{
return
new
CommandContainer
;
}
...
...
@@ -113,8 +114,10 @@ public:
void
setResponse
(
ProtocolResponse
*
_resp
);
const
QList
<
ProtocolItem
*>
&
getItemQueue
()
const
{
return
itemQueue
;
}
void
enqueueItem
(
ProtocolItem
*
item
)
{
itemQueue
.
append
(
item
);
}
GameEventContainer
*
getGameEventQueue
()
const
{
return
gameEventQueue
;
}
void
enqueueGameEvent
(
GameEvent
*
event
,
int
gameId
);
GameEventContainer
*
getGameEventQueuePublic
()
const
{
return
gameEventQueuePublic
;
}
void
enqueueGameEventPublic
(
GameEvent
*
event
,
int
gameId
);
GameEventContainer
*
getGameEventQueuePrivate
()
const
{
return
gameEventQueuePrivate
;
}
void
enqueueGameEventPrivate
(
GameEvent
*
event
,
int
gameId
);
};
class
ChatCommand
:
public
Command
{
...
...
common/protocol_items.cpp
View file @
388e9255
...
...
@@ -100,7 +100,7 @@ Command_DrawCards::Command_DrawCards(int _gameId, int _number)
{
insertItem
(
new
SerializableItem_Int
(
"number"
,
_number
));
}
Command_MoveCard
::
Command_MoveCard
(
int
_gameId
,
const
QString
&
_startZone
,
int
_cardId
,
const
QString
&
_targetZone
,
int
_x
,
int
_y
,
bool
_faceDown
)
Command_MoveCard
::
Command_MoveCard
(
int
_gameId
,
const
QString
&
_startZone
,
int
_cardId
,
const
QString
&
_targetZone
,
int
_x
,
int
_y
,
bool
_faceDown
,
bool
_tapped
)
:
GameCommand
(
"move_card"
,
_gameId
)
{
insertItem
(
new
SerializableItem_String
(
"start_zone"
,
_startZone
));
...
...
@@ -109,6 +109,7 @@ Command_MoveCard::Command_MoveCard(int _gameId, const QString &_startZone, int _
insertItem
(
new
SerializableItem_Int
(
"x"
,
_x
));
insertItem
(
new
SerializableItem_Int
(
"y"
,
_y
));
insertItem
(
new
SerializableItem_Bool
(
"face_down"
,
_faceDown
));
insertItem
(
new
SerializableItem_Bool
(
"tapped"
,
_tapped
));
}
Command_CreateToken
::
Command_CreateToken
(
int
_gameId
,
const
QString
&
_zone
,
const
QString
&
_cardName
,
const
QString
&
_pt
,
int
_x
,
int
_y
)
:
GameCommand
(
"create_token"
,
_gameId
)
...
...
common/protocol_items.dat
View file @
388e9255
...
...
@@ -18,7 +18,7 @@
2:mulligan
2:roll_die:i,sides
2:draw_cards:i,number
2:move_card:s,start_zone:i,card_id:s,target_zone:i,x:i,y:b,face_down
2:move_card:s,start_zone:i,card_id:s,target_zone:i,x:i,y:b,face_down
:b,tapped
2:create_token:s,zone:s,card_name:s,pt:i,x:i,y
2:create_arrow:i,start_player_id:s,start_zone:i,start_card_id:i,target_player_id:s,target_zone:i,target_card_id:c,color
2:delete_arrow:i,arrow_id
...
...
common/protocol_items.h
View file @
388e9255
...
...
@@ -165,13 +165,14 @@ public:
class
Command_MoveCard
:
public
GameCommand
{
Q_OBJECT
public:
Command_MoveCard
(
int
_gameId
=
-
1
,
const
QString
&
_startZone
=
QString
(),
int
_cardId
=
-
1
,
const
QString
&
_targetZone
=
QString
(),
int
_x
=
-
1
,
int
_y
=
-
1
,
bool
_faceDown
=
false
);
Command_MoveCard
(
int
_gameId
=
-
1
,
const
QString
&
_startZone
=
QString
(),
int
_cardId
=
-
1
,
const
QString
&
_targetZone
=
QString
(),
int
_x
=
-
1
,
int
_y
=
-
1
,
bool
_faceDown
=
false
,
bool
_tapped
=
false
);
QString
getStartZone
()
const
{
return
static_cast
<
SerializableItem_String
*>
(
itemMap
.
value
(
"start_zone"
))
->
getData
();
};
int
getCardId
()
const
{
return
static_cast
<
SerializableItem_Int
*>
(
itemMap
.
value
(
"card_id"
))
->
getData
();
};
QString
getTargetZone
()
const
{
return
static_cast
<
SerializableItem_String
*>
(
itemMap
.
value
(
"target_zone"
))
->
getData
();
};
int
getX
()
const
{
return
static_cast
<
SerializableItem_Int
*>
(
itemMap
.
value
(
"x"
))
->
getData
();
};
int
getY
()
const
{
return
static_cast
<
SerializableItem_Int
*>
(
itemMap
.
value
(
"y"
))
->
getData
();
};
bool
getFaceDown
()
const
{
return
static_cast
<
SerializableItem_Bool
*>
(
itemMap
.
value
(
"face_down"
))
->
getData
();
};
bool
getTapped
()
const
{
return
static_cast
<
SerializableItem_Bool
*>
(
itemMap
.
value
(
"tapped"
))
->
getData
();
};
static
SerializableItem
*
newItem
()
{
return
new
Command_MoveCard
;
}
int
getItemId
()
const
{
return
ItemId_Command_MoveCard
;
}
};
...
...
common/server_protocolhandler.cpp
View file @
388e9255
...
...
@@ -142,10 +142,16 @@ void Server_ProtocolHandler::processCommandContainer(CommandContainer *cont)
if
(
!
pr
)
pr
=
new
ProtocolResponse
(
cont
->
getCmdId
(),
finalResponseCode
);
GameEventContainer
*
gQ
=
cont
->
getGameEventQueue
();
if
(
gQ
)
{
Server_Game
*
game
=
games
.
value
(
gQ
->
getGameId
()).
first
;
game
->
sendGameEventContainer
(
gQ
);
GameEventContainer
*
gQPublic
=
cont
->
getGameEventQueuePublic
();
if
(
gQPublic
)
{
Server_Game
*
game
=
games
.
value
(
gQPublic
->
getGameId
()).
first
;
Server_Player
*
player
=
games
.
value
(
gQPublic
->
getGameId
()).
second
;
GameEventContainer
*
gQPrivate
=
cont
->
getGameEventQueuePrivate
();
if
(
gQPrivate
)
{
game
->
sendGameEventContainer
(
gQPublic
,
player
);
player
->
sendProtocolItem
(
gQPrivate
);
}
else
game
->
sendGameEventContainer
(
gQPublic
);
}
const
QList
<
ProtocolItem
*>
&
iQ
=
cont
->
getItemQueue
();
...
...
@@ -391,12 +397,13 @@ ResponseCode Server_ProtocolHandler::cmdMulligan(Command_Mulligan * /*cmd*/, Com
Server_CardZone
*
hand
=
player
->
getZones
().
value
(
"hand"
);
while
(
!
hand
->
cards
.
isEmpty
())
moveCard
(
game
,
player
,
"hand"
,
hand
->
cards
.
first
()
->
getId
(),
"deck"
,
0
,
0
,
false
);
moveCard
(
game
,
player
,
cont
,
"hand"
,
hand
->
cards
.
first
()
->
getId
(),
"deck"
,
0
,
0
,
false
,
false
);
player
->
getZones
().
value
(
"deck"
)
->
shuffle
();
game
->
sendGameEvent
(
new
Event_Shuffle
(
player
->
getPlayerId
()));
cont
->
enqueueGameEventPrivate
(
new
Event_Shuffle
(
player
->
getPlayerId
()),
game
->
getGameId
());
cont
->
enqueueGameEventPublic
(
new
Event_Shuffle
(
player
->
getPlayerId
()),
game
->
getGameId
());
drawCards
(
game
,
player
,
number
);
drawCards
(
game
,
player
,
cont
,
number
);
player
->
setInitialCards
(
number
-
1
);
return
RespOk
;
...
...
@@ -408,7 +415,7 @@ ResponseCode Server_ProtocolHandler::cmdRollDie(Command_RollDie *cmd, CommandCon
return
RespOk
;
}
ResponseCode
Server_ProtocolHandler
::
drawCards
(
Server_Game
*
game
,
Server_Player
*
player
,
int
number
)
ResponseCode
Server_ProtocolHandler
::
drawCards
(
Server_Game
*
game
,
Server_Player
*
player
,
CommandContainer
*
cont
,
int
number
)
{
if
(
!
game
->
getGameStarted
())
return
RespGameNotStarted
;
...
...
@@ -425,8 +432,8 @@ ResponseCode Server_ProtocolHandler::drawCards(Server_Game *game, Server_Player
cardList
.
append
(
new
ServerInfo_Card
(
card
->
getId
(),
card
->
getName
()));
}
player
->
s
en
dProtocolItem
(
GameEventContainer
::
makeNew
(
new
Event_DrawCards
(
player
->
getPlayerId
(),
cardList
.
size
(),
cardList
),
game
->
getGameId
())
)
;
game
->
s
en
d
GameEvent
(
new
Event_DrawCards
(
player
->
getPlayerId
(),
cardList
.
size
()),
player
);
cont
->
en
queueGameEventPrivate
(
new
Event_DrawCards
(
player
->
getPlayerId
(),
cardList
.
size
(),
cardList
),
game
->
getGameId
());
cont
->
en
queue
GameEvent
Public
(
new
Event_DrawCards
(
player
->
getPlayerId
(),
cardList
.
size
()),
game
->
getGameId
()
);
return
RespOk
;
}
...
...
@@ -434,10 +441,10 @@ ResponseCode Server_ProtocolHandler::drawCards(Server_Game *game, Server_Player
ResponseCode
Server_ProtocolHandler
::
cmdDrawCards
(
Command_DrawCards
*
cmd
,
CommandContainer
*
cont
,
Server_Game
*
game
,
Server_Player
*
player
)
{
return
drawCards
(
game
,
player
,
cmd
->
getNumber
());
return
drawCards
(
game
,
player
,
cont
,
cmd
->
getNumber
());
}
ResponseCode
Server_ProtocolHandler
::
moveCard
(
Server_Game
*
game
,
Server_Player
*
player
,
const
QString
&
_startZone
,
int
_cardId
,
const
QString
&
_targetZone
,
int
x
,
int
y
,
bool
faceDown
)
ResponseCode
Server_ProtocolHandler
::
moveCard
(
Server_Game
*
game
,
Server_Player
*
player
,
CommandContainer
*
cont
,
const
QString
&
_startZone
,
int
_cardId
,
const
QString
&
_targetZone
,
int
x
,
int
y
,
bool
faceDown
,
bool
tapped
)
{
if
(
!
game
->
getGameStarted
())
return
RespGameNotStarted
;
...
...
@@ -489,7 +496,7 @@ ResponseCode Server_ProtocolHandler::moveCard(Server_Game *game, Server_Player *
int
privatePosition
=
-
1
;
if
(
startzone
->
getType
()
==
HiddenZone
)
privatePosition
=
position
;
player
->
s
en
dProtocolItem
(
GameEventContainer
::
makeNew
(
new
Event_MoveCard
(
player
->
getPlayerId
(),
privateOldCardId
,
privateCardName
,
startzone
->
getName
(),
privatePosition
,
targetzone
->
getName
(),
x
,
y
,
privateNewCardId
,
faceDown
),
game
->
getGameId
())
)
;
cont
->
en
queueGameEventPrivate
(
new
Event_MoveCard
(
player
->
getPlayerId
(),
privateOldCardId
,
privateCardName
,
startzone
->
getName
(),
privatePosition
,
targetzone
->
getName
(),
x
,
y
,
privateNewCardId
,
faceDown
),
game
->
getGameId
());
// Other players do not get to see the start and/or target position of the card if the respective
// part of the zone is being looked at. The information is not needed anyway because in hidden zones,
...
...
@@ -503,9 +510,12 @@ ResponseCode Server_ProtocolHandler::moveCard(Server_Game *game, Server_Player *
x
=
-
1
;
if
((
startzone
->
getType
()
==
PublicZone
)
||
(
targetzone
->
getType
()
==
PublicZone
))
game
->
s
en
d
GameEvent
(
new
Event_MoveCard
(
player
->
getPlayerId
(),
oldCardId
,
publicCardName
,
startzone
->
getName
(),
position
,
targetzone
->
getName
(),
x
,
y
,
card
->
getId
(),
faceDown
),
player
);
cont
->
en
queue
GameEvent
Public
(
new
Event_MoveCard
(
player
->
getPlayerId
(),
oldCardId
,
publicCardName
,
startzone
->
getName
(),
position
,
targetzone
->
getName
(),
x
,
y
,
card
->
getId
(),
faceDown
),
game
->
getGameId
()
);
else
game
->
sendGameEvent
(
new
Event_MoveCard
(
player
->
getPlayerId
(),
-
1
,
QString
(),
startzone
->
getName
(),
position
,
targetzone
->
getName
(),
x
,
y
,
-
1
,
false
),
player
);
cont
->
enqueueGameEventPublic
(
new
Event_MoveCard
(
player
->
getPlayerId
(),
-
1
,
QString
(),
startzone
->
getName
(),
position
,
targetzone
->
getName
(),
x
,
y
,
-
1
,
false
),
game
->
getGameId
());
if
(
tapped
)
setCardAttrHelper
(
cont
,
game
,
player
,
targetzone
->
getName
(),
card
->
getId
(),
"tapped"
,
"1"
);
// If the card was moved to another zone, delete all arrows from and to the card
if
(
startzone
!=
targetzone
)
{
...
...
@@ -528,7 +538,7 @@ ResponseCode Server_ProtocolHandler::moveCard(Server_Game *game, Server_Player *
ResponseCode
Server_ProtocolHandler
::
cmdMoveCard
(
Command_MoveCard
*
cmd
,
CommandContainer
*
cont
,
Server_Game
*
game
,
Server_Player
*
player
)
{
return
moveCard
(
game
,
player
,
cmd
->
getStartZone
(),
cmd
->
getCardId
(),
cmd
->
getTargetZone
(),
cmd
->
getX
(),
cmd
->
getY
(),
cmd
->
getFaceDown
());
return
moveCard
(
game
,
player
,
cont
,
cmd
->
getStartZone
(),
cmd
->
getCardId
(),
cmd
->
getTargetZone
(),
cmd
->
getX
(),
cmd
->
getY
(),
cmd
->
getFaceDown
()
,
cmd
->
getTapped
()
);
}
ResponseCode
Server_ProtocolHandler
::
cmdCreateToken
(
Command_CreateToken
*
cmd
,
CommandContainer
*
cont
,
Server_Game
*
game
,
Server_Player
*
player
)
...
...
@@ -599,33 +609,39 @@ ResponseCode Server_ProtocolHandler::cmdDeleteArrow(Command_DeleteArrow *cmd, Co
return
RespOk
;
}
ResponseCode
Server_ProtocolHandler
::
cmdS
etCardAttr
(
Command_SetCardAttr
*
cmd
,
CommandContainer
*
cont
,
Server_Game
*
game
,
Server_Player
*
player
)
ResponseCode
Server_ProtocolHandler
::
s
etCardAttr
Helper
(
CommandContainer
*
cont
,
Server_Game
*
game
,
Server_Player
*
player
,
const
QString
&
zoneName
,
int
cardId
,
const
QString
&
attrName
,
const
QString
&
attrValue
)
{
if
(
!
game
->
getGameStarted
())
return
RespGameNotStarted
;
// zone, card id, attr name, attr value
// card id = -1 => affects all cards in the specified zone
Server_CardZone
*
zone
=
player
->
getZones
().
value
(
cmd
->
getZone
()
);
Server_CardZone
*
zone
=
player
->
getZones
().
value
(
zoneName
);
if
(
!
zone
)
return
RespNameNotFound
;
if
(
c
md
->
getC
ardId
()
==
-
1
)
{
if
(
cardId
==
-
1
)
{
QListIterator
<
Server_Card
*>
CardIterator
(
zone
->
cards
);
while
(
CardIterator
.
hasNext
())
if
(
!
CardIterator
.
next
()
->
setAttribute
(
cmd
->
getAttrName
(),
cmd
->
getA
ttrValue
()
,
true
))
if
(
!
CardIterator
.
next
()
->
setAttribute
(
attrName
,
a
ttrValue
,
true
))
return
RespInvalidCommand
;
}
else
{
Server_Card
*
card
=
zone
->
getCard
(
c
md
->
getC
ardId
()
,
false
);
Server_Card
*
card
=
zone
->
getCard
(
cardId
,
false
);
if
(
!
card
)
return
RespNameNotFound
;
if
(
!
card
->
setAttribute
(
cmd
->
getAttrName
(),
cmd
->
getA
ttrValue
()
,
false
))
if
(
!
card
->
setAttribute
(
attrName
,
a
ttrValue
,
false
))
return
RespInvalidCommand
;
}
cont
->
enqueueGameEvent
(
new
Event_SetCardAttr
(
player
->
getPlayerId
(),
zone
->
getName
(),
cmd
->
getCardId
(),
cmd
->
getAttrName
(),
cmd
->
getAttrValue
()),
game
->
getGameId
());
cont
->
enqueueGameEventPrivate
(
new
Event_SetCardAttr
(
player
->
getPlayerId
(),
zone
->
getName
(),
cardId
,
attrName
,
attrValue
),
game
->
getGameId
());
cont
->
enqueueGameEventPublic
(
new
Event_SetCardAttr
(
player
->
getPlayerId
(),
zone
->
getName
(),
cardId
,
attrName
,
attrValue
),
game
->
getGameId
());
return
RespOk
;
}
ResponseCode
Server_ProtocolHandler
::
cmdSetCardAttr
(
Command_SetCardAttr
*
cmd
,
CommandContainer
*
cont
,
Server_Game
*
game
,
Server_Player
*
player
)
{
return
setCardAttrHelper
(
cont
,
game
,
player
,
cmd
->
getZone
(),
cmd
->
getCardId
(),
cmd
->
getAttrName
(),
cmd
->
getAttrValue
());
}
ResponseCode
Server_ProtocolHandler
::
cmdIncCounter
(
Command_IncCounter
*
cmd
,
CommandContainer
*
cont
,
Server_Game
*
game
,
Server_Player
*
player
)
{
if
(
!
game
->
getGameStarted
())
...
...
common/server_protocolhandler.h
View file @
388e9255
...
...
@@ -56,13 +56,14 @@ private:
ResponseCode
cmdMulligan
(
Command_Mulligan
*
cmd
,
CommandContainer
*
cont
,
Server_Game
*
game
,
Server_Player
*
player
);
ResponseCode
cmdRollDie
(
Command_RollDie
*
cmd
,
CommandContainer
*
cont
,
Server_Game
*
game
,
Server_Player
*
player
);
// XXX Maybe the following function and others belong into Server_Player
ResponseCode
drawCards
(
Server_Game
*
game
,
Server_Player
*
player
,
int
number
);
ResponseCode
drawCards
(
Server_Game
*
game
,
Server_Player
*
player
,
CommandContainer
*
cont
,
int
number
);
ResponseCode
cmdDrawCards
(
Command_DrawCards
*
cmd
,
CommandContainer
*
cont
,
Server_Game
*
game
,
Server_Player
*
player
);
ResponseCode
moveCard
(
Server_Game
*
game
,
Server_Player
*
player
,
const
QString
&
_startZone
,
int
_cardId
,
const
QString
&
_targetZone
,
int
_x
,
int
_y
,
bool
_faceDown
);
ResponseCode
moveCard
(
Server_Game
*
game
,
Server_Player
*
player
,
CommandContainer
*
cont
,
const
QString
&
_startZone
,
int
_cardId
,
const
QString
&
_targetZone
,
int
_x
,
int
_y
,
bool
_faceDown
,
bool
_tapped
);
ResponseCode
cmdMoveCard
(
Command_MoveCard
*
cmd
,
CommandContainer
*
cont
,
Server_Game
*
game
,
Server_Player
*
player
);
ResponseCode
cmdCreateToken
(
Command_CreateToken
*
cmd
,
CommandContainer
*
cont
,
Server_Game
*
game
,
Server_Player
*
player
);
ResponseCode
cmdCreateArrow
(
Command_CreateArrow
*
cmd
,
CommandContainer
*
cont
,
Server_Game
*
game
,
Server_Player
*
player
);
ResponseCode
cmdDeleteArrow
(
Command_DeleteArrow
*
cmd
,
CommandContainer
*
cont
,
Server_Game
*
game
,
Server_Player
*
player
);
ResponseCode
setCardAttrHelper
(
CommandContainer
*
cont
,
Server_Game
*
game
,
Server_Player
*
player
,
const
QString
&
zone
,
int
cardId
,
const
QString
&
attrName
,
const
QString
&
attrValue
);
ResponseCode
cmdSetCardAttr
(
Command_SetCardAttr
*
cmd
,
CommandContainer
*
cont
,
Server_Game
*
game
,
Server_Player
*
player
);
ResponseCode
cmdIncCounter
(
Command_IncCounter
*
cmd
,
CommandContainer
*
cont
,
Server_Game
*
game
,
Server_Player
*
player
);
ResponseCode
cmdCreateCounter
(
Command_CreateCounter
*
cmd
,
CommandContainer
*
cont
,
Server_Game
*
game
,
Server_Player
*
player
);
...
...
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