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
1047ab08
Commit
1047ab08
authored
Sep 15, 2011
by
unknown
Browse files
added facedown to ServerInfo_Card
parent
972d8e0c
Changes
5
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/carditem.cpp
View file @
1047ab08
...
...
@@ -382,6 +382,7 @@ void CardItem::processCardInfo(ServerInfo_Card *info)
setId
(
info
->
getId
());
setName
(
info
->
getName
());
setAttacking
(
info
->
getAttacking
());
setFaceDown
(
info
->
getFaceDown
());
setPT
(
info
->
getPT
());
setAnnotation
(
info
->
getAnnotation
());
setColor
(
info
->
getColor
());
...
...
@@ -620,4 +621,4 @@ void CardItem::actPlay()
void
CardItem
::
actHide
()
{
zone
->
removeCard
(
this
);
}
\ No newline at end of file
}
common/protocol_datastructures.cpp
View file @
1047ab08
...
...
@@ -119,13 +119,14 @@ ServerInfo_CardCounter::ServerInfo_CardCounter(int _id, int _value)
insertItem
(
new
SerializableItem_Int
(
"value"
,
_value
));
}
ServerInfo_Card
::
ServerInfo_Card
(
int
_id
,
const
QString
&
_name
,
int
_x
,
int
_y
,
bool
_tapped
,
bool
_attacking
,
const
QString
&
_color
,
const
QString
&
_pt
,
const
QString
&
_annotation
,
bool
_destroyOnZoneChange
,
bool
_doesntUntap
,
const
QList
<
ServerInfo_CardCounter
*>
&
_counters
,
int
_attachPlayerId
,
const
QString
&
_attachZone
,
int
_attachCardId
)
ServerInfo_Card
::
ServerInfo_Card
(
int
_id
,
const
QString
&
_name
,
int
_x
,
int
_y
,
bool
_faceDown
,
bool
_tapped
,
bool
_attacking
,
const
QString
&
_color
,
const
QString
&
_pt
,
const
QString
&
_annotation
,
bool
_destroyOnZoneChange
,
bool
_doesntUntap
,
const
QList
<
ServerInfo_CardCounter
*>
&
_counters
,
int
_attachPlayerId
,
const
QString
&
_attachZone
,
int
_attachCardId
)
:
SerializableItem_Map
(
"card"
)
{
insertItem
(
new
SerializableItem_Int
(
"id"
,
_id
));
insertItem
(
new
SerializableItem_String
(
"name"
,
_name
));
insertItem
(
new
SerializableItem_Int
(
"x"
,
_x
));
insertItem
(
new
SerializableItem_Int
(
"y"
,
_y
));
insertItem
(
new
SerializableItem_Bool
(
"facedown"
,
_faceDown
));
insertItem
(
new
SerializableItem_Bool
(
"tapped"
,
_tapped
));
insertItem
(
new
SerializableItem_Bool
(
"attacking"
,
_attacking
));
insertItem
(
new
SerializableItem_String
(
"color"
,
_color
));
...
...
common/protocol_datastructures.h
View file @
1047ab08
...
...
@@ -127,12 +127,13 @@ public:
class
ServerInfo_Card
:
public
SerializableItem_Map
{
public:
ServerInfo_Card
(
int
_id
=
-
1
,
const
QString
&
_name
=
QString
(),
int
_x
=
-
1
,
int
_y
=
-
1
,
bool
_tapped
=
false
,
bool
_attacking
=
false
,
const
QString
&
_color
=
QString
(),
const
QString
&
_pt
=
QString
(),
const
QString
&
_annotation
=
QString
(),
bool
_destroyOnZoneChange
=
false
,
bool
_doesntUntap
=
false
,
const
QList
<
ServerInfo_CardCounter
*>
&
_counterList
=
QList
<
ServerInfo_CardCounter
*>
(),
int
attachPlayerId
=
-
1
,
const
QString
&
_attachZone
=
QString
(),
int
attachCardId
=
-
1
);
ServerInfo_Card
(
int
_id
=
-
1
,
const
QString
&
_name
=
QString
(),
int
_x
=
-
1
,
int
_y
=
-
1
,
bool
_faceDown
=
false
,
bool
_tapped
=
false
,
bool
_attacking
=
false
,
const
QString
&
_color
=
QString
(),
const
QString
&
_pt
=
QString
(),
const
QString
&
_annotation
=
QString
(),
bool
_destroyOnZoneChange
=
false
,
bool
_doesntUntap
=
false
,
const
QList
<
ServerInfo_CardCounter
*>
&
_counterList
=
QList
<
ServerInfo_CardCounter
*>
(),
int
attachPlayerId
=
-
1
,
const
QString
&
_attachZone
=
QString
(),
int
attachCardId
=
-
1
);
static
SerializableItem
*
newItem
()
{
return
new
ServerInfo_Card
;
}
int
getId
()
const
{
return
static_cast
<
SerializableItem_Int
*>
(
itemMap
.
value
(
"id"
))
->
getData
();
}
QString
getName
()
const
{
return
static_cast
<
SerializableItem_String
*>
(
itemMap
.
value
(
"name"
))
->
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
(
"facedown"
))
->
getData
();
}
bool
getTapped
()
const
{
return
static_cast
<
SerializableItem_Bool
*>
(
itemMap
.
value
(
"tapped"
))
->
getData
();
}
bool
getAttacking
()
const
{
return
static_cast
<
SerializableItem_Bool
*>
(
itemMap
.
value
(
"attacking"
))
->
getData
();
}
QString
getColor
()
const
{
return
static_cast
<
SerializableItem_String
*>
(
itemMap
.
value
(
"color"
))
->
getData
();
}
...
...
common/server_game.cpp
View file @
1047ab08
...
...
@@ -436,7 +436,7 @@ QList<ServerInfo_Player *> Server_Game::getGameState(Server_Player *playerWhosAs
attachZone
=
card
->
getParentCard
()
->
getZone
()
->
getName
();
attachCardId
=
card
->
getParentCard
()
->
getId
();
}
cardList
.
append
(
new
ServerInfo_Card
(
card
->
getId
(),
displayedName
,
card
->
getX
(),
card
->
getY
(),
card
->
getTapped
(),
card
->
getAttacking
(),
card
->
getColor
(),
card
->
getPT
(),
card
->
getAnnotation
(),
card
->
getDestroyOnZoneChange
(),
card
->
getDoesntUntap
(),
cardCounterList
,
attachPlayerId
,
attachZone
,
attachCardId
));
cardList
.
append
(
new
ServerInfo_Card
(
card
->
getId
(),
displayedName
,
card
->
getX
(),
card
->
getY
(),
card
->
getFaceDown
(),
card
->
getTapped
(),
card
->
getAttacking
(),
card
->
getColor
(),
card
->
getPT
(),
card
->
getAnnotation
(),
card
->
getDestroyOnZoneChange
(),
card
->
getDoesntUntap
(),
cardCounterList
,
attachPlayerId
,
attachZone
,
attachCardId
));
}
}
zoneList
.
append
(
new
ServerInfo_Zone
(
zone
->
getName
(),
zone
->
getType
(),
zone
->
hasCoords
(),
zone
->
cards
.
size
(),
cardList
));
...
...
@@ -518,4 +518,4 @@ ServerInfo_Game *Server_Game::getInfo() const
getSpectatorCount
()
);
}
}
\ No newline at end of file
}
common/server_protocolhandler.cpp
View file @
1047ab08
...
...
@@ -1208,7 +1208,7 @@ ResponseCode Server_ProtocolHandler::cmdDumpZone(Command_DumpZone *cmd, CommandC
attachCardId
=
card
->
getParentCard
()
->
getId
();
}
respCardList
.
append
(
new
ServerInfo_Card
(
card
->
getId
(),
displayedName
,
card
->
getX
(),
card
->
getY
(),
card
->
getTapped
(),
card
->
getAttacking
(),
card
->
getColor
(),
card
->
getPT
(),
card
->
getAnnotation
(),
card
->
getDestroyOnZoneChange
(),
card
->
getDoesntUntap
(),
cardCounterList
,
attachPlayerId
,
attachZone
,
attachCardId
));
respCardList
.
append
(
new
ServerInfo_Card
(
card
->
getId
(),
displayedName
,
card
->
getX
(),
card
->
getY
(),
card
->
getFaceDown
(),
card
->
getTapped
(),
card
->
getAttacking
(),
card
->
getColor
(),
card
->
getPT
(),
card
->
getAnnotation
(),
card
->
getDestroyOnZoneChange
(),
card
->
getDoesntUntap
(),
cardCounterList
,
attachPlayerId
,
attachZone
,
attachCardId
));
}
}
if
(
zone
->
getType
()
==
HiddenZone
)
{
...
...
@@ -1296,8 +1296,8 @@ ResponseCode Server_ProtocolHandler::cmdRevealCards(Command_RevealCards *cmd, Co
}
if
(
cmd
->
getPlayerId
()
!=
-
1
)
respCardListPrivate
.
append
(
new
ServerInfo_Card
(
card
->
getId
(),
card
->
getName
(),
card
->
getX
(),
card
->
getY
(),
card
->
getTapped
(),
card
->
getAttacking
(),
card
->
getColor
(),
card
->
getPT
(),
card
->
getAnnotation
(),
card
->
getDestroyOnZoneChange
(),
card
->
getDoesntUntap
(),
cardCounterListPrivate
,
attachPlayerId
,
attachZone
,
attachCardId
));
respCardListOmniscient
.
append
(
new
ServerInfo_Card
(
card
->
getId
(),
card
->
getName
(),
card
->
getX
(),
card
->
getY
(),
card
->
getTapped
(),
card
->
getAttacking
(),
card
->
getColor
(),
card
->
getPT
(),
card
->
getAnnotation
(),
card
->
getDestroyOnZoneChange
(),
card
->
getDoesntUntap
(),
cardCounterListOmniscient
,
attachPlayerId
,
attachZone
,
attachCardId
));
respCardListPrivate
.
append
(
new
ServerInfo_Card
(
card
->
getId
(),
card
->
getName
(),
card
->
getX
(),
card
->
getY
(),
card
->
getFaceDown
(),
card
->
getTapped
(),
card
->
getAttacking
(),
card
->
getColor
(),
card
->
getPT
(),
card
->
getAnnotation
(),
card
->
getDestroyOnZoneChange
(),
card
->
getDoesntUntap
(),
cardCounterListPrivate
,
attachPlayerId
,
attachZone
,
attachCardId
));
respCardListOmniscient
.
append
(
new
ServerInfo_Card
(
card
->
getId
(),
card
->
getName
(),
card
->
getX
(),
card
->
getY
(),
card
->
getFaceDown
(),
card
->
getTapped
(),
card
->
getAttacking
(),
card
->
getColor
(),
card
->
getPT
(),
card
->
getAnnotation
(),
card
->
getDestroyOnZoneChange
(),
card
->
getDoesntUntap
(),
cardCounterListOmniscient
,
attachPlayerId
,
attachZone
,
attachCardId
));
}
if
(
cmd
->
getPlayerId
()
==
-
1
)
...
...
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