
#ifndef _GAMEWORLDCLIENT_H_
#define _GAMEWORLDCLIENT_H_

#include "tnl.h"
#include "tnlNetBase.h"
#include "tnlGhostConnection.h"
#include "tnlNetInterface.h"
#include "tnlNetObject.h"
#include "tnlLog.h"
#include "tnlRPC.h"
#include "tnlString.h"
#include "tnlAsymmetricKey.h"

#include "GameWorld.h"
#include "Position.h"

using namespace TNL;

namespace DinastyOnline {
	namespace Network {

		class Player;
		class GameNetInterface;
		class GameConnection;
	
		class GameWorldClient : public GameWorld {
			typedef GameWorld Parent;
		private:
			TNL::StringTableEntry clientName;
			
		public:
			TNL::SafePtr<Player> clientPlayer; ///< the player that this client controls, if this game is a client
			GameConnection *clientConn;	/// Client connection to Server
			
			GameWorldClient(const TNL::Address &bindAddress, TNL::StringTableEntry login, TNL::StringTableEntry password);
	
			~GameWorldClient();
			
			StringTableEntry getClientName() { return clientName; }
			
			void setClientPlayer(Player *player);
			void setClientName(const char *string);
			
			bool isServer() { return false; }

			/// moveMyPlayerTo is called by the platform windowing code in response to
			/// user input.
			void moveMyPlayerTo(Position newPosition);

		};

	}
}

#endif

