summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2010-11-25 16:51:22 +0100
committerVegard Storheil Eriksen <zyp@jvnv.net>2010-11-25 16:51:22 +0100
commit90d77e977fe0db416a260c286b36079ab0694f21 (patch)
treeb7db6020cebae4af111360fef8bca5b19fa2af2c /common
parent825614edeb97f753215bc33fb33600be9d7884b2 (diff)
Changed contents of Message::RoundState. Made relevant changes to client.
Diffstat (limited to 'common')
-rw-r--r--common/message.cpp20
-rw-r--r--common/message.h9
2 files changed, 23 insertions, 6 deletions
diff --git a/common/message.cpp b/common/message.cpp
index 568ad9d..08c2cdd 100644
--- a/common/message.cpp
+++ b/common/message.cpp
@@ -136,18 +136,30 @@ Message::RoundState::RoundState() : BoostBase(Types::RoundState) {
}
-Message::RoundState::RoundState(State state_) : BoostBase(Types::RoundState), state(state_) {
-
+Message::RoundState::RoundState(State state) : BoostBase(Types::RoundState) {
+ // Compatibility constructor. To be removed.
+ for(std::size_t i = 0; i < 4; i++) {
+ hand[i] = state.players[i].hand;
+ open[i] = state.players[i].open;
+ pond[i] = state.players[i].pond;
+ possible_actions = state.possible_actions;
+ }
}
void Message::RoundState::serialize(boost::archive::text_oarchive& ar) {
- ar & state;
+ ar & hand;
+ ar & open;
+ ar & pond;
ar & dora;
+ ar & possible_actions;
}
void Message::RoundState::deserialize(boost::archive::text_iarchive& ar) {
- ar & state;
+ ar & hand;
+ ar & open;
+ ar & pond;
ar & dora;
+ ar & possible_actions;
}
Message::RoundAction::RoundAction() : BoostBase(Types::RoundAction) {
diff --git a/common/message.h b/common/message.h
index 69135fe..cb709af 100644
--- a/common/message.h
+++ b/common/message.h
@@ -140,11 +140,16 @@ namespace Message {
typedef boost::shared_ptr<RoundState> p;
RoundState();
- RoundState(State state_);
+ RoundState(State state);
+
+ Tiles hand[4];
+ Tiles open[4];
+ Tiles pond[4];
- State state;
Tiles dora;
+ Actions possible_actions;
+
virtual void serialize(boost::archive::text_oarchive& ar);
virtual void deserialize(boost::archive::text_iarchive& ar);
};