diff options
-rw-r--r-- | server/client.cpp | 24 | ||||
-rw-r--r-- | server/client.h | 15 |
2 files changed, 39 insertions, 0 deletions
diff --git a/server/client.cpp b/server/client.cpp index 0d2fe24..95f7e1d 100644 --- a/server/client.cpp +++ b/server/client.cpp @@ -120,3 +120,27 @@ void Client::round_end(boost::function<void ()> callback) { void Client::get_action(boost::function<void (Action)> callback, Actions expected_actions) { connection->recv(boost::bind(&Client::handle_action, shared_from_this(), _1, callback, expected_actions)); } + +std::string ClientDumb::nick() { + return "CPU"; +} + +void ClientDumb::game_start(boost::function<void ()> callback, std::vector<std::string> players) { + callback(); +} + +void ClientDumb::round_start() { + +} + +void ClientDumb::round_state(const PlayerState& pl_d, const PlayerState& pl_r, const PlayerState& pl_u, const PlayerState& pl_l, const Tiles& d, const Actions& a) { + +} + +void ClientDumb::round_end(boost::function<void ()> callback) { + callback(); +} + +void ClientDumb::get_action(boost::function<void (Action)> callback, Actions expected_actions) { + callback(expected_actions.back()); +} diff --git a/server/client.h b/server/client.h index ed3a47b..91fd4b6 100644 --- a/server/client.h +++ b/server/client.h @@ -94,4 +94,19 @@ class Client : public ClientBase, public boost::enable_shared_from_this<Client> typedef std::vector<Client> Clients; +class ClientDumb : public ClientBase { + public: + virtual std::string nick(); + + virtual void game_start(boost::function<void ()> callback, std::vector<std::string> players); + + virtual void round_start(); + + virtual void round_state(const PlayerState& pl_d, const PlayerState& pl_r, const PlayerState& pl_u, const PlayerState& pl_l, const Tiles& d, const Actions& a); + + virtual void round_end(boost::function<void ()> callback); + + virtual void get_action(boost::function<void (Action)> callback, Actions expected_actions); +}; + #endif |