From 90d77e977fe0db416a260c286b36079ab0694f21 Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Thu, 25 Nov 2010 16:51:22 +0100 Subject: Changed contents of Message::RoundState. Made relevant changes to client. --- common/message.cpp | 20 ++++++++++++++++---- common/message.h | 9 +++++++-- 2 files changed, 23 insertions(+), 6 deletions(-) (limited to 'common') 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 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); }; -- cgit v1.2.3