From 344bb63e04b1a0b9eb93b83d8391b8e99093e70a Mon Sep 17 00:00:00 2001 From: Ole Daniel Evensen Date: Mon, 8 Nov 2010 10:18:44 +0100 Subject: added player and game classes --- server/game.cpp | 4 ++++ server/game.h | 15 +++++++++++++++ server/player.cpp | 10 ++++++++++ server/player.h | 21 +++++++++++++++++++++ 4 files changed, 50 insertions(+) create mode 100644 server/game.cpp create mode 100644 server/game.h create mode 100644 server/player.cpp create mode 100644 server/player.h (limited to 'server') 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 +#include "player.h" + +class Game{ + private: + std::list 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 + +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 -- cgit v1.2.3