OpenAstra
 
Loading...
Searching...
No Matches
player.h
1#ifndef PLAYER_H
2#define PLAYER_H
3
4#include <set>
5#include <string>
6#include <stdint.h>
7
8#include "gameobject.h"
9
10class SocketDevice;
11
12class Player
13 : public GameObject
14{
15public:
16 static constexpr char playerCategory[] = "player";
17 static constexpr char objectType[] = "player";
18
19 static std::shared_ptr<GameObject> createFromDump( ObjectId id, const std::string& type );
20 static std::shared_ptr<Player> createFromTemplate(const std::string& name,
21 const std::string& race );
22
23 Player(const std::string& name,
24 const std::string& race,
25 const nlohmann::json& player_dataitems);
26 Player( ObjectId id );
27 virtual ~Player();
28
29 void addShip( ObjectId ship_id );
30 void setHomestead( ObjectId homestead_id );
31
32 virtual void _finalizeUndump() final;
33
34private:
35};
36
37#endif // PLAYER_H
GameObject(const std::string &category, ObjectId id, const std::string &type)
Create a GameObject object.
Definition gameobject.cpp:38
const std::string & type() const
return the type (ship_xxx, station_xxx, planet_xxx...)
Definition gameobject.h:213
Definition gameid.hpp:9
virtual void _finalizeUndump() final
Gives the object an opportunity to perform some cleanup/inizialization after the entire object has be...
Definition player.cpp:73
Definition socketdevice.h:11