1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-26 14:37:44 +00:00

New base class for anything actor related, not being used yet

This commit is contained in:
Mordred 2018-02-09 00:55:44 +01:00
parent 1f40bcf91b
commit e7b8c2cb22
2 changed files with 85 additions and 0 deletions

View file

@ -0,0 +1,7 @@
#include "GameObject.h"
Core::Entity::GameObject::GameObject( ObjKind type ) :
m_objKind( type )
{
}

View file

@ -0,0 +1,78 @@
#ifndef _GAME_OBJECT_H_
#define _GAME_OBJECT_H_
#include <common/Common.h>
#include <boost/enable_shared_from_this.hpp>
#include "Forwards.h"
#include <set>
#include <map>
#include <queue>
namespace Core {
namespace Entity {
/*!
\class GameObject
\brief Base class for all actor/objects
*/
class GameObject : public boost::enable_shared_from_this< GameObject >
{
public:
enum ObjKind : uint8_t
{
None = 0x00,
Player = 0x01,
BattleNpc = 0x02,
EventNpc = 0x03,
Treasure = 0x04,
Aetheryte = 0x05,
GatheringPoint = 0x06,
EventObj = 0x07,
Mount = 0x08,
Companion = 0x09,
Retainer = 0x0A,
Area = 0x0B,
Housing = 0x0C,
Cutscene = 0x0D,
CardStand = 0x0E,
};
protected:
/*! Position of the object */
Common::FFXIVARR_POSITION3 m_pos;
/*! Rotation of the object */
float m_rot;
/*! Id of the actor */
uint32_t m_id;
/*! Type of the actor */
ObjKind m_objKind;
public:
GameObject( ObjKind type );
virtual ~GameObject();
uint32_t getId() const;
ObjKind getObjKind() const;
Common::FFXIVARR_POSITION3& getPos();
void setPos( const Common::FFXIVARR_POSITION3& pos );
void setPos( float x, float y, float z );
float getRot() const;
void setRot( float rot );
bool isPlayer() const;
bool isBNpc() const;
bool isENpc() const;
PlayerPtr getAsPlayer();
BattleNpcPtr getAsBNpc();
EventNpcPtr getAsENpc();
};
}
}
#endif