2015-09-30 02:56:11 +02:00
|
|
|
#ifndef _MISC_MODEL_HPP_
|
|
|
|
#define _MISC_MODEL_HPP_
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
#include "Misc/Shared.hpp"
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
namespace SqMod {
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
class CModel : public IdentifierStorage< CModel, SQMOD_MODELID_CAP >
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// --------------------------------------------------------------------------------------------
|
|
|
|
static const CModel NIL;
|
|
|
|
// --------------------------------------------------------------------------------------------
|
|
|
|
CModel() noexcept;
|
|
|
|
CModel(SQInt32 id) noexcept;
|
|
|
|
CModel(const SQChar * name, SQInt32 id) noexcept;
|
|
|
|
// --------------------------------------------------------------------------------------------
|
|
|
|
CModel(const CModel & m) noexcept;
|
|
|
|
CModel(CModel && m) noexcept;
|
|
|
|
// --------------------------------------------------------------------------------------------
|
|
|
|
~CModel();
|
|
|
|
// --------------------------------------------------------------------------------------------
|
|
|
|
CModel & operator = (const CModel & m) noexcept;
|
|
|
|
CModel & operator = (CModel && m) noexcept;
|
|
|
|
// --------------------------------------------------------------------------------------------
|
|
|
|
CModel & operator = (SQInt32 id) noexcept;
|
|
|
|
// --------------------------------------------------------------------------------------------
|
|
|
|
bool operator == (const CModel & m) const noexcept;
|
|
|
|
bool operator != (const CModel & m) const noexcept;
|
|
|
|
bool operator < (const CModel & m) const noexcept;
|
|
|
|
bool operator > (const CModel & m) const noexcept;
|
|
|
|
bool operator <= (const CModel & m) const noexcept;
|
|
|
|
bool operator >= (const CModel & m) const noexcept;
|
|
|
|
// --------------------------------------------------------------------------------------------
|
|
|
|
operator SQInt32 () const noexcept { return m_ID; }
|
|
|
|
operator bool () const noexcept { return IsModelValid(m_ID); }
|
|
|
|
// --------------------------------------------------------------------------------------------
|
|
|
|
bool operator ! () const noexcept { return !IsModelValid(m_ID); }
|
|
|
|
// --------------------------------------------------------------------------------------------
|
|
|
|
SQInteger Cmp(const CModel & m) const noexcept;
|
|
|
|
// --------------------------------------------------------------------------------------------
|
|
|
|
const SQChar * ToString() const noexcept;
|
|
|
|
// --------------------------------------------------------------------------------------------
|
|
|
|
SQInteger GetID() const noexcept;
|
|
|
|
void SetID(SQInt32 id) noexcept;
|
|
|
|
// --------------------------------------------------------------------------------------------
|
|
|
|
CModel & SetnGet(SQInt32 id) noexcept;
|
|
|
|
// --------------------------------------------------------------------------------------------
|
|
|
|
const SQChar * GetGlobalTag() const noexcept;
|
|
|
|
void SetGlobalTag(const SQChar * tag) const noexcept;
|
|
|
|
// --------------------------------------------------------------------------------------------
|
|
|
|
SqObj & GetGlobalData() const noexcept;
|
|
|
|
void SetGlobalData(SqObj & data) const noexcept;
|
|
|
|
// --------------------------------------------------------------------------------------------
|
|
|
|
const SQChar * GetLocalTag() const noexcept;
|
|
|
|
void SetLocalTag(const SQChar * tag) noexcept;
|
|
|
|
// --------------------------------------------------------------------------------------------
|
|
|
|
SqObj & GetLocalData() noexcept;
|
|
|
|
void SetLocalData(SqObj & data) noexcept;
|
|
|
|
// --------------------------------------------------------------------------------------------
|
|
|
|
bool IsValid() const noexcept;
|
|
|
|
// --------------------------------------------------------------------------------------------
|
|
|
|
const SQChar * GetName() const noexcept;
|
|
|
|
// --------------------------------------------------------------------------------------------
|
|
|
|
bool IsWeapon() const noexcept;
|
|
|
|
bool IsActuallyWeapon() const noexcept;
|
|
|
|
// --------------------------------------------------------------------------------------------
|
|
|
|
Reference< CObject > Object(SQInt32 world, const Vector3 & pos, SQInt32 alpha, SQInt32 header, \
|
2015-10-11 23:25:03 +02:00
|
|
|
SqObj & payload) const noexcept;
|
2015-09-30 02:56:11 +02:00
|
|
|
Reference< CObject > Object(SQInt32 world, SQFloat x, SQFloat y, SQFloat z, SQInt32 alpha, \
|
2015-10-11 23:25:03 +02:00
|
|
|
SQInt32 header, SqObj & payload) const noexcept;
|
2015-09-30 02:56:11 +02:00
|
|
|
// --------------------------------------------------------------------------------------------
|
|
|
|
Reference< CPickup > Pickup(SQInt32 world, SQInt32 quantity, const Vector3 & pos, SQInt32 alpha, \
|
2015-10-11 23:25:03 +02:00
|
|
|
bool automatic, SQInt32 header, SqObj & payload) const noexcept;
|
2015-09-30 02:56:11 +02:00
|
|
|
Reference< CPickup > Pickup(SQInt32 world, SQInt32 quantity, SQFloat x, SQFloat y, SQFloat z, \
|
2015-10-11 23:25:03 +02:00
|
|
|
SQInt32 alpha, bool automatic, SQInt32 header, SqObj & payload) const noexcept;
|
2015-09-30 02:56:11 +02:00
|
|
|
private:
|
|
|
|
// --------------------------------------------------------------------------------------------
|
|
|
|
SQInt32 m_ID;
|
|
|
|
// --------------------------------------------------------------------------------------------
|
|
|
|
String m_Name;
|
|
|
|
// --------------------------------------------------------------------------------------------
|
|
|
|
SqTag m_Tag;
|
|
|
|
SqObj m_Data;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // Namespace:: SqMod
|
|
|
|
|
|
|
|
#endif // _MISC_MODEL_HPP_
|