OpenGTA/localplayer.h

33 lines
766 B
C
Raw Normal View History

2015-12-03 00:37:02 +00:00
#ifndef OGTA_LOCAL_PLAYER_H
#define OGTA_LOCAL_PLAYER_H
#include "Singleton.h"
2015-12-03 00:37:37 +00:00
#include "game_objects.h"
#include "entity_controller.h"
#include "id_sys.h"
2015-12-03 00:37:02 +00:00
namespace OpenGTA {
2015-12-03 00:37:37 +00:00
class PlayerController { // : public PedController { //public Pedestrian::Controller {
2015-12-03 00:37:02 +00:00
public:
2015-12-03 00:37:37 +00:00
PlayerController() {
playerId = TypeIdBlackBox::getPlayerId();
pc_ptr = NULL;
}
PedController & getCtrl() {
assert(pc_ptr);
return *pc_ptr;
}
void setCtrl(PedController & pc) {
pc_ptr = &pc;
}
private:
uint32_t playerId;
PedController * pc_ptr;
2015-12-03 00:37:02 +00:00
};
typedef Loki::SingletonHolder<PlayerController, Loki::CreateUsingNew,
Loki::DefaultLifetime, Loki::SingleThreaded> LocalPlayer;
}
#endif