Tinman  1.0
player.h
Go to the documentation of this file.
1 #ifndef PLAYER_H
2 #define PLAYER_H
3 #include "bot.h"
4 #include "human.h"
5 #include "networkcontroller.h"
6 #include "icontroller.h"
7 
8 class Session;
9 
10 class Player {
12 
13  public:
14  typedef std::shared_ptr<Player> shared;
15  std::string race_ended_;
17  int money_;
18  std::string nick_;
19 
20  Player(std::string nick, Controller::shared controller, Sound::shared sound);
21  virtual ~Player();
22 
23  void realize(Physics::shared physics, Scene::shared scene, std::string name,
24  btVector3 position, std::string material, int checkpoints, Ice::Byte id);
25  Ice::AsyncResultPtr login(std::shared_ptr<Session> session);
26  Ice::AsyncResultPtr next_race();
27  Tinman::LoginInfo complete_login(Ice::AsyncResultPtr async_result);
28 
29  void update(float delta);
30  void disconnect();
31 
32  void store(Tinman::CarInfo car_info);
33  void purchase();
34 
36  std::string get_nick();
37  void set_nick(std::string nick);
38  Ice::Byte get_id();
39 
40  void pick_money( int amount, PowerUp::shared money);
41  void pick_nitro( PowerUp::shared nitro);
42 
43  void reset(int checkpoints, btVector3 position);
44 
45  std::pair<std::string, int> get_socket();
46  void set_socket(std::pair<std::string, int> socket);
47 };
48 #endif
Ice::AsyncResultPtr next_race()
Definition: player.cpp:31
Ice::Byte get_id()
Definition: player.cpp:72
void realize(Physics::shared physics, Scene::shared scene, std::string name, btVector3 position, std::string material, int checkpoints, Ice::Byte id)
Definition: player.cpp:36
std::shared_ptr< Physics > shared
Definition: physics.h:33
std::shared_ptr< Scene > shared
Definition: scene.h:43
Sound::shared sound_
Definition: player.h:11
std::string race_ended_
Definition: player.h:15
std::shared_ptr< Player > shared
Definition: player.h:14
void reset(int checkpoints, btVector3 position)
Definition: player.cpp:103
Player(std::string nick, Controller::shared controller, Sound::shared sound)
Definition: player.cpp:6
Car::shared get_car()
Definition: player.cpp:55
std::shared_ptr< PowerUp > shared
Definition: powerup.h:45
std::shared_ptr< Sound > shared
Definition: sound.h:13
std::shared_ptr< Car > shared
Definition: car.h:44
void disconnect()
Definition: player.cpp:49
std::string get_nick()
Definition: player.cpp:60
Controller::shared controller_
Definition: player.h:16
void pick_money(int amount, PowerUp::shared money)
Definition: player.cpp:88
void pick_nitro(PowerUp::shared nitro)
Definition: player.cpp:96
int money_
Definition: player.h:17
void purchase()
Definition: player.cpp:82
std::string nick_
Definition: player.h:18
Tinman::LoginInfo complete_login(Ice::AsyncResultPtr async_result)
Definition: player.cpp:25
Definition: session.h:30
void update(float delta)
Definition: player.cpp:44
std::pair< std::string, int > get_socket()
Definition: player.cpp:110
Ice::AsyncResultPtr login(std::shared_ptr< Session > session)
Definition: player.cpp:18
virtual ~Player()
Definition: player.cpp:14
void set_socket(std::pair< std::string, int > socket)
Definition: player.cpp:115
void set_nick(std::string nick)
Definition: player.cpp:65
std::shared_ptr< Controller > shared
Definition: controller.h:16
Definition: player.h:10
void store(Tinman::CarInfo car_info)
Definition: player.cpp:77