diff options
author | Ole Daniel Evensen <daniel@ICE.(none)> | 2010-11-08 10:18:44 +0100 |
---|---|---|
committer | Ole Daniel Evensen <daniel@ICE.(none)> | 2010-11-08 10:18:44 +0100 |
commit | 344bb63e04b1a0b9eb93b83d8391b8e99093e70a (patch) | |
tree | 5c97c2b6ea2df9fee96b45ed1020c85e0bb95301 | |
parent | eeb5e4736cf7fc71eb35f8a086fda841b3c4f2f3 (diff) |
added player and game classes
-rw-r--r-- | server/game.cpp | 4 | ||||
-rw-r--r-- | server/game.h | 15 | ||||
-rw-r--r-- | server/player.cpp | 10 | ||||
-rw-r--r-- | server/player.h | 21 |
4 files changed, 50 insertions, 0 deletions
diff --git a/server/game.cpp b/server/game.cpp new file mode 100644 index 0000000..36fd33c --- /dev/null +++ b/server/game.cpp @@ -0,0 +1,4 @@ +#include "game.h" + +Game::Game(){} +Game::~Game(){} diff --git a/server/game.h b/server/game.h new file mode 100644 index 0000000..1cb03c1 --- /dev/null +++ b/server/game.h @@ -0,0 +1,15 @@ +#ifndef GAME_H
+#define GAME_H
+ +#include <list> +#include "player.h" +
+class Game{ + private: + std::list<Player> players; + public: + Game(); + ~Game(); +};
+
+#endif // GAME_H
diff --git a/server/player.cpp b/server/player.cpp new file mode 100644 index 0000000..9530c10 --- /dev/null +++ b/server/player.cpp @@ -0,0 +1,10 @@ +#include "player.h" + +Player::Player(){} +Player::~Player(){} + +Player::Player(std::string& ip, std::string& port, std::string& nick){ + this->ip = ip; + this->port = port; + this->nick = nick; +} diff --git a/server/player.h b/server/player.h new file mode 100644 index 0000000..c2cecdf --- /dev/null +++ b/server/player.h @@ -0,0 +1,21 @@ +#ifndef PLAYER_H
+#define PLAYER_H + +#include <string>
+
+class Player{ + private: + //What the server needs to get in contact with player. + std::string ip; + std::string port; + std::string nick;//The players nick + + unsigned int id;//Either generated or fetched from database + public: + Player(); + ~Player(); + + Player(std::string& ip, std::string& port, std::string& nick); +};
+
+#endif // PLAYER_H_INCLUDED
|