From d5aae396856ee801eb2e2420b786fda2f13cf391 Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Thu, 25 Nov 2010 02:24:00 +0100 Subject: Changed parts of the Wall API to make it reusable. Simplified the building. --- server/wall.h | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'server/wall.h') diff --git a/server/wall.h b/server/wall.h index ca48a40..aeef031 100644 --- a/server/wall.h +++ b/server/wall.h @@ -6,26 +6,24 @@ #include #include - class Wall { private: - - //! Our random number generator. Initialized with a seed of the curren time that the object is constructed. + //! Our random number generator. Initialized with a seed of the current time that the object is constructed. boost::mt19937 rand_gen; - //! Contains all the tiles in the wall - std::vector m_wall; - - //! Contains the number of tiles left in the wall - int num_tiles; + //! Contains the remaining tiles in the wall. + std::vector wall; public: Wall(); - //! Returns true if there's only 14 tiles left in the wall (Round ends) - bool is_done(); + //! Build a new wall. + void build(); + + //! Number of remaining tiles in wall. + int remaining(); - //! Returns a random tile from the wall + //! Returns a random tile from the wall. Tile take_one(); }; -- cgit v1.2.3