1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-06-15 22:57:12 +02:00

Major plugin refactor and cleanup.

Switched to POCO library for unified platform/library interface.
Deprecated the external module API. It was creating more problems than solving.
Removed most built-in libraries in favor of system libraries for easier maintenance.
Cleaned and secured code with help from static analyzers.
This commit is contained in:
Sandu Liviu Catalin
2021-01-30 08:51:39 +02:00
parent e0e34b4030
commit 4a6bfc086c
6219 changed files with 1209835 additions and 454916 deletions

View File

@ -1,16 +1,16 @@
// ------------------------------------------------------------------------------------------------
#include "Entity/Blip.hpp"
#include "Core.hpp"
#include "Misc/Tasks.hpp"
#include "Core/Tasks.hpp"
// ------------------------------------------------------------------------------------------------
namespace SqMod {
// ------------------------------------------------------------------------------------------------
SQMODE_DECL_TYPENAME(Typename, _SC("SqBlip"))
SQMOD_DECL_TYPENAME(Typename, _SC("SqBlip"))
// ------------------------------------------------------------------------------------------------
const Int32 CBlip::Max = SQMOD_BLIP_POOL;
const int32_t CBlip::Max = SQMOD_BLIP_POOL;
// ------------------------------------------------------------------------------------------------
SQInteger CBlip::SqGetNull(HSQUIRRELVM vm)
@ -26,9 +26,9 @@ LightObj & CBlip::GetNull()
}
// ------------------------------------------------------------------------------------------------
CBlip::CBlip(Int32 id)
CBlip::CBlip(int32_t id)
: m_ID(VALID_ENTITYGETEX(id, SQMOD_BLIP_POOL))
, m_Tag(ToStrF("%d", id))
, m_Tag(fmt::format("{}", id))
{
/* ... */
}
@ -84,7 +84,7 @@ void CBlip::SetData(LightObj & data)
}
// ------------------------------------------------------------------------------------------------
bool CBlip::Destroy(Int32 header, LightObj & payload)
bool CBlip::Destroy(int32_t header, LightObj & payload) const
{
// Validate the managed identifier
Validate();
@ -102,16 +102,16 @@ LightObj & CBlip::GetEvents() const
}
// ------------------------------------------------------------------------------------------------
void CBlip::CustomEvent(Int32 header, LightObj & payload) const
void CBlip::CustomEvent(int32_t header, LightObj & payload) const
{
// Validate the managed identifier
Validate();
// Perfrom the requested action
// Perform the requested action
Core::Get().EmitBlipCustom(m_ID, header, payload);
}
// ------------------------------------------------------------------------------------------------
Int32 CBlip::GetWorld() const
int32_t CBlip::GetWorld() const
{
// Validate the managed identifier
Validate();
@ -120,7 +120,7 @@ Int32 CBlip::GetWorld() const
}
// ------------------------------------------------------------------------------------------------
Int32 CBlip::GetScale() const
int32_t CBlip::GetScale() const
{
// Validate the managed identifier
Validate();
@ -147,7 +147,7 @@ const Color4 & CBlip::GetColor() const
}
// ------------------------------------------------------------------------------------------------
Int32 CBlip::GetSprID() const
int32_t CBlip::GetSprID() const
{
// Validate the managed identifier
Validate();
@ -156,7 +156,7 @@ Int32 CBlip::GetSprID() const
}
// ------------------------------------------------------------------------------------------------
Float32 CBlip::GetPositionX() const
float CBlip::GetPositionX() const
{
// Validate the managed identifier
Validate();
@ -165,7 +165,7 @@ Float32 CBlip::GetPositionX() const
}
// ------------------------------------------------------------------------------------------------
Float32 CBlip::GetPositionY() const
float CBlip::GetPositionY() const
{
// Validate the managed identifier
Validate();
@ -174,7 +174,7 @@ Float32 CBlip::GetPositionY() const
}
// ------------------------------------------------------------------------------------------------
Float32 CBlip::GetPositionZ() const
float CBlip::GetPositionZ() const
{
// Validate the managed identifier
Validate();
@ -183,7 +183,7 @@ Float32 CBlip::GetPositionZ() const
}
// ------------------------------------------------------------------------------------------------
Int32 CBlip::GetColorR() const
int32_t CBlip::GetColorR() const
{
// Validate the managed identifier
Validate();
@ -192,7 +192,7 @@ Int32 CBlip::GetColorR() const
}
// ------------------------------------------------------------------------------------------------
Int32 CBlip::GetColorG() const
int32_t CBlip::GetColorG() const
{
// Validate the managed identifier
Validate();
@ -201,7 +201,7 @@ Int32 CBlip::GetColorG() const
}
// ------------------------------------------------------------------------------------------------
Int32 CBlip::GetColorB() const
int32_t CBlip::GetColorB() const
{
// Validate the managed identifier
Validate();
@ -210,7 +210,7 @@ Int32 CBlip::GetColorB() const
}
// ------------------------------------------------------------------------------------------------
Int32 CBlip::GetColorA() const
int32_t CBlip::GetColorA() const
{
// Validate the managed identifier
Validate();
@ -219,64 +219,64 @@ Int32 CBlip::GetColorA() const
}
// ------------------------------------------------------------------------------------------------
static LightObj & Blip_CreateEx(Int32 world, Float32 x, Float32 y, Float32 z, Int32 scale,
Uint8 r, Uint8 g, Uint8 b, Uint8 a, Int32 sprid)
static LightObj & Blip_CreateEx1a(int32_t world, float x, float y, float z, int32_t scale,
uint8_t r, uint8_t g, uint8_t b, uint8_t a, int32_t spr_id)
{
return Core::Get().NewBlip(-1, world, x, y, z, scale, SQMOD_PACK_RGBA(r, g, b, a), sprid, // NOLINT(hicpp-signed-bitwise)
return Core::Get().NewBlip(-1, world, x, y, z, scale, SQMOD_PACK_RGBA(r, g, b, a), spr_id, // NOLINT(hicpp-signed-bitwise)
SQMOD_CREATE_DEFAULT, NullLightObj());
}
static LightObj & Blip_CreateEx(Int32 world, Float32 x, Float32 y, Float32 z, Int32 scale,
Uint8 r, Uint8 g, Uint8 b, Uint8 a, Int32 sprid,
Int32 header, LightObj & payload)
static LightObj & Blip_CreateEx1b(int32_t world, float x, float y, float z, int32_t scale,
uint8_t r, uint8_t g, uint8_t b, uint8_t a, int32_t spr_id,
int32_t header, LightObj & payload)
{
return Core::Get().NewBlip(-1, world, x, y, z, scale, SQMOD_PACK_RGBA(r, g, b, a), sprid, // NOLINT(hicpp-signed-bitwise)
return Core::Get().NewBlip(-1, world, x, y, z, scale, SQMOD_PACK_RGBA(r, g, b, a), spr_id, // NOLINT(hicpp-signed-bitwise)
header, payload);
}
// ------------------------------------------------------------------------------------------------
static LightObj & Blip_CreateEx(Int32 index, Int32 world, Float32 x, Float32 y, Float32 z,
Int32 scale, Uint8 r, Uint8 g, Uint8 b, Uint8 a, Int32 sprid)
static LightObj & Blip_CreateEx2a(int32_t index, int32_t world, float x, float y, float z,
int32_t scale, uint8_t r, uint8_t g, uint8_t b, uint8_t a, int32_t spr_id)
{
return Core::Get().NewBlip(index, world, x, y, z, scale, SQMOD_PACK_RGBA(r, g, b, a), sprid, // NOLINT(hicpp-signed-bitwise)
return Core::Get().NewBlip(index, world, x, y, z, scale, SQMOD_PACK_RGBA(r, g, b, a), spr_id, // NOLINT(hicpp-signed-bitwise)
SQMOD_CREATE_DEFAULT, NullLightObj());
}
static LightObj & Blip_CreateEx(Int32 index, Int32 world, Float32 x, Float32 y, Float32 z, Int32 scale,
Uint8 r, Uint8 g, Uint8 b, Uint8 a, Int32 sprid,
Int32 header, LightObj & payload)
static LightObj & Blip_CreateEx2b(int32_t index, int32_t world, float x, float y, float z, int32_t scale,
uint8_t r, uint8_t g, uint8_t b, uint8_t a, int32_t spr_id,
int32_t header, LightObj & payload)
{
return Core::Get().NewBlip(index, world, x, y, z, scale, SQMOD_PACK_RGBA(r, g, b, a), sprid, // NOLINT(hicpp-signed-bitwise)
return Core::Get().NewBlip(index, world, x, y, z, scale, SQMOD_PACK_RGBA(r, g, b, a), spr_id, // NOLINT(hicpp-signed-bitwise)
header, payload);
}
// ------------------------------------------------------------------------------------------------
static LightObj & Blip_Create(Int32 world, const Vector3 & pos, Int32 scale, const Color4 & color,
Int32 sprid)
static LightObj & Blip_Create1a(int32_t world, const Vector3 & pos, int32_t scale, const Color4 & color,
int32_t spr_id)
{
return Core::Get().NewBlip(-1, world, pos.x, pos.y, pos.z, scale, color.GetRGBA(), sprid,
return Core::Get().NewBlip(-1, world, pos.x, pos.y, pos.z, scale, color.GetRGBA(), spr_id,
SQMOD_CREATE_DEFAULT, NullLightObj());
}
static LightObj & Blip_Create(Int32 world, const Vector3 & pos, Int32 scale, const Color4 & color,
Int32 sprid, Int32 header, LightObj & payload)
static LightObj & Blip_Create1b(int32_t world, const Vector3 & pos, int32_t scale, const Color4 & color,
int32_t spr_id, int32_t header, LightObj & payload)
{
return Core::Get().NewBlip(-1, world, pos.x, pos.y, pos.z, scale, color.GetRGBA(), sprid,
return Core::Get().NewBlip(-1, world, pos.x, pos.y, pos.z, scale, color.GetRGBA(), spr_id,
header, payload);
}
// ------------------------------------------------------------------------------------------------
static LightObj & Blip_Create(Int32 index, Int32 world, const Vector3 & pos, Int32 scale,
const Color4 & color, Int32 sprid)
static LightObj & Blip_Create2a(int32_t index, int32_t world, const Vector3 & pos, int32_t scale,
const Color4 & color, int32_t spr_id)
{
return Core::Get().NewBlip(index, world, pos.x, pos.y, pos.z, scale, color.GetRGBA(), sprid,
return Core::Get().NewBlip(index, world, pos.x, pos.y, pos.z, scale, color.GetRGBA(), spr_id,
SQMOD_CREATE_DEFAULT, NullLightObj());
}
static LightObj & Blip_Create(Int32 index, Int32 world, const Vector3 & pos, Int32 scale,
const Color4 & color, Int32 sprid, Int32 header, LightObj & payload)
static LightObj & Blip_Create2b(int32_t index, int32_t world, const Vector3 & pos, int32_t scale,
const Color4 & color, int32_t spr_id, int32_t header, LightObj & payload)
{
return Core::Get().NewBlip(index, world, pos.x, pos.y, pos.z, scale, color.GetRGBA(), sprid,
return Core::Get().NewBlip(index, world, pos.x, pos.y, pos.z, scale, color.GetRGBA(), spr_id,
header, payload);
}
@ -300,9 +300,9 @@ void Register_CBlip(HSQUIRRELVM vm)
.FmtFunc(_SC("SetTag"), &CBlip::ApplyTag)
.Func(_SC("CustomEvent"), &CBlip::CustomEvent)
// Core Overloads
.Overload< bool (CBlip::*)(void) >(_SC("Destroy"), &CBlip::Destroy)
.Overload< bool (CBlip::*)(Int32) >(_SC("Destroy"), &CBlip::Destroy)
.Overload< bool (CBlip::*)(Int32, LightObj &) >(_SC("Destroy"), &CBlip::Destroy)
.Overload(_SC("Destroy"), &CBlip::Destroy0)
.Overload(_SC("Destroy"), &CBlip::Destroy1)
.Overload(_SC("Destroy"), &CBlip::Destroy)
// Properties
.Prop(_SC("World"), &CBlip::GetWorld)
.Prop(_SC("Scale"), &CBlip::GetScale)
@ -319,22 +319,14 @@ void Register_CBlip(HSQUIRRELVM vm)
.Prop(_SC("Blue"), &CBlip::GetColorB)
.Prop(_SC("Alpha"), &CBlip::GetColorA)
// Static Overloads
.StaticOverload< LightObj & (*)(Int32, Float32, Float32, Float32, Int32, Uint8, Uint8, Uint8, Uint8, Int32) >
(_SC("CreateEx"), &Blip_CreateEx)
.StaticOverload< LightObj & (*)(Int32, Float32, Float32, Float32, Int32, Uint8, Uint8, Uint8, Uint8, Int32, Int32, LightObj &) >
(_SC("CreateEx"), &Blip_CreateEx)
.StaticOverload< LightObj & (*)(Int32, Int32, Float32, Float32, Float32, Int32, Uint8, Uint8, Uint8, Uint8, Int32) >
(_SC("CreateEx"), &Blip_CreateEx)
.StaticOverload< LightObj & (*)(Int32, Int32, Float32, Float32, Float32, Int32, Uint8, Uint8, Uint8, Uint8, Int32, Int32, LightObj &) >
(_SC("CreateEx"), &Blip_CreateEx)
.StaticOverload< LightObj & (*)(Int32, const Vector3 &, Int32, const Color4 &, Int32) >
(_SC("Create"), &Blip_Create)
.StaticOverload< LightObj & (*)(Int32, const Vector3 &, Int32, const Color4 &, Int32, Int32, LightObj &) >
(_SC("Create"), &Blip_Create)
.StaticOverload< LightObj & (*)(Int32, Int32, const Vector3 &, Int32, const Color4 &, Int32) >
(_SC("Create"), &Blip_Create)
.StaticOverload< LightObj & (*)(Int32, Int32, const Vector3 &, Int32, const Color4 &, Int32, Int32, LightObj &) >
(_SC("Create"), &Blip_Create)
.StaticOverload(_SC("CreateEx"), &Blip_CreateEx1a)
.StaticOverload(_SC("CreateEx"), &Blip_CreateEx1b)
.StaticOverload(_SC("CreateEx"), &Blip_CreateEx2a)
.StaticOverload(_SC("CreateEx"), &Blip_CreateEx2b)
.StaticOverload(_SC("Create"), &Blip_Create1a)
.StaticOverload(_SC("Create"), &Blip_Create1b)
.StaticOverload(_SC("Create"), &Blip_Create2a)
.StaticOverload(_SC("Create"), &Blip_Create2b)
// Raw Squirrel Methods
.SquirrelFunc(_SC("NullInst"), &CBlip::SqGetNull)
.SquirrelFunc(_SC("MakeTask"), &Tasks::MakeTask< CBlip, ENT_BLIP >)

View File

@ -1,7 +1,7 @@
#pragma once
// ------------------------------------------------------------------------------------------------
#include "Base/Shared.hpp"
#include "Core/Common.hpp"
// ------------------------------------------------------------------------------------------------
namespace SqMod {
@ -13,13 +13,14 @@ class CBlip
{
// --------------------------------------------------------------------------------------------
friend class Core;
friend class BlipInst;
private:
/* --------------------------------------------------------------------------------------------
* Identifier of the managed entity.
*/
Int32 m_ID;
int32_t m_ID;
/* --------------------------------------------------------------------------------------------
* User tag associated with this instance.
@ -34,14 +35,14 @@ private:
/* --------------------------------------------------------------------------------------------
* Base constructor.
*/
explicit CBlip(Int32 id);
explicit CBlip(int32_t id);
public:
/* --------------------------------------------------------------------------------------------
* Maximum possible number that could represent an identifier for this entity type.
*/
static const Int32 Max;
static const int32_t Max;
/* --------------------------------------------------------------------------------------------
* Copy constructor. (disabled)
@ -77,7 +78,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Used by the script engine to convert an instance of this type to a string.
*/
const String & ToString() const;
SQMOD_NODISCARD const String & ToString() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the associated null entity instance.
@ -87,12 +88,12 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve the associated null entity instance.
*/
static LightObj & GetNull();
SQMOD_NODISCARD static LightObj & GetNull();
/* --------------------------------------------------------------------------------------------
* Retrieve the identifier of the entity managed by this instance.
*/
Int32 GetID() const
SQMOD_NODISCARD int32_t GetID() const
{
return m_ID;
}
@ -100,7 +101,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Check whether this instance manages a valid entity.
*/
bool IsActive() const
SQMOD_NODISCARD bool IsActive() const
{
return VALID_ENTITY(m_ID);
}
@ -108,7 +109,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve the associated user tag.
*/
const String & GetTag() const;
SQMOD_NODISCARD const String & GetTag() const;
/* --------------------------------------------------------------------------------------------
* Modify the associated user tag.
@ -123,7 +124,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve the associated user data.
*/
LightObj & GetData();
SQMOD_NODISCARD LightObj & GetData();
/* --------------------------------------------------------------------------------------------
* Modify the associated user data.
@ -133,7 +134,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Destroy the managed blip entity.
*/
bool Destroy()
bool Destroy0() const // NOLINT(modernize-use-nodiscard)
{
return Destroy(0, NullLightObj());
}
@ -141,7 +142,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Destroy the managed blip entity.
*/
bool Destroy(Int32 header)
bool Destroy1(int32_t header) const // NOLINT(modernize-use-nodiscard)
{
return Destroy(header, NullLightObj());
}
@ -149,77 +150,77 @@ public:
/* --------------------------------------------------------------------------------------------
* Destroy the managed blip entity.
*/
bool Destroy(Int32 header, LightObj & payload);
bool Destroy(int32_t header, LightObj & payload) const; // NOLINT(modernize-use-nodiscard)
/* --------------------------------------------------------------------------------------------
* Retrieve the events table of this entity.
*/
LightObj & GetEvents() const;
SQMOD_NODISCARD LightObj & GetEvents() const;
/* --------------------------------------------------------------------------------------------
* Emit a custom event for the managed entity
*/
void CustomEvent(Int32 header, LightObj & payload) const;
void CustomEvent(int32_t header, LightObj & payload) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the world in which the referenced blip entity exists.
*/
Int32 GetWorld() const;
SQMOD_NODISCARD int32_t GetWorld() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the scale of the managed blip entity.
*/
Int32 GetScale() const;
SQMOD_NODISCARD int32_t GetScale() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the position of the managed blip entity.
*/
const Vector3 & GetPosition() const;
SQMOD_NODISCARD const Vector3 & GetPosition() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the color of the managed blip entity.
*/
const Color4 & GetColor() const;
SQMOD_NODISCARD const Color4 & GetColor() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the identifier of the sprite used by the managed blip entity.
*/
Int32 GetSprID() const;
SQMOD_NODISCARD int32_t GetSprID() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the position on the x axis of the managed blip entity.
*/
Float32 GetPositionX() const;
SQMOD_NODISCARD float GetPositionX() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the position on the y axis of the managed blip entity.
*/
Float32 GetPositionY() const;
SQMOD_NODISCARD float GetPositionY() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the position on the z axis of the managed blip entity.
*/
Float32 GetPositionZ() const;
SQMOD_NODISCARD float GetPositionZ() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the red color of the managed blip entity.
*/
Int32 GetColorR() const;
SQMOD_NODISCARD int32_t GetColorR() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the green color of the managed blip entity.
*/
Int32 GetColorG() const;
SQMOD_NODISCARD int32_t GetColorG() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the blue color of the managed blip entity.
*/
Int32 GetColorB() const;
SQMOD_NODISCARD int32_t GetColorB() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the alpha transparency of the managed blip entity.
*/
Int32 GetColorA() const;
SQMOD_NODISCARD int32_t GetColorA() const;
};
} // Namespace:: SqMod

View File

@ -4,16 +4,16 @@
#include "Base/Color4.hpp"
#include "Base/Vector3.hpp"
#include "Core.hpp"
#include "Misc/Tasks.hpp"
#include "Core/Tasks.hpp"
// ------------------------------------------------------------------------------------------------
namespace SqMod {
// ------------------------------------------------------------------------------------------------
SQMODE_DECL_TYPENAME(Typename, _SC("SqCheckpoint"))
SQMOD_DECL_TYPENAME(Typename, _SC("SqCheckpoint"))
// ------------------------------------------------------------------------------------------------
const Int32 CCheckpoint::Max = SQMOD_CHECKPOINT_POOL;
const int32_t CCheckpoint::Max = SQMOD_CHECKPOINT_POOL;
// ------------------------------------------------------------------------------------------------
SQInteger CCheckpoint::SqGetNull(HSQUIRRELVM vm)
@ -29,9 +29,9 @@ LightObj & CCheckpoint::GetNull()
}
// ------------------------------------------------------------------------------------------------
CCheckpoint::CCheckpoint(Int32 id)
CCheckpoint::CCheckpoint(int32_t id)
: m_ID(VALID_ENTITYGETEX(id, SQMOD_CHECKPOINT_POOL))
, m_Tag(ToStrF("%d", id)), m_Data(), m_CircularLocks(0)
, m_Tag(fmt::format("{}", id)), m_Data(), m_CircularLocks(0)
{
/* ... */
}
@ -87,7 +87,7 @@ void CCheckpoint::SetData(LightObj & data)
}
// ------------------------------------------------------------------------------------------------
bool CCheckpoint::Destroy(Int32 header, LightObj & payload)
bool CCheckpoint::Destroy(int32_t header, LightObj & payload) const
{
// Validate the managed identifier
Validate();
@ -105,7 +105,7 @@ LightObj & CCheckpoint::GetEvents() const
}
// ------------------------------------------------------------------------------------------------
void CCheckpoint::CustomEvent(Int32 header, LightObj & payload) const
void CCheckpoint::CustomEvent(int32_t header, LightObj & payload) const
{
// Validate the managed identifier
Validate();
@ -137,7 +137,7 @@ bool CCheckpoint::IsSphere() const
}
// ------------------------------------------------------------------------------------------------
Int32 CCheckpoint::GetWorld() const
int32_t CCheckpoint::GetWorld() const
{
// Validate the managed identifier
Validate();
@ -146,12 +146,12 @@ Int32 CCheckpoint::GetWorld() const
}
// ------------------------------------------------------------------------------------------------
void CCheckpoint::SetWorld(Int32 world)
void CCheckpoint::SetWorld(int32_t world)
{
// Validate the managed identifier
Validate();
// Grab the current value for this property
const Int32 current = _Func->GetCheckPointWorld(m_ID);
const int32_t current = _Func->GetCheckPointWorld(m_ID);
// Don't even bother if it's the same value
if (current == world)
{
@ -175,7 +175,7 @@ Color4 CCheckpoint::GetColor() const
// Validate the managed identifier
Validate();
// Reserve some temporary floats to retrieve the color information
Int32 r, g, b, a;
int32_t r, g, b, a;
// Query the server for the color values
_Func->GetCheckPointColour(m_ID, &r, &g, &b, &a);
// Return the requested information
@ -193,7 +193,7 @@ void CCheckpoint::SetColor(const Color4 & col) const
}
// ------------------------------------------------------------------------------------------------
void CCheckpoint::SetColorEx(Uint8 r, Uint8 g, Uint8 b) const
void CCheckpoint::SetColorEx3(uint8_t r, uint8_t g, uint8_t b) const
{
// Validate the managed identifier
Validate();
@ -202,7 +202,7 @@ void CCheckpoint::SetColorEx(Uint8 r, Uint8 g, Uint8 b) const
}
// ------------------------------------------------------------------------------------------------
void CCheckpoint::SetColorEx(Uint8 r, Uint8 g, Uint8 b, Uint8 a) const
void CCheckpoint::SetColorEx4(uint8_t r, uint8_t g, uint8_t b, uint8_t a) const
{
// Validate the managed identifier
Validate();
@ -233,7 +233,7 @@ void CCheckpoint::SetPosition(const Vector3 & pos) const
}
// ------------------------------------------------------------------------------------------------
void CCheckpoint::SetPositionEx(Float32 x, Float32 y, Float32 z) const
void CCheckpoint::SetPositionEx(float x, float y, float z) const
{
// Validate the managed identifier
Validate();
@ -242,7 +242,7 @@ void CCheckpoint::SetPositionEx(Float32 x, Float32 y, Float32 z) const
}
// ------------------------------------------------------------------------------------------------
Float32 CCheckpoint::GetRadius() const
float CCheckpoint::GetRadius() const
{
// Validate the managed identifier
Validate();
@ -251,12 +251,12 @@ Float32 CCheckpoint::GetRadius() const
}
// ------------------------------------------------------------------------------------------------
void CCheckpoint::SetRadius(Float32 radius)
void CCheckpoint::SetRadius(float radius)
{
// Validate the managed identifier
Validate();
// Grab the current value for this property
const Float32 current = _Func->GetCheckPointRadius(m_ID);
const float current = _Func->GetCheckPointRadius(m_ID);
// Avoid property unwind from a recursive call
_Func->SetCheckPointRadius(m_ID, radius);
// Avoid infinite recursive event loops
@ -279,7 +279,7 @@ LightObj & CCheckpoint::GetOwner() const
}
// ------------------------------------------------------------------------------------------------
Int32 CCheckpoint::GetOwnerID() const
int32_t CCheckpoint::GetOwnerID() const
{
// Validate the managed identifier
Validate();
@ -288,12 +288,12 @@ Int32 CCheckpoint::GetOwnerID() const
}
// ------------------------------------------------------------------------------------------------
Float32 CCheckpoint::GetPositionX() const
float CCheckpoint::GetPositionX() const
{
// Validate the managed identifier
Validate();
// Clear previous position information, if any
Float32 x = 0.0f, dummy;
float x = 0.0f, dummy;
// Query the server for the requested component value
_Func->GetCheckPointPosition(m_ID, &x, &dummy, &dummy);
// Return the requested information
@ -301,12 +301,12 @@ Float32 CCheckpoint::GetPositionX() const
}
// ------------------------------------------------------------------------------------------------
Float32 CCheckpoint::GetPositionY() const
float CCheckpoint::GetPositionY() const
{
// Validate the managed identifier
Validate();
// Clear previous position information, if any
Float32 y = 0.0f, dummy;
float y = 0.0f, dummy;
// Query the server for the requested component value
_Func->GetCheckPointPosition(m_ID, &dummy, &y, &dummy);
// Return the requested information
@ -314,12 +314,12 @@ Float32 CCheckpoint::GetPositionY() const
}
// ------------------------------------------------------------------------------------------------
Float32 CCheckpoint::GetPositionZ() const
float CCheckpoint::GetPositionZ() const
{
// Validate the managed identifier
Validate();
// Clear previous position information, if any
Float32 z = 0.0f, dummy;
float z = 0.0f, dummy;
// Query the server for the requested component value
_Func->GetCheckPointPosition(m_ID, &dummy, &dummy, &z);
// Return the requested information
@ -327,12 +327,12 @@ Float32 CCheckpoint::GetPositionZ() const
}
// ------------------------------------------------------------------------------------------------
void CCheckpoint::SetPositionX(Float32 x) const
void CCheckpoint::SetPositionX(float x) const
{
// Validate the managed identifier
Validate();
// Reserve some temporary floats to retrieve the missing components
Float32 y, z, dummy;
float y, z, dummy;
// Retrieve the current values for unchanged components
_Func->GetCheckPointPosition(m_ID, &dummy, &y, &z);
// Perform the requested operation
@ -340,12 +340,12 @@ void CCheckpoint::SetPositionX(Float32 x) const
}
// ------------------------------------------------------------------------------------------------
void CCheckpoint::SetPositionY(Float32 y) const
void CCheckpoint::SetPositionY(float y) const
{
// Validate the managed identifier
Validate();
// Reserve some temporary floats to retrieve the missing components
Float32 x, z, dummy;
float x, z, dummy;
// Retrieve the current values for unchanged components
_Func->GetCheckPointPosition(m_ID, &x, &dummy, &z);
// Perform the requested operation
@ -353,12 +353,12 @@ void CCheckpoint::SetPositionY(Float32 y) const
}
// ------------------------------------------------------------------------------------------------
void CCheckpoint::SetPositionZ(Float32 z) const
void CCheckpoint::SetPositionZ(float z) const
{
// Validate the managed identifier
Validate();
// Reserve some temporary floats to retrieve the missing components
Float32 x, y, dummy;
float x, y, dummy;
// Retrieve the current values for unchanged components
_Func->GetCheckPointPosition(m_ID, &x, &y, &dummy);
// Perform the requested operation
@ -366,12 +366,12 @@ void CCheckpoint::SetPositionZ(Float32 z) const
}
// ------------------------------------------------------------------------------------------------
Int32 CCheckpoint::GetColorR() const
int32_t CCheckpoint::GetColorR() const
{
// Validate the managed identifier
Validate();
// Clear previous color information, if any
Int32 r = 0, dummy;
int32_t r = 0, dummy;
// Query the server for the requested component value
_Func->GetCheckPointColour(m_ID, &r, &dummy, &dummy, &dummy);
// Return the requested information
@ -379,12 +379,12 @@ Int32 CCheckpoint::GetColorR() const
}
// ------------------------------------------------------------------------------------------------
Int32 CCheckpoint::GetColorG() const
int32_t CCheckpoint::GetColorG() const
{
// Validate the managed identifier
Validate();
// Clear previous color information, if any
Int32 g = 0, dummy;
int32_t g = 0, dummy;
// Query the server for the requested component value
_Func->GetCheckPointColour(m_ID, &dummy, &g, &dummy, &dummy);
// Return the requested information
@ -392,12 +392,12 @@ Int32 CCheckpoint::GetColorG() const
}
// ------------------------------------------------------------------------------------------------
Int32 CCheckpoint::GetColorB() const
int32_t CCheckpoint::GetColorB() const
{
// Validate the managed identifier
Validate();
// Clear previous color information, if any
Int32 b = 0, dummy;
int32_t b = 0, dummy;
// Query the server for the requested component value
_Func->GetCheckPointColour(m_ID, &dummy, &dummy, &b, &dummy);
// Return the requested information
@ -405,12 +405,12 @@ Int32 CCheckpoint::GetColorB() const
}
// ------------------------------------------------------------------------------------------------
Int32 CCheckpoint::GetColorA() const
int32_t CCheckpoint::GetColorA() const
{
// Validate the managed identifier
Validate();
// Clear previous color information, if any
Int32 a = 0, dummy;
int32_t a = 0, dummy;
// Query the server for the requested component value
_Func->GetCheckPointColour(m_ID, &dummy, &dummy, &dummy, &a);
// Return the requested information
@ -418,12 +418,12 @@ Int32 CCheckpoint::GetColorA() const
}
// ------------------------------------------------------------------------------------------------
void CCheckpoint::SetColorR(Int32 r) const
void CCheckpoint::SetColorR(int32_t r) const
{
// Validate the managed identifier
Validate();
// Reserve some temporary integers to retrieve the missing components
Int32 g, b, a, dummy;
int32_t g, b, a, dummy;
// Retrieve the current values for unchanged components
_Func->GetCheckPointColour(m_ID, &dummy, &g, &b, &a);
// Perform the requested operation
@ -431,12 +431,12 @@ void CCheckpoint::SetColorR(Int32 r) const
}
// ------------------------------------------------------------------------------------------------
void CCheckpoint::SetColorG(Int32 g) const
void CCheckpoint::SetColorG(int32_t g) const
{
// Validate the managed identifier
Validate();
// Reserve some temporary integers to retrieve the missing components
Int32 r, b, a, dummy;
int32_t r, b, a, dummy;
// Retrieve the current values for unchanged components
_Func->GetCheckPointColour(m_ID, &r, &dummy, &b, &a);
// Perform the requested operation
@ -444,12 +444,12 @@ void CCheckpoint::SetColorG(Int32 g) const
}
// ------------------------------------------------------------------------------------------------
void CCheckpoint::SetColorB(Int32 b) const
void CCheckpoint::SetColorB(int32_t b) const
{
// Validate the managed identifier
Validate();
// Reserve some temporary integers to retrieve the missing components
Int32 r, g, a, dummy;
int32_t r, g, a, dummy;
// Retrieve the current values for unchanged components
_Func->GetCheckPointColour(m_ID, &r, &g, &dummy, &a);
// Perform the requested operation
@ -457,12 +457,12 @@ void CCheckpoint::SetColorB(Int32 b) const
}
// ------------------------------------------------------------------------------------------------
void CCheckpoint::SetColorA(Int32 a) const
void CCheckpoint::SetColorA(int32_t a) const
{
// Validate the managed identifier
Validate();
// Reserve some temporary integers to retrieve the missing components
Int32 r, g, b, dummy;
int32_t r, g, b, dummy;
// Retrieve the current values for unchanged components
_Func->GetCheckPointColour(m_ID, &r, &g, &b, &dummy);
// Perform the requested operation
@ -470,32 +470,32 @@ void CCheckpoint::SetColorA(Int32 a) const
}
// ------------------------------------------------------------------------------------------------
static LightObj & Checkpoint_CreateEx(Int32 world, bool sphere, Float32 x, Float32 y, Float32 z,
Uint8 r, Uint8 g, Uint8 b, Uint8 a, Float32 radius)
static LightObj & Checkpoint_CreateEx1a(int32_t world, bool sphere, float x, float y, float z,
uint8_t r, uint8_t g, uint8_t b, uint8_t a, float radius)
{
return Core::Get().NewCheckpoint(-1, world, sphere, x, y, z, r, g, b, a, radius,
SQMOD_CREATE_DEFAULT, NullLightObj());
}
static LightObj & Checkpoint_CreateEx(Int32 world, bool sphere, Float32 x, Float32 y, Float32 z,
Uint8 r, Uint8 g, Uint8 b, Uint8 a, Float32 radius,
Int32 header, LightObj & payload)
static LightObj & Checkpoint_CreateEx1b(int32_t world, bool sphere, float x, float y, float z,
uint8_t r, uint8_t g, uint8_t b, uint8_t a, float radius,
int32_t header, LightObj & payload)
{
return Core::Get().NewCheckpoint(-1, world, sphere, x, y, z, r, g, b, a,
radius, header, payload);
}
// ------------------------------------------------------------------------------------------------
static LightObj & Checkpoint_Create(Int32 world, bool sphere, const Vector3 & pos,
const Color4 & color, Float32 radius)
static LightObj & Checkpoint_Create1a(int32_t world, bool sphere, const Vector3 & pos,
const Color4 & color, float radius)
{
return Core::Get().NewCheckpoint(-1, world, sphere, pos.x, pos.y, pos.z,
color.r, color.g, color.b, color.a, radius,
SQMOD_CREATE_DEFAULT, NullLightObj());
}
static LightObj & Checkpoint_Create(Int32 world, bool sphere, const Vector3 & pos,
const Color4 & color, Float32 radius, Int32 header, LightObj & payload)
static LightObj & Checkpoint_Create1b(int32_t world, bool sphere, const Vector3 & pos,
const Color4 & color, float radius, int32_t header, LightObj & payload)
{
return Core::Get().NewCheckpoint(-1, world, sphere, pos.x, pos.y, pos.z,
color.r, color.g, color.b, color.a, radius, header, payload);
@ -521,9 +521,9 @@ void Register_CCheckpoint(HSQUIRRELVM vm)
.FmtFunc(_SC("SetTag"), &CCheckpoint::ApplyTag)
.Func(_SC("CustomEvent"), &CCheckpoint::CustomEvent)
// Core Overloads
.Overload< bool (CCheckpoint::*)(void) >(_SC("Destroy"), &CCheckpoint::Destroy)
.Overload< bool (CCheckpoint::*)(Int32) >(_SC("Destroy"), &CCheckpoint::Destroy)
.Overload< bool (CCheckpoint::*)(Int32, LightObj &) >(_SC("Destroy"), &CCheckpoint::Destroy)
.Overload(_SC("Destroy"), &CCheckpoint::Destroy0)
.Overload(_SC("Destroy"), &CCheckpoint::Destroy1)
.Overload(_SC("Destroy"), &CCheckpoint::Destroy)
// Properties
.Prop(_SC("Sphere"), &CCheckpoint::IsSphere)
.Prop(_SC("World"), &CCheckpoint::GetWorld, &CCheckpoint::SetWorld)
@ -546,19 +546,13 @@ void Register_CCheckpoint(HSQUIRRELVM vm)
.Func(_SC("SetPos"), &CCheckpoint::SetPositionEx)
.Func(_SC("SetPosition"), &CCheckpoint::SetPositionEx)
// Member Overloads
.Overload< void (CCheckpoint::*)(Uint8, Uint8, Uint8) const >
(_SC("SetColor"), &CCheckpoint::SetColorEx)
.Overload< void (CCheckpoint::*)(Uint8, Uint8, Uint8, Uint8) const >
(_SC("SetColor"), &CCheckpoint::SetColorEx)
.Overload(_SC("SetColor"), &CCheckpoint::SetColorEx3)
.Overload(_SC("SetColor"), &CCheckpoint::SetColorEx4)
// Static Overloads
.StaticOverload< LightObj & (*)(Int32, bool, Float32, Float32, Float32, Uint8, Uint8, Uint8, Uint8, Float32) >
(_SC("CreateEx"), &Checkpoint_CreateEx)
.StaticOverload< LightObj & (*)(Int32, bool, Float32, Float32, Float32, Uint8, Uint8, Uint8, Uint8, Float32, Int32, LightObj &) >
(_SC("CreateEx"), &Checkpoint_CreateEx)
.StaticOverload< LightObj & (*)(Int32, bool, const Vector3 &, const Color4 &, Float32) >
(_SC("Create"), &Checkpoint_Create)
.StaticOverload< LightObj & (*)(Int32, bool, const Vector3 &, const Color4 &, Float32, Int32, LightObj &) >
(_SC("Create"), &Checkpoint_Create)
.StaticOverload(_SC("CreateEx"), &Checkpoint_CreateEx1a)
.StaticOverload(_SC("CreateEx"), &Checkpoint_CreateEx1b)
.StaticOverload(_SC("Create"), &Checkpoint_Create1a)
.StaticOverload(_SC("Create"), &Checkpoint_Create1b)
// Raw Squirrel Methods
.SquirrelFunc(_SC("NullInst"), &CCheckpoint::SqGetNull)
.SquirrelFunc(_SC("MakeTask"), &Tasks::MakeTask< CCheckpoint, ENT_CHECKPOINT >)

View File

@ -1,7 +1,7 @@
#pragma once
// ------------------------------------------------------------------------------------------------
#include "Base/Shared.hpp"
#include "Core/Common.hpp"
// ------------------------------------------------------------------------------------------------
namespace SqMod {
@ -22,13 +22,14 @@ class CCheckpoint
{
// --------------------------------------------------------------------------------------------
friend class Core;
friend class CheckpointInst;
private:
/* --------------------------------------------------------------------------------------------
* Identifier of the managed entity.
*/
Int32 m_ID;
int32_t m_ID;
/* --------------------------------------------------------------------------------------------
* User tag associated with this instance.
@ -43,19 +44,19 @@ private:
/* --------------------------------------------------------------------------------------------
* Prevent events from triggering themselves.
*/
Uint32 m_CircularLocks;
uint32_t m_CircularLocks;
/* --------------------------------------------------------------------------------------------
* Base constructor.
*/
explicit CCheckpoint(Int32 id);
explicit CCheckpoint(int32_t id);
public:
/* --------------------------------------------------------------------------------------------
* Maximum possible number that could represent an identifier for this entity type.
*/
static const Int32 Max;
static const int32_t Max;
/* --------------------------------------------------------------------------------------------
* Copy constructor. (disabled)
@ -91,7 +92,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Used by the script engine to convert an instance of this type to a string.
*/
const String & ToString() const;
SQMOD_NODISCARD const String & ToString() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the associated null entity instance.
@ -101,12 +102,12 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve the associated null entity instance.
*/
static LightObj & GetNull();
SQMOD_NODISCARD static LightObj & GetNull();
/* --------------------------------------------------------------------------------------------
* Retrieve the identifier of the entity managed by this instance.
*/
Int32 GetID() const
SQMOD_NODISCARD int32_t GetID() const
{
return m_ID;
}
@ -114,7 +115,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Check whether this instance manages a valid entity.
*/
bool IsActive() const
SQMOD_NODISCARD bool IsActive() const
{
return VALID_ENTITY(m_ID);
}
@ -122,7 +123,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve the associated user tag.
*/
const String & GetTag() const;
SQMOD_NODISCARD const String & GetTag() const;
/* --------------------------------------------------------------------------------------------
* Modify the associated user tag.
@ -137,7 +138,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve the associated user data.
*/
LightObj & GetData();
SQMOD_NODISCARD LightObj & GetData();
/* --------------------------------------------------------------------------------------------
* Modify the associated user data.
@ -147,7 +148,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Destroy the managed checkpoint entity.
*/
bool Destroy()
bool Destroy0() const // NOLINT(modernize-use-nodiscard)
{
return Destroy(0, NullLightObj());
}
@ -155,7 +156,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Destroy the managed checkpoint entity.
*/
bool Destroy(Int32 header)
bool Destroy1(int32_t header) const // NOLINT(modernize-use-nodiscard)
{
return Destroy(header, NullLightObj());
}
@ -163,42 +164,42 @@ public:
/* --------------------------------------------------------------------------------------------
* Destroy the managed checkpoint entity.
*/
bool Destroy(Int32 header, LightObj & payload);
bool Destroy(int32_t header, LightObj & payload) const; // NOLINT(modernize-use-nodiscard)
/* --------------------------------------------------------------------------------------------
* Retrieve the events table of this entity.
*/
LightObj & GetEvents() const;
SQMOD_NODISCARD LightObj & GetEvents() const;
/* --------------------------------------------------------------------------------------------
* Emit a custom event for the managed entity
*/
void CustomEvent(Int32 header, LightObj & payload) const;
void CustomEvent(int32_t header, LightObj & payload) const;
/* --------------------------------------------------------------------------------------------
* See if the managed checkpoint entity is streamed for the specified player.
*/
bool IsStreamedFor(CPlayer & player) const;
SQMOD_NODISCARD bool IsStreamedFor(CPlayer & player) const;
/* --------------------------------------------------------------------------------------------
* See if the managed checkpoint entity of sphere type.
*/
bool IsSphere() const;
SQMOD_NODISCARD bool IsSphere() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the world in which the managed checkpoint entity exists.
*/
Int32 GetWorld() const;
SQMOD_NODISCARD int32_t GetWorld() const;
/* --------------------------------------------------------------------------------------------
* Modify the world in which the managed checkpoint entity exists.
*/
void SetWorld(Int32 world);
void SetWorld(int32_t world);
/* --------------------------------------------------------------------------------------------
* Retrieve the color of the managed checkpoint entity.
*/
Color4 GetColor() const;
SQMOD_NODISCARD Color4 GetColor() const;
/* --------------------------------------------------------------------------------------------
* Modify the color of the managed checkpoint entity.
@ -208,17 +209,17 @@ public:
/* --------------------------------------------------------------------------------------------
* Modify the color of the managed checkpoint entity.
*/
void SetColorEx(Uint8 r, Uint8 g, Uint8 b) const;
void SetColorEx3(uint8_t r, uint8_t g, uint8_t b) const;
/* --------------------------------------------------------------------------------------------
* Modify the color of the managed checkpoint entity.
*/
void SetColorEx(Uint8 r, Uint8 g, Uint8 b, Uint8 a) const;
void SetColorEx4(uint8_t r, uint8_t g, uint8_t b, uint8_t a) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the position of the managed checkpoint entity.
*/
Vector3 GetPosition() const;
SQMOD_NODISCARD Vector3 GetPosition() const;
/* --------------------------------------------------------------------------------------------
* Modify the position of the managed checkpoint entity.
@ -228,97 +229,97 @@ public:
/* --------------------------------------------------------------------------------------------
* Modify the position of the managed checkpoint entity.
*/
void SetPositionEx(Float32 x, Float32 y, Float32 z) const;
void SetPositionEx(float x, float y, float z) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the radius of the managed checkpoint entity.
*/
Float32 GetRadius() const;
SQMOD_NODISCARD float GetRadius() const;
/* --------------------------------------------------------------------------------------------
* Modify the radius of the managed checkpoint entity.
*/
void SetRadius(Float32 radius);
void SetRadius(float radius);
/* --------------------------------------------------------------------------------------------
* Retrieve the owner of the managed checkpoint entity.
*/
LightObj & GetOwner() const;
SQMOD_NODISCARD LightObj & GetOwner() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the owner identifier of the managed checkpoint entity.
*/
Int32 GetOwnerID() const;
SQMOD_NODISCARD int32_t GetOwnerID() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the position on the x axis of the managed checkpoint entity.
*/
Float32 GetPositionX() const;
SQMOD_NODISCARD float GetPositionX() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the position on the y axis of the managed checkpoint entity.
*/
Float32 GetPositionY() const;
SQMOD_NODISCARD float GetPositionY() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the position on the z axis of the managed checkpoint entity.
*/
Float32 GetPositionZ() const;
SQMOD_NODISCARD float GetPositionZ() const;
/* --------------------------------------------------------------------------------------------
* Modify the position on the x axis of the managed checkpoint entity.
*/
void SetPositionX(Float32 x) const;
void SetPositionX(float x) const;
/* --------------------------------------------------------------------------------------------
* Modify the position on the y axis of the managed checkpoint entity.
*/
void SetPositionY(Float32 y) const;
void SetPositionY(float y) const;
/* --------------------------------------------------------------------------------------------
* Modify the position on the z axis of the managed checkpoint entity.
*/
void SetPositionZ(Float32 z) const;
void SetPositionZ(float z) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the red color of the managed checkpoint entity.
*/
Int32 GetColorR() const;
SQMOD_NODISCARD int32_t GetColorR() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the green color of the managed checkpoint entity.
*/
Int32 GetColorG() const;
SQMOD_NODISCARD int32_t GetColorG() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the blue color of the managed checkpoint entity.
*/
Int32 GetColorB() const;
SQMOD_NODISCARD int32_t GetColorB() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the alpha transparency of the managed checkpoint entity.
*/
Int32 GetColorA() const;
SQMOD_NODISCARD int32_t GetColorA() const;
/* --------------------------------------------------------------------------------------------
* Modify the red color of the managed checkpoint entity.
*/
void SetColorR(Int32 r) const;
void SetColorR(int32_t r) const;
/* --------------------------------------------------------------------------------------------
* Modify the green color of the managed checkpoint entity.
*/
void SetColorG(Int32 g) const;
void SetColorG(int32_t g) const;
/* --------------------------------------------------------------------------------------------
* Modify the blue color of the managed checkpoint entity.
*/
void SetColorB(Int32 b) const;
void SetColorB(int32_t b) const;
/* --------------------------------------------------------------------------------------------
* Modify the alpha transparency of the managed checkpoint entity.
*/
void SetColorA(Int32 a) const;
void SetColorA(int32_t a) const;
};
} // Namespace:: SqMod

View File

@ -1,52 +1,52 @@
// ------------------------------------------------------------------------------------------------
#include "Entity/Keybind.hpp"
#include "Entity/KeyBind.hpp"
#include "Core.hpp"
#include "Misc/Tasks.hpp"
#include "Core/Tasks.hpp"
// ------------------------------------------------------------------------------------------------
namespace SqMod {
// ------------------------------------------------------------------------------------------------
SQMODE_DECL_TYPENAME(Typename, _SC("SqKeybind"))
SQMOD_DECL_TYPENAME(Typename, _SC("SqKeyBind"))
// ------------------------------------------------------------------------------------------------
const Int32 CKeybind::Max = SQMOD_KEYBIND_POOL;
const int32_t CKeyBind::Max = SQMOD_KEYBIND_POOL;
// ------------------------------------------------------------------------------------------------
SQInteger CKeybind::SqGetNull(HSQUIRRELVM vm)
SQInteger CKeyBind::SqGetNull(HSQUIRRELVM vm)
{
sq_pushobject(vm, Core::Get().GetNullKeybind().GetObj());
sq_pushobject(vm, Core::Get().GetNullKeyBind().GetObj());
return 1;
}
// ------------------------------------------------------------------------------------------------
LightObj & CKeybind::GetNull()
LightObj & CKeyBind::GetNull()
{
return Core::Get().GetNullKeybind();
return Core::Get().GetNullKeyBind();
}
// ------------------------------------------------------------------------------------------------
CKeybind::CKeybind(Int32 id)
CKeyBind::CKeyBind(int32_t id)
: m_ID(VALID_ENTITYGETEX(id, SQMOD_KEYBIND_POOL))
, m_Tag(ToStrF("%d", id))
, m_Tag(fmt::format("{}", id))
{
/* ... */
}
// ------------------------------------------------------------------------------------------------
const String & CKeybind::ToString() const
const String & CKeyBind::ToString() const
{
return m_Tag;
}
// ------------------------------------------------------------------------------------------------
const String & CKeybind::GetTag() const
const String & CKeyBind::GetTag() const
{
return m_Tag;
}
// ------------------------------------------------------------------------------------------------
void CKeybind::SetTag(StackStrF & tag)
void CKeyBind::SetTag(StackStrF & tag)
{
if (tag.mLen > 0)
{
@ -59,14 +59,14 @@ void CKeybind::SetTag(StackStrF & tag)
}
// ------------------------------------------------------------------------------------------------
CKeybind & CKeybind::ApplyTag(StackStrF & tag)
CKeyBind & CKeyBind::ApplyTag(StackStrF & tag)
{
SetTag(tag);
return *this;
}
// ------------------------------------------------------------------------------------------------
LightObj & CKeybind::GetData()
LightObj & CKeyBind::GetData()
{
// Validate the managed identifier
Validate();
@ -75,7 +75,7 @@ LightObj & CKeybind::GetData()
}
// ------------------------------------------------------------------------------------------------
void CKeybind::SetData(LightObj & data)
void CKeyBind::SetData(LightObj & data)
{
// Validate the managed identifier
Validate();
@ -84,146 +84,142 @@ void CKeybind::SetData(LightObj & data)
}
// ------------------------------------------------------------------------------------------------
bool CKeybind::Destroy(Int32 header, LightObj & payload)
bool CKeyBind::Destroy(int32_t header, LightObj & payload) const
{
// Validate the managed identifier
Validate();
// Perform the requested operation
return Core::Get().DelKeybind(m_ID, header, payload);
return Core::Get().DelKeyBind(m_ID, header, payload);
}
// ------------------------------------------------------------------------------------------------
LightObj & CKeybind::GetEvents() const
LightObj & CKeyBind::GetEvents() const
{
// Validate the managed identifier
Validate();
// Return the associated event table
return Core::Get().GetKeybind(m_ID).mEvents;
return Core::Get().GetKeyBind(m_ID).mEvents;
}
// ------------------------------------------------------------------------------------------------
void CKeybind::CustomEvent(Int32 header, LightObj & payload) const
void CKeyBind::CustomEvent(int32_t header, LightObj & payload) const
{
// Validate the managed identifier
Validate();
// Perfrom the requested action
Core::Get().EmitKeybindCustom(m_ID, header, payload);
// Perform the requested action
Core::Get().EmitKeyBindCustom(m_ID, header, payload);
}
// ------------------------------------------------------------------------------------------------
Int32 CKeybind::GetFirst() const
int32_t CKeyBind::GetFirst() const
{
// Validate the managed identifier
Validate();
// Return the requested information
return Core::Get().GetKeybind(m_ID).mFirst;
return Core::Get().GetKeyBind(m_ID).mFirst;
}
// ------------------------------------------------------------------------------------------------
Int32 CKeybind::GetSecond() const
int32_t CKeyBind::GetSecond() const
{
// Validate the managed identifier
Validate();
// Return the requested information
return Core::Get().GetKeybind(m_ID).mSecond;
return Core::Get().GetKeyBind(m_ID).mSecond;
}
// ------------------------------------------------------------------------------------------------
Int32 CKeybind::GetThird() const
int32_t CKeyBind::GetThird() const
{
// Validate the managed identifier
Validate();
// Return the requested information
return Core::Get().GetKeybind(m_ID).mThird;
return Core::Get().GetKeyBind(m_ID).mThird;
}
// ------------------------------------------------------------------------------------------------
bool CKeybind::IsRelease() const
bool CKeyBind::IsRelease() const
{
// Validate the managed identifier
Validate();
// Return the requested information
return static_cast< bool >(Core::Get().GetKeybind(m_ID).mRelease);
return static_cast< bool >(Core::Get().GetKeyBind(m_ID).mRelease);
}
// ------------------------------------------------------------------------------------------------
static LightObj & Keybind_CreateEx(Int32 slot, bool release, Int32 primary, Int32 secondary,
Int32 alternative)
static LightObj & KeyBind_CreateEx1a(int32_t slot, bool release, int32_t primary, int32_t secondary,
int32_t alternative)
{
return Core::Get().NewKeybind(slot, release, primary, secondary, alternative,
SQMOD_CREATE_DEFAULT, NullLightObj());
return Core::Get().NewKeyBind(slot, release, primary, secondary, alternative,
SQMOD_CREATE_DEFAULT, NullLightObj());
}
static LightObj & Keybind_CreateEx(Int32 slot, bool release, Int32 primary, Int32 secondary,
Int32 alternative, Int32 header, LightObj & payload)
static LightObj & KeyBind_CreateEx1b(int32_t slot, bool release, int32_t primary, int32_t secondary,
int32_t alternative, int32_t header, LightObj & payload)
{
return Core::Get().NewKeybind(slot, release, primary, secondary, alternative, header, payload);
return Core::Get().NewKeyBind(slot, release, primary, secondary, alternative, header, payload);
}
// ------------------------------------------------------------------------------------------------
static LightObj & Keybind_Create(bool release, Int32 primary, Int32 secondary, Int32 alternative)
static LightObj & KeyBind_Create1a(bool release, int32_t primary, int32_t secondary, int32_t alternative)
{
return Core::Get().NewKeybind(-1, release, primary, secondary, alternative,
SQMOD_CREATE_DEFAULT, NullLightObj());
return Core::Get().NewKeyBind(-1, release, primary, secondary, alternative,
SQMOD_CREATE_DEFAULT, NullLightObj());
}
static LightObj & Keybind_Create(bool release, Int32 primary, Int32 secondary, Int32 alternative,
Int32 header, LightObj & payload)
static LightObj & KeyBind_Create1b(bool release, int32_t primary, int32_t secondary, int32_t alternative,
int32_t header, LightObj & payload)
{
return Core::Get().NewKeybind(-1, release, primary, secondary, alternative, header, payload);
return Core::Get().NewKeyBind(-1, release, primary, secondary, alternative, header, payload);
}
// ------------------------------------------------------------------------------------------------
static SQInteger Keybind_UnusedSlot()
static SQInteger KeyBind_UnusedSlot()
{
return _Func->GetKeyBindUnusedSlot();
}
// ================================================================================================
void Register_CKeybind(HSQUIRRELVM vm)
void Register_CKeyBind(HSQUIRRELVM vm)
{
RootTable(vm).Bind(Typename::Str,
Class< CKeybind, NoConstructor< CKeybind > >(vm, Typename::Str)
Class< CKeyBind, NoConstructor< CKeyBind > >(vm, Typename::Str)
// Meta-methods
.SquirrelFunc(_SC("_typename"), &Typename::Fn)
.Func(_SC("_tostring"), &CKeybind::ToString)
.Func(_SC("_tostring"), &CKeyBind::ToString)
// Static Values
.SetStaticValue(_SC("MaxID"), CKeybind::Max)
.SetStaticValue(_SC("MaxID"), CKeyBind::Max)
// Core Properties
.Prop(_SC("On"), &CKeybind::GetEvents)
.Prop(_SC("ID"), &CKeybind::GetID)
.Prop(_SC("Tag"), &CKeybind::GetTag, &CKeybind::SetTag)
.Prop(_SC("Data"), &CKeybind::GetData, &CKeybind::SetData)
.Prop(_SC("Active"), &CKeybind::IsActive)
.Prop(_SC("On"), &CKeyBind::GetEvents)
.Prop(_SC("ID"), &CKeyBind::GetID)
.Prop(_SC("Tag"), &CKeyBind::GetTag, &CKeyBind::SetTag)
.Prop(_SC("Data"), &CKeyBind::GetData, &CKeyBind::SetData)
.Prop(_SC("Active"), &CKeyBind::IsActive)
// Core Methods
.FmtFunc(_SC("SetTag"), &CKeybind::ApplyTag)
.Func(_SC("CustomEvent"), &CKeybind::CustomEvent)
.FmtFunc(_SC("SetTag"), &CKeyBind::ApplyTag)
.Func(_SC("CustomEvent"), &CKeyBind::CustomEvent)
// Core Overloads
.Overload< bool (CKeybind::*)(void) >(_SC("Destroy"), &CKeybind::Destroy)
.Overload< bool (CKeybind::*)(Int32) >(_SC("Destroy"), &CKeybind::Destroy)
.Overload< bool (CKeybind::*)(Int32, LightObj &) >(_SC("Destroy"), &CKeybind::Destroy)
.Overload(_SC("Destroy"), &CKeyBind::Destroy0)
.Overload(_SC("Destroy"), &CKeyBind::Destroy1)
.Overload(_SC("Destroy"), &CKeyBind::Destroy)
// Properties
.Prop(_SC("First"), &CKeybind::GetFirst)
.Prop(_SC("Second"), &CKeybind::GetSecond)
.Prop(_SC("Third"), &CKeybind::GetThird)
.Prop(_SC("Release"), &CKeybind::IsRelease)
.Prop(_SC("First"), &CKeyBind::GetFirst)
.Prop(_SC("Second"), &CKeyBind::GetSecond)
.Prop(_SC("Third"), &CKeyBind::GetThird)
.Prop(_SC("Release"), &CKeyBind::IsRelease)
// Static Functions
.StaticFunc(_SC("UnusedSlot"), &Keybind_UnusedSlot)
.StaticFunc(_SC("UnusedSlot"), &KeyBind_UnusedSlot)
// Static Overloads
.StaticOverload< LightObj & (*)(Int32, bool, Int32, Int32, Int32) >
(_SC("CreateEx"), &Keybind_CreateEx)
.StaticOverload< LightObj & (*)(Int32, bool, Int32, Int32, Int32, Int32, LightObj &) >
(_SC("CreateEx"), &Keybind_CreateEx)
.StaticOverload< LightObj & (*)(bool, Int32, Int32, Int32) >
(_SC("Create"), &Keybind_Create)
.StaticOverload< LightObj & (*)(bool, Int32, Int32, Int32, Int32, LightObj &) >
(_SC("Create"), &Keybind_Create)
.StaticOverload(_SC("CreateEx"), &KeyBind_CreateEx1a)
.StaticOverload(_SC("CreateEx"), &KeyBind_CreateEx1b)
.StaticOverload(_SC("Create"), &KeyBind_Create1a)
.StaticOverload(_SC("Create"), &KeyBind_Create1b)
// Raw Squirrel Methods
.SquirrelFunc(_SC("NullInst"), &CKeybind::SqGetNull)
.SquirrelFunc(_SC("MakeTask"), &Tasks::MakeTask< CKeybind, ENT_KEYBIND >)
.SquirrelFunc(_SC("DropTask"), &Tasks::DropTask< CKeybind, ENT_KEYBIND >)
.SquirrelFunc(_SC("DoesTask"), &Tasks::DoesTask< CKeybind, ENT_KEYBIND >)
.SquirrelFunc(_SC("FindTask"), &Tasks::FindTask< CKeybind, ENT_KEYBIND >)
.SquirrelFunc(_SC("NullInst"), &CKeyBind::SqGetNull)
.SquirrelFunc(_SC("MakeTask"), &Tasks::MakeTask< CKeyBind, ENT_KEYBIND >)
.SquirrelFunc(_SC("DropTask"), &Tasks::DropTask< CKeyBind, ENT_KEYBIND >)
.SquirrelFunc(_SC("DoesTask"), &Tasks::DoesTask< CKeyBind, ENT_KEYBIND >)
.SquirrelFunc(_SC("FindTask"), &Tasks::FindTask< CKeyBind, ENT_KEYBIND >)
);
}

View File

@ -1,25 +1,26 @@
#pragma once
// ------------------------------------------------------------------------------------------------
#include "Base/Shared.hpp"
#include "Core/Common.hpp"
// ------------------------------------------------------------------------------------------------
namespace SqMod {
/* ------------------------------------------------------------------------------------------------
* Manages a single keybind entity.
* Manages a single key-bind entity.
*/
class CKeybind
class CKeyBind
{
// --------------------------------------------------------------------------------------------
friend class Core;
friend class KeyBindInst;
private:
/* --------------------------------------------------------------------------------------------
* Identifier of the managed entity.
*/
Int32 m_ID;
int32_t m_ID;
/* --------------------------------------------------------------------------------------------
* User tag associated with this instance.
@ -34,34 +35,34 @@ private:
/* --------------------------------------------------------------------------------------------
* Base constructor.
*/
explicit CKeybind(Int32 id);
explicit CKeyBind(int32_t id);
public:
/* --------------------------------------------------------------------------------------------
* Maximum possible number that could represent an identifier for this entity type.
*/
static const Int32 Max;
static const int32_t Max;
/* --------------------------------------------------------------------------------------------
* Copy constructor. (disabled)
*/
CKeybind(const CKeybind &) = delete;
CKeyBind(const CKeyBind &) = delete;
/* --------------------------------------------------------------------------------------------
* Move constructor. (disabled)
*/
CKeybind(CKeybind &&) = delete;
CKeyBind(CKeyBind &&) = delete;
/* --------------------------------------------------------------------------------------------
* Copy assignment operator. (disabled)
*/
CKeybind & operator = (const CKeybind &) = delete;
CKeyBind & operator = (const CKeyBind &) = delete;
/* --------------------------------------------------------------------------------------------
* Move assignment operator. (disabled)
*/
CKeybind & operator = (CKeybind &&) = delete;
CKeyBind & operator = (CKeyBind &&) = delete;
/* --------------------------------------------------------------------------------------------
* See whether this instance manages a valid entity instance otherwise throw an exception.
@ -77,7 +78,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Used by the script engine to convert an instance of this type to a string.
*/
const String & ToString() const;
SQMOD_NODISCARD const String & ToString() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the associated null entity instance.
@ -87,12 +88,12 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve the associated null entity instance.
*/
static LightObj & GetNull();
SQMOD_NODISCARD static LightObj & GetNull();
/* --------------------------------------------------------------------------------------------
* Retrieve the identifier of the entity managed by this instance.
*/
Int32 GetID() const
SQMOD_NODISCARD int32_t GetID() const
{
return m_ID;
}
@ -100,7 +101,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Check whether this instance manages a valid entity.
*/
bool IsActive() const
SQMOD_NODISCARD bool IsActive() const
{
return VALID_ENTITY(m_ID);
}
@ -108,7 +109,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve the associated user tag.
*/
const String & GetTag() const;
SQMOD_NODISCARD const String & GetTag() const;
/* --------------------------------------------------------------------------------------------
* Modify the associated user tag.
@ -118,12 +119,12 @@ public:
/* --------------------------------------------------------------------------------------------
* Modify the associated user tag.
*/
CKeybind & ApplyTag(StackStrF & tag);
CKeyBind & ApplyTag(StackStrF & tag);
/* --------------------------------------------------------------------------------------------
* Retrieve the associated user data.
*/
LightObj & GetData();
SQMOD_NODISCARD LightObj & GetData();
/* --------------------------------------------------------------------------------------------
* Modify the associated user data.
@ -133,7 +134,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Destroy the managed destroy entity.
*/
bool Destroy()
bool Destroy0() const // NOLINT(modernize-use-nodiscard)
{
return Destroy(0, NullLightObj());
}
@ -141,7 +142,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Destroy the managed destroy entity.
*/
bool Destroy(Int32 header)
bool Destroy1(int32_t header) const // NOLINT(modernize-use-nodiscard)
{
return Destroy(header, NullLightObj());
}
@ -149,37 +150,37 @@ public:
/* --------------------------------------------------------------------------------------------
* Destroy the managed destroy entity.
*/
bool Destroy(Int32 header, LightObj & payload);
bool Destroy(int32_t header, LightObj & payload) const; // NOLINT(modernize-use-nodiscard)
/* --------------------------------------------------------------------------------------------
* Retrieve the events table of this entity.
*/
LightObj & GetEvents() const;
SQMOD_NODISCARD LightObj & GetEvents() const;
/* --------------------------------------------------------------------------------------------
* Emit a custom event for the managed entity
*/
void CustomEvent(Int32 header, LightObj & payload) const;
void CustomEvent(int32_t header, LightObj & payload) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the first key code of the managed keybind entity.
* Retrieve the first key code of the managed key-bind entity.
*/
Int32 GetFirst() const;
SQMOD_NODISCARD int32_t GetFirst() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the second key code of the managed keybind entity.
* Retrieve the second key code of the managed key-bind entity.
*/
Int32 GetSecond() const;
SQMOD_NODISCARD int32_t GetSecond() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the third key code of the managed keybind entity.
* Retrieve the third key code of the managed key-bind entity.
*/
Int32 GetThird() const;
SQMOD_NODISCARD int32_t GetThird() const;
/* --------------------------------------------------------------------------------------------
* See whether the managed keybind entity reacts to key release events.
* See whether the managed key-bind entity reacts to key release events.
*/
bool IsRelease() const;
SQMOD_NODISCARD bool IsRelease() const;
};
} // Namespace:: SqMod

View File

@ -4,16 +4,16 @@
#include "Base/Quaternion.hpp"
#include "Base/Vector3.hpp"
#include "Core.hpp"
#include "Misc/Tasks.hpp"
#include "Core/Tasks.hpp"
// ------------------------------------------------------------------------------------------------
namespace SqMod {
// ------------------------------------------------------------------------------------------------
SQMODE_DECL_TYPENAME(Typename, _SC("SqObject"))
SQMOD_DECL_TYPENAME(Typename, _SC("SqObject"))
// ------------------------------------------------------------------------------------------------
const Int32 CObject::Max = SQMOD_OBJECT_POOL;
const int32_t CObject::Max = SQMOD_OBJECT_POOL;
// ------------------------------------------------------------------------------------------------
SQInteger CObject::SqGetNull(HSQUIRRELVM vm)
@ -29,9 +29,9 @@ LightObj & CObject::GetNull()
}
// ------------------------------------------------------------------------------------------------
CObject::CObject(Int32 id)
CObject::CObject(int32_t id)
: m_ID(VALID_ENTITYGETEX(id, SQMOD_OBJECT_POOL))
, m_Tag(ToStrF("%d", id)), m_Data(), m_CircularLocks(0)
, m_Tag(fmt::format("{}", id)), m_Data(), m_CircularLocks(0)
, mMoveToDuration(0)
, mMoveByDuration(0)
, mRotateToDuration(0)
@ -93,7 +93,7 @@ void CObject::SetData(LightObj & data)
}
// ------------------------------------------------------------------------------------------------
bool CObject::Destroy(Int32 header, LightObj & payload)
bool CObject::Destroy(int32_t header, LightObj & payload) const
{
// Validate the managed identifier
Validate();
@ -111,11 +111,11 @@ LightObj & CObject::GetEvents() const
}
// ------------------------------------------------------------------------------------------------
void CObject::CustomEvent(Int32 header, LightObj & payload) const
void CObject::CustomEvent(int32_t header, LightObj & payload) const
{
// Validate the managed identifier
Validate();
// Perfrom the requested action
// Perform the requested action
Core::Get().EmitObjectCustom(m_ID, header, payload);
}
@ -134,7 +134,7 @@ bool CObject::IsStreamedFor(CPlayer & player) const
}
// ------------------------------------------------------------------------------------------------
Int32 CObject::GetModel() const
int32_t CObject::GetModel() const
{
// Validate the managed identifier
Validate();
@ -143,7 +143,7 @@ Int32 CObject::GetModel() const
}
// ------------------------------------------------------------------------------------------------
Int32 CObject::GetWorld() const
int32_t CObject::GetWorld() const
{
// Validate the managed identifier
Validate();
@ -152,12 +152,12 @@ Int32 CObject::GetWorld() const
}
// ------------------------------------------------------------------------------------------------
void CObject::SetWorld(Int32 world)
void CObject::SetWorld(int32_t world)
{
// Validate the managed identifier
Validate();
// Grab the current value for this property
const Int32 current = _Func->GetObjectWorld(m_ID);
const int32_t current = _Func->GetObjectWorld(m_ID);
// Don't even bother if it's the same value
if (current == world)
{
@ -176,7 +176,7 @@ void CObject::SetWorld(Int32 world)
}
// ------------------------------------------------------------------------------------------------
Int32 CObject::GetAlpha() const
int32_t CObject::GetAlpha() const
{
// Validate the managed identifier
Validate();
@ -185,18 +185,18 @@ Int32 CObject::GetAlpha() const
}
// ------------------------------------------------------------------------------------------------
void CObject::SetAlpha(Int32 alpha)
void CObject::SetAlpha(int32_t alpha)
{
SetAlphaEx(alpha, 0);
}
// ------------------------------------------------------------------------------------------------
void CObject::SetAlphaEx(Int32 alpha, Uint32 time)
void CObject::SetAlphaEx(int32_t alpha, uint32_t time)
{
// Validate the managed identifier
Validate();
// Grab the current value for this property
const Int32 current = _Func->GetObjectAlpha(m_ID);
const int32_t current = _Func->GetObjectAlpha(m_ID);
// Don't even bother if it's the same value
if (current == alpha)
{
@ -215,7 +215,7 @@ void CObject::SetAlphaEx(Int32 alpha, Uint32 time)
}
// ------------------------------------------------------------------------------------------------
void CObject::MoveTo(const Vector3 & pos, Uint32 time) const
void CObject::MoveTo(const Vector3 & pos, uint32_t time) const
{
// Validate the managed identifier
Validate();
@ -224,7 +224,7 @@ void CObject::MoveTo(const Vector3 & pos, Uint32 time) const
}
// ------------------------------------------------------------------------------------------------
void CObject::MoveToEx(Float32 x, Float32 y, Float32 z, Uint32 time) const
void CObject::MoveToEx(float x, float y, float z, uint32_t time) const
{
// Validate the managed identifier
Validate();
@ -233,7 +233,7 @@ void CObject::MoveToEx(Float32 x, Float32 y, Float32 z, Uint32 time) const
}
// ------------------------------------------------------------------------------------------------
void CObject::MoveBy(const Vector3 & pos, Uint32 time) const
void CObject::MoveBy(const Vector3 & pos, uint32_t time) const
{
// Validate the managed identifier
Validate();
@ -242,7 +242,7 @@ void CObject::MoveBy(const Vector3 & pos, Uint32 time) const
}
// ------------------------------------------------------------------------------------------------
void CObject::MoveByEx(Float32 x, Float32 y, Float32 z, Uint32 time) const
void CObject::MoveByEx(float x, float y, float z, uint32_t time) const
{
// Validate the managed identifier
Validate();
@ -251,7 +251,7 @@ void CObject::MoveByEx(Float32 x, Float32 y, Float32 z, Uint32 time) const
}
// ------------------------------------------------------------------------------------------------
Vector3 CObject::GetPosition()
Vector3 CObject::GetPosition() const
{
// Validate the managed identifier
Validate();
@ -273,7 +273,7 @@ void CObject::SetPosition(const Vector3 & pos) const
}
// ------------------------------------------------------------------------------------------------
void CObject::SetPositionEx(Float32 x, Float32 y, Float32 z) const
void CObject::SetPositionEx(float x, float y, float z) const
{
// Validate the managed identifier
Validate();
@ -282,7 +282,7 @@ void CObject::SetPositionEx(Float32 x, Float32 y, Float32 z) const
}
// ------------------------------------------------------------------------------------------------
void CObject::RotateTo(const Quaternion & rot, Uint32 time) const
void CObject::RotateTo(const Quaternion & rot, uint32_t time) const
{
// Validate the managed identifier
Validate();
@ -291,7 +291,7 @@ void CObject::RotateTo(const Quaternion & rot, Uint32 time) const
}
// ------------------------------------------------------------------------------------------------
void CObject::RotateToEx(Float32 x, Float32 y, Float32 z, Float32 w, Uint32 time) const
void CObject::RotateToEx(float x, float y, float z, float w, uint32_t time) const
{
// Validate the managed identifier
Validate();
@ -300,7 +300,7 @@ void CObject::RotateToEx(Float32 x, Float32 y, Float32 z, Float32 w, Uint32 time
}
// ------------------------------------------------------------------------------------------------
void CObject::RotateToEuler(const Vector3 & rot, Uint32 time) const
void CObject::RotateToEuler(const Vector3 & rot, uint32_t time) const
{
// Validate the managed identifier
Validate();
@ -309,7 +309,7 @@ void CObject::RotateToEuler(const Vector3 & rot, Uint32 time) const
}
// ------------------------------------------------------------------------------------------------
void CObject::RotateToEulerEx(Float32 x, Float32 y, Float32 z, Uint32 time) const
void CObject::RotateToEulerEx(float x, float y, float z, uint32_t time) const
{
// Validate the managed identifier
Validate();
@ -318,7 +318,7 @@ void CObject::RotateToEulerEx(Float32 x, Float32 y, Float32 z, Uint32 time) cons
}
// ------------------------------------------------------------------------------------------------
void CObject::RotateBy(const Quaternion & rot, Uint32 time) const
void CObject::RotateBy(const Quaternion & rot, uint32_t time) const
{
// Validate the managed identifier
Validate();
@ -327,7 +327,7 @@ void CObject::RotateBy(const Quaternion & rot, Uint32 time) const
}
// ------------------------------------------------------------------------------------------------
void CObject::RotateByEx(Float32 x, Float32 y, Float32 z, Float32 w, Uint32 time) const
void CObject::RotateByEx(float x, float y, float z, float w, uint32_t time) const
{
// Validate the managed identifier
Validate();
@ -336,7 +336,7 @@ void CObject::RotateByEx(Float32 x, Float32 y, Float32 z, Float32 w, Uint32 time
}
// ------------------------------------------------------------------------------------------------
void CObject::RotateByEuler(const Vector3 & rot, Uint32 time) const
void CObject::RotateByEuler(const Vector3 & rot, uint32_t time) const
{
// Validate the managed identifier
Validate();
@ -345,7 +345,7 @@ void CObject::RotateByEuler(const Vector3 & rot, Uint32 time) const
}
// ------------------------------------------------------------------------------------------------
void CObject::RotateByEulerEx(Float32 x, Float32 y, Float32 z, Uint32 time) const
void CObject::RotateByEulerEx(float x, float y, float z, uint32_t time) const
{
// Validate the managed identifier
Validate();
@ -354,20 +354,20 @@ void CObject::RotateByEulerEx(Float32 x, Float32 y, Float32 z, Uint32 time) cons
}
// ------------------------------------------------------------------------------------------------
Quaternion CObject::GetRotation()
Quaternion CObject::GetRotation() const
{
// Validate the managed identifier
Validate();
// Create a default quaternion instance
Quaternion quat;
Quaternion q;
// Query the server for the values
_Func->GetObjectRotation(m_ID, &quat.x, &quat.y, &quat.z, &quat.w);
_Func->GetObjectRotation(m_ID, &q.x, &q.y, &q.z, &q.w);
// Return the requested information
return quat;
return q;
}
// ------------------------------------------------------------------------------------------------
Vector3 CObject::GetRotationEuler()
Vector3 CObject::GetRotationEuler() const
{
// Validate the managed identifier
Validate();
@ -446,12 +446,12 @@ void CObject::SetTouchedReport(bool toggle)
}
// ------------------------------------------------------------------------------------------------
Float32 CObject::GetPositionX() const
float CObject::GetPositionX() const
{
// Validate the managed identifier
Validate();
// Clear previous information, if any
Float32 x = 0.0f, dummy;
float x = 0.0f, dummy;
// Query the server for the requested component value
_Func->GetObjectPosition(m_ID, &x, &dummy, &dummy);
// Return the requested information
@ -459,12 +459,12 @@ Float32 CObject::GetPositionX() const
}
// ------------------------------------------------------------------------------------------------
Float32 CObject::GetPositionY() const
float CObject::GetPositionY() const
{
// Validate the managed identifier
Validate();
// Clear previous information, if any
Float32 y = 0.0f, dummy;
float y = 0.0f, dummy;
// Query the server for the requested component value
_Func->GetObjectPosition(m_ID, &dummy, &y, &dummy);
// Return the requested information
@ -472,12 +472,12 @@ Float32 CObject::GetPositionY() const
}
// ------------------------------------------------------------------------------------------------
Float32 CObject::GetPositionZ() const
float CObject::GetPositionZ() const
{
// Validate the managed identifier
Validate();
// Clear previous information, if any
Float32 z = 0.0f, dummy;
float z = 0.0f, dummy;
// Query the server for the requested component value
_Func->GetObjectPosition(m_ID, &dummy, &dummy, &z);
// Return the requested information
@ -485,12 +485,12 @@ Float32 CObject::GetPositionZ() const
}
// ------------------------------------------------------------------------------------------------
void CObject::SetPositionX(Float32 x) const
void CObject::SetPositionX(float x) const
{
// Validate the managed identifier
Validate();
// Reserve some temporary floats to retrieve the missing components
Float32 y, z, dummy;
float y, z, dummy;
// Retrieve the current values for unchanged components
_Func->GetObjectPosition(m_ID, &dummy, &y, &z);
// Perform the requested operation
@ -498,12 +498,12 @@ void CObject::SetPositionX(Float32 x) const
}
// ------------------------------------------------------------------------------------------------
void CObject::SetPositionY(Float32 y) const
void CObject::SetPositionY(float y) const
{
// Validate the managed identifier
Validate();
// Reserve some temporary floats to retrieve the missing components
Float32 x, z, dummy;
float x, z, dummy;
// Retrieve the current values for unchanged components
_Func->GetObjectPosition(m_ID, &x, &dummy, &z);
// Perform the requested operation
@ -511,12 +511,12 @@ void CObject::SetPositionY(Float32 y) const
}
// ------------------------------------------------------------------------------------------------
void CObject::SetPositionZ(Float32 z) const
void CObject::SetPositionZ(float z) const
{
// Validate the managed identifier
Validate();
// Reserve some temporary floats to retrieve the missing components
Float32 x, y, dummy;
float x, y, dummy;
// Retrieve the current values for unchanged components
_Func->GetObjectPosition(m_ID, &x, &y, &dummy);
// Perform the requested operation
@ -524,12 +524,12 @@ void CObject::SetPositionZ(Float32 z) const
}
// ------------------------------------------------------------------------------------------------
Float32 CObject::GetRotationX() const
float CObject::GetRotationX() const
{
// Validate the managed identifier
Validate();
// Clear previous information, if any
Float32 x = 0.0f, dummy;
float x = 0.0f, dummy;
// Query the server for the requested component value
_Func->GetObjectRotation(m_ID, &x, &dummy, &dummy, &dummy);
// Return the requested information
@ -537,12 +537,12 @@ Float32 CObject::GetRotationX() const
}
// ------------------------------------------------------------------------------------------------
Float32 CObject::GetRotationY() const
float CObject::GetRotationY() const
{
// Validate the managed identifier
Validate();
// Clear previous information, if any
Float32 y = 0.0f, dummy;
float y = 0.0f, dummy;
// Query the server for the requested component value
_Func->GetObjectRotation(m_ID, &dummy, &y, &dummy, &dummy);
// Return the requested information
@ -550,12 +550,12 @@ Float32 CObject::GetRotationY() const
}
// ------------------------------------------------------------------------------------------------
Float32 CObject::GetRotationZ() const
float CObject::GetRotationZ() const
{
// Validate the managed identifier
Validate();
// Clear previous information, if any
Float32 z = 0.0f, dummy;
float z = 0.0f, dummy;
// Query the server for the requested component value
_Func->GetObjectRotation(m_ID, &dummy, &dummy, &z, &dummy);
// Return the requested information
@ -563,12 +563,12 @@ Float32 CObject::GetRotationZ() const
}
// ------------------------------------------------------------------------------------------------
Float32 CObject::GetRotationW() const
float CObject::GetRotationW() const
{
// Validate the managed identifier
Validate();
// Clear previous information, if any
Float32 w = 0.0f, dummy;
float w = 0.0f, dummy;
// Query the server for the requested component value
_Func->GetObjectRotation(m_ID, &dummy, &dummy, &dummy, &w);
// Return the requested information
@ -576,12 +576,12 @@ Float32 CObject::GetRotationW() const
}
// ------------------------------------------------------------------------------------------------
Float32 CObject::GetEulerRotationX() const
float CObject::GetEulerRotationX() const
{
// Validate the managed identifier
Validate();
// Clear previous information, if any
Float32 x = 0.0f, dummy;
float x = 0.0f, dummy;
// Query the server for the requested component value
_Func->GetObjectRotationEuler(m_ID, &x, &dummy, &dummy);
// Return the requested information
@ -589,12 +589,12 @@ Float32 CObject::GetEulerRotationX() const
}
// ------------------------------------------------------------------------------------------------
Float32 CObject::GetEulerRotationY() const
float CObject::GetEulerRotationY() const
{
// Validate the managed identifier
Validate();
// Clear previous information, if any
Float32 y = 0.0f, dummy;
float y = 0.0f, dummy;
// Query the server for the requested component value
_Func->GetObjectRotationEuler(m_ID, &dummy, &y, &dummy);
// Return the requested information
@ -602,12 +602,12 @@ Float32 CObject::GetEulerRotationY() const
}
// ------------------------------------------------------------------------------------------------
Float32 CObject::GetEulerRotationZ() const
float CObject::GetEulerRotationZ() const
{
// Validate the managed identifier
Validate();
// Clear previous information, if any
Float32 z = 0.0f, dummy;
float z = 0.0f, dummy;
// Query the server for the requested component value
_Func->GetObjectRotationEuler(m_ID, &dummy, &dummy, &z);
// Return the requested information
@ -615,12 +615,12 @@ Float32 CObject::GetEulerRotationZ() const
}
// ------------------------------------------------------------------------------------------------
void CObject::MoveToX(Float32 x) const
void CObject::MoveToX(float x) const
{
// Validate the managed identifier
Validate();
// Reserve some temporary floats to retrieve the missing components
Float32 y, z, dummy;
float y, z, dummy;
// Retrieve the current values for unchanged components
_Func->GetObjectPosition(m_ID, &dummy, &y, &z);
// Perform the requested operation
@ -628,12 +628,12 @@ void CObject::MoveToX(Float32 x) const
}
// ------------------------------------------------------------------------------------------------
void CObject::MoveToY(Float32 y) const
void CObject::MoveToY(float y) const
{
// Validate the managed identifier
Validate();
// Reserve some temporary floats to retrieve the missing components
Float32 x, z, dummy;
float x, z, dummy;
// Retrieve the current values for unchanged components
_Func->GetObjectPosition(m_ID, &x, &dummy, &z);
// Perform the requested operation
@ -641,12 +641,12 @@ void CObject::MoveToY(Float32 y) const
}
// ------------------------------------------------------------------------------------------------
void CObject::MoveToZ(Float32 z) const
void CObject::MoveToZ(float z) const
{
// Validate the managed identifier
Validate();
// Reserve some temporary floats to retrieve the missing components
Float32 x, y, dummy;
float x, y, dummy;
// Retrieve the current values for unchanged components
_Func->GetObjectPosition(m_ID, &x, &y, &dummy);
// Perform the requested operation
@ -654,7 +654,7 @@ void CObject::MoveToZ(Float32 z) const
}
// ------------------------------------------------------------------------------------------------
void CObject::MoveByX(Float32 x) const
void CObject::MoveByX(float x) const
{
// Validate the managed identifier
Validate();
@ -663,7 +663,7 @@ void CObject::MoveByX(Float32 x) const
}
// ------------------------------------------------------------------------------------------------
void CObject::MoveByY(Float32 y) const
void CObject::MoveByY(float y) const
{
// Validate the managed identifier
Validate();
@ -672,7 +672,7 @@ void CObject::MoveByY(Float32 y) const
}
// ------------------------------------------------------------------------------------------------
void CObject::MoveByZ(Float32 z) const
void CObject::MoveByZ(float z) const
{
// Validate the managed identifier
Validate();
@ -681,12 +681,12 @@ void CObject::MoveByZ(Float32 z) const
}
// ------------------------------------------------------------------------------------------------
void CObject::RotateToX(Float32 x) const
void CObject::RotateToX(float x) const
{
// Validate the managed identifier
Validate();
// Reserve some temporary floats to retrieve the missing components
Float32 y, z, w, dummy;
float y, z, w, dummy;
// Retrieve the current values for unchanged components
_Func->GetObjectRotation(m_ID, &dummy, &y, &z, &w);
// Perform the requested operation
@ -694,12 +694,12 @@ void CObject::RotateToX(Float32 x) const
}
// ------------------------------------------------------------------------------------------------
void CObject::RotateToY(Float32 y) const
void CObject::RotateToY(float y) const
{
// Validate the managed identifier
Validate();
// Reserve some temporary floats to retrieve the missing components
Float32 x, z, w, dummy;
float x, z, w, dummy;
// Retrieve the current values for unchanged components
_Func->GetObjectRotation(m_ID, &x, &dummy, &z, &w);
// Perform the requested operation
@ -707,12 +707,12 @@ void CObject::RotateToY(Float32 y) const
}
// ------------------------------------------------------------------------------------------------
void CObject::RotateToZ(Float32 z) const
void CObject::RotateToZ(float z) const
{
// Validate the managed identifier
Validate();
// Reserve some temporary floats to retrieve the missing components
Float32 x, y, w, dummy;
float x, y, w, dummy;
// Retrieve the current values for unchanged components
_Func->GetObjectRotation(m_ID, &x, &y, &dummy, &w);
// Perform the requested operation
@ -720,12 +720,12 @@ void CObject::RotateToZ(Float32 z) const
}
// ------------------------------------------------------------------------------------------------
void CObject::RotateToW(Float32 w) const
void CObject::RotateToW(float w) const
{
// Validate the managed identifier
Validate();
// Reserve some temporary floats to retrieve the missing components
Float32 x, y, z, dummy;
float x, y, z, dummy;
// Retrieve the current values for unchanged components
_Func->GetObjectRotation(m_ID, &x, &y, &z, &dummy);
// Perform the requested operation
@ -733,7 +733,7 @@ void CObject::RotateToW(Float32 w) const
}
// ------------------------------------------------------------------------------------------------
void CObject::RotateByX(Float32 x) const
void CObject::RotateByX(float x) const
{
// Validate the managed identifier
Validate();
@ -742,7 +742,7 @@ void CObject::RotateByX(Float32 x) const
}
// ------------------------------------------------------------------------------------------------
void CObject::RotateByY(Float32 y) const
void CObject::RotateByY(float y) const
{
// Validate the managed identifier
Validate();
@ -751,7 +751,7 @@ void CObject::RotateByY(Float32 y) const
}
// ------------------------------------------------------------------------------------------------
void CObject::RotateByZ(Float32 z) const
void CObject::RotateByZ(float z) const
{
// Validate the managed identifier
Validate();
@ -760,7 +760,7 @@ void CObject::RotateByZ(Float32 z) const
}
// ------------------------------------------------------------------------------------------------
void CObject::RotateByW(Float32 w) const
void CObject::RotateByW(float w) const
{
// Validate the managed identifier
Validate();
@ -769,12 +769,12 @@ void CObject::RotateByW(Float32 w) const
}
// ------------------------------------------------------------------------------------------------
void CObject::RotateToEulerX(Float32 x) const
void CObject::RotateToEulerX(float x) const
{
// Validate the managed identifier
Validate();
// Reserve some temporary floats to retrieve the missing components
Float32 y, z, dummy;
float y, z, dummy;
// Retrieve the current values for unchanged components
_Func->GetObjectRotationEuler(m_ID, &dummy, &y, &z);
// Perform the requested operation
@ -782,12 +782,12 @@ void CObject::RotateToEulerX(Float32 x) const
}
// ------------------------------------------------------------------------------------------------
void CObject::RotateToEulerY(Float32 y) const
void CObject::RotateToEulerY(float y) const
{
// Validate the managed identifier
Validate();
// Reserve some temporary floats to retrieve the missing components
Float32 x, z, dummy;
float x, z, dummy;
// Retrieve the current values for unchanged components
_Func->GetObjectRotationEuler(m_ID, &x, &dummy, &z);
// Perform the requested operation
@ -795,12 +795,12 @@ void CObject::RotateToEulerY(Float32 y) const
}
// ------------------------------------------------------------------------------------------------
void CObject::RotateToEulerZ(Float32 z) const
void CObject::RotateToEulerZ(float z) const
{
// Validate the managed identifier
Validate();
// Reserve some temporary floats to retrieve the missing components
Float32 x, y, dummy;
float x, y, dummy;
// Retrieve the current values for unchanged components
_Func->GetObjectRotationEuler(m_ID, &x, &y, &dummy);
// Perform the requested operation
@ -808,7 +808,7 @@ void CObject::RotateToEulerZ(Float32 z) const
}
// ------------------------------------------------------------------------------------------------
void CObject::RotateByEulerX(Float32 x) const
void CObject::RotateByEulerX(float x) const
{
// Validate the managed identifier
Validate();
@ -817,7 +817,7 @@ void CObject::RotateByEulerX(Float32 x) const
}
// ------------------------------------------------------------------------------------------------
void CObject::RotateByEulerY(Float32 y) const
void CObject::RotateByEulerY(float y) const
{
// Validate the managed identifier
Validate();
@ -826,7 +826,7 @@ void CObject::RotateByEulerY(Float32 y) const
}
// ------------------------------------------------------------------------------------------------
void CObject::RotateByEulerZ(Float32 z) const
void CObject::RotateByEulerZ(float z) const
{
// Validate the managed identifier
Validate();
@ -835,27 +835,27 @@ void CObject::RotateByEulerZ(Float32 z) const
}
// ------------------------------------------------------------------------------------------------
static LightObj & Object_CreateEx(Int32 model, Int32 world, Float32 x, Float32 y, Float32 z,
Int32 alpha)
static LightObj & Object_CreateEx1a(int32_t model, int32_t world, float x, float y, float z,
int32_t alpha)
{
return Core::Get().NewObject(model, world, x, y, z, alpha, SQMOD_CREATE_DEFAULT, NullLightObj());
}
static LightObj & Object_CreateEx(Int32 model, Int32 world, Float32 x, Float32 y, Float32 z,
Int32 alpha, Int32 header, LightObj & payload)
static LightObj & Object_CreateEx1b(int32_t model, int32_t world, float x, float y, float z,
int32_t alpha, int32_t header, LightObj & payload)
{
return Core::Get().NewObject(model, world, x, y, z, alpha, header, payload);
}
// ------------------------------------------------------------------------------------------------
static LightObj & Object_Create(Int32 model, Int32 world, const Vector3 & pos, Int32 alpha)
static LightObj & Object_Create1a(int32_t model, int32_t world, const Vector3 & pos, int32_t alpha)
{
return Core::Get().NewObject(model, world, pos.x, pos.y, pos.z, alpha,
SQMOD_CREATE_DEFAULT, NullLightObj());
}
static LightObj & Object_Create(Int32 model, Int32 world, const Vector3 & pos, Int32 alpha,
Int32 header, LightObj & payload)
static LightObj & Object_Create1b(int32_t model, int32_t world, const Vector3 & pos, int32_t alpha,
int32_t header, LightObj & payload)
{
return Core::Get().NewObject(model, world, pos.x, pos.y, pos.z, alpha, header, payload);
}
@ -887,9 +887,9 @@ void Register_CObject(HSQUIRRELVM vm)
.FmtFunc(_SC("SetTag"), &CObject::ApplyTag)
.Func(_SC("CustomEvent"), &CObject::CustomEvent)
// Core Overloads
.Overload< bool (CObject::*)(void) >(_SC("Destroy"), &CObject::Destroy)
.Overload< bool (CObject::*)(Int32) >(_SC("Destroy"), &CObject::Destroy)
.Overload< bool (CObject::*)(Int32, LightObj &) >(_SC("Destroy"), &CObject::Destroy)
.Overload(_SC("Destroy"), &CObject::Destroy0)
.Overload(_SC("Destroy"), &CObject::Destroy1)
.Overload(_SC("Destroy"), &CObject::Destroy)
// Properties
.Prop(_SC("Model"), &CObject::GetModel)
.Prop(_SC("World"), &CObject::GetWorld, &CObject::SetWorld)
@ -938,39 +938,23 @@ void Register_CObject(HSQUIRRELVM vm)
.Func(_SC("SetAlpha"), &CObject::SetAlphaEx)
.Func(_SC("SetPosition"), &CObject::SetPositionEx)
// Member Overloads
.Overload< void (CObject::*)(const Vector3 &, Uint32) const >
(_SC("MoveTo"), &CObject::MoveTo)
.Overload< void (CObject::*)(Float32, Float32, Float32, Uint32) const >
(_SC("MoveTo"), &CObject::MoveToEx)
.Overload< void (CObject::*)(const Vector3 &, Uint32) const >
(_SC("MoveBy"), &CObject::MoveBy)
.Overload< void (CObject::*)(Float32, Float32, Float32, Uint32) const >
(_SC("MoveBy"), &CObject::MoveByEx)
.Overload< void (CObject::*)(const Quaternion &, Uint32) const >
(_SC("RotateTo"), &CObject::RotateTo)
.Overload< void (CObject::*)(Float32, Float32, Float32, Float32, Uint32) const >
(_SC("RotateTo"), &CObject::RotateToEx)
.Overload< void (CObject::*)(const Vector3 &, Uint32) const >
(_SC("RotateToEuler"), &CObject::RotateToEuler)
.Overload< void (CObject::*)(Float32, Float32, Float32, Uint32) const >
(_SC("RotateToEuler"), &CObject::RotateToEulerEx)
.Overload< void (CObject::*)(const Quaternion &, Uint32) const >
(_SC("RotateBy"), &CObject::RotateBy)
.Overload< void (CObject::*)(Float32, Float32, Float32, Float32, Uint32) const >
(_SC("RotateBy"), &CObject::RotateByEx)
.Overload< void (CObject::*)(const Vector3 &, Uint32) const >
(_SC("RotateByEuler"), &CObject::RotateByEuler)
.Overload< void (CObject::*)(Float32, Float32, Float32, Uint32) const >
(_SC("RotateByEuler"), &CObject::RotateByEulerEx)
.Overload(_SC("MoveTo"), &CObject::MoveTo)
.Overload(_SC("MoveTo"), &CObject::MoveToEx)
.Overload(_SC("MoveBy"), &CObject::MoveBy)
.Overload(_SC("MoveBy"), &CObject::MoveByEx)
.Overload(_SC("RotateTo"), &CObject::RotateTo)
.Overload(_SC("RotateTo"), &CObject::RotateToEx)
.Overload(_SC("RotateToEuler"), &CObject::RotateToEuler)
.Overload(_SC("RotateToEuler"), &CObject::RotateToEulerEx)
.Overload(_SC("RotateBy"), &CObject::RotateBy)
.Overload(_SC("RotateBy"), &CObject::RotateByEx)
.Overload(_SC("RotateByEuler"), &CObject::RotateByEuler)
.Overload(_SC("RotateByEuler"), &CObject::RotateByEulerEx)
// Static Overloads
.StaticOverload< LightObj & (*)(Int32, Int32, Float32, Float32, Float32, Int32) >
(_SC("CreateEx"), &Object_CreateEx)
.StaticOverload< LightObj & (*)(Int32, Int32, Float32, Float32, Float32, Int32, Int32, LightObj &) >
(_SC("CreateEx"), &Object_CreateEx)
.StaticOverload< LightObj & (*)(Int32, Int32, const Vector3 &, Int32) >
(_SC("Create"), &Object_Create)
.StaticOverload< LightObj & (*)(Int32, Int32, const Vector3 &, Int32, Int32, LightObj &) >
(_SC("Create"), &Object_Create)
.StaticOverload(_SC("CreateEx"), &Object_CreateEx1a)
.StaticOverload(_SC("CreateEx"), &Object_CreateEx1b)
.StaticOverload(_SC("Create"), &Object_Create1a)
.StaticOverload(_SC("Create"), &Object_Create1b)
// Raw Squirrel Methods
.SquirrelFunc(_SC("NullInst"), &CObject::SqGetNull)
.SquirrelFunc(_SC("MakeTask"), &Tasks::MakeTask< CObject, ENT_OBJECT >)

View File

@ -1,7 +1,7 @@
#pragma once
// ------------------------------------------------------------------------------------------------
#include "Base/Shared.hpp"
#include "Core/Common.hpp"
// ------------------------------------------------------------------------------------------------
namespace SqMod {
@ -23,13 +23,14 @@ class CObject
{
// --------------------------------------------------------------------------------------------
friend class Core;
friend class ObjectInst;
private:
/* --------------------------------------------------------------------------------------------
* Identifier of the managed entity.
*/
Int32 m_ID;
int32_t m_ID;
/* --------------------------------------------------------------------------------------------
* User tag associated with this instance.
@ -44,37 +45,37 @@ private:
/* --------------------------------------------------------------------------------------------
* Prevent events from triggering themselves.
*/
Uint32 m_CircularLocks;
uint32_t m_CircularLocks;
/* --------------------------------------------------------------------------------------------
* Base constructor.
*/
explicit CObject(Int32 id);
explicit CObject(int32_t id);
public:
/* --------------------------------------------------------------------------------------------
* The default duration to use when moving the object.
*/
Uint32 mMoveToDuration;
Uint32 mMoveByDuration;
uint32_t mMoveToDuration;
uint32_t mMoveByDuration;
/* --------------------------------------------------------------------------------------------
* The default duration to use when rotating the object to Quaternion.
*/
Uint32 mRotateToDuration;
Uint32 mRotateByDuration;
uint32_t mRotateToDuration;
uint32_t mRotateByDuration;
/* --------------------------------------------------------------------------------------------
* The default duration to use when rotating the object to Euler.
*/
Uint32 mRotateToEulerDuration;
Uint32 mRotateByEulerDuration;
uint32_t mRotateToEulerDuration;
uint32_t mRotateByEulerDuration;
/* --------------------------------------------------------------------------------------------
* Maximum possible number that could represent an identifier for this entity type.
*/
static const Int32 Max;
static const int32_t Max;
/* --------------------------------------------------------------------------------------------
* Copy constructor. (disabled)
@ -110,7 +111,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Used by the script engine to convert an instance of this type to a string.
*/
const String & ToString() const;
SQMOD_NODISCARD const String & ToString() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the associated null entity instance.
@ -120,12 +121,12 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve the associated null entity instance.
*/
static LightObj & GetNull();
SQMOD_NODISCARD static LightObj & GetNull();
/* --------------------------------------------------------------------------------------------
* Retrieve the identifier of the entity managed by this instance.
*/
Int32 GetID() const
SQMOD_NODISCARD int32_t GetID() const
{
return m_ID;
}
@ -133,7 +134,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Check whether this instance manages a valid entity.
*/
bool IsActive() const
SQMOD_NODISCARD bool IsActive() const
{
return VALID_ENTITY(m_ID);
}
@ -141,7 +142,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve the associated user tag.
*/
const String & GetTag() const;
SQMOD_NODISCARD const String & GetTag() const;
/* --------------------------------------------------------------------------------------------
* Modify the associated user tag.
@ -156,7 +157,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve the associated user data.
*/
LightObj & GetData();
SQMOD_NODISCARD LightObj & GetData();
/* --------------------------------------------------------------------------------------------
* Modify the associated user data.
@ -166,7 +167,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Destroy the managed object entity.
*/
bool Destroy()
bool Destroy0() const // NOLINT(modernize-use-nodiscard)
{
return Destroy(0, NullLightObj());
}
@ -174,7 +175,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Destroy the managed object entity.
*/
bool Destroy(Int32 header)
bool Destroy1(int32_t header) const // NOLINT(modernize-use-nodiscard)
{
return Destroy(header, NullLightObj());
}
@ -182,77 +183,77 @@ public:
/* --------------------------------------------------------------------------------------------
* Destroy the managed object entity.
*/
bool Destroy(Int32 header, LightObj & payload);
bool Destroy(int32_t header, LightObj & payload) const; // NOLINT(modernize-use-nodiscard)
/* --------------------------------------------------------------------------------------------
* Retrieve the events table of this entity.
*/
LightObj & GetEvents() const;
SQMOD_NODISCARD LightObj & GetEvents() const;
/* --------------------------------------------------------------------------------------------
* Emit a custom event for the managed entity
*/
void CustomEvent(Int32 header, LightObj & payload) const;
void CustomEvent(int32_t header, LightObj & payload) const;
/* --------------------------------------------------------------------------------------------
* See if the managed object entity is streamed for the specified player.
*/
bool IsStreamedFor(CPlayer & player) const;
SQMOD_NODISCARD bool IsStreamedFor(CPlayer & player) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the model of the managed object entity.
*/
Int32 GetModel() const;
SQMOD_NODISCARD int32_t GetModel() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the world in which the managed object entity exists.
*/
Int32 GetWorld() const;
SQMOD_NODISCARD int32_t GetWorld() const;
/* --------------------------------------------------------------------------------------------
* Modify the world in which the managed object entity exists.
*/
void SetWorld(Int32 world);
void SetWorld(int32_t world);
/* --------------------------------------------------------------------------------------------
* Retrieve the alpha of the managed object entity.
*/
Int32 GetAlpha() const;
SQMOD_NODISCARD int32_t GetAlpha() const;
/* --------------------------------------------------------------------------------------------
* Modify the alpha of the managed object entity.
*/
void SetAlpha(Int32 alpha);
void SetAlpha(int32_t alpha);
/* --------------------------------------------------------------------------------------------
* Modify the alpha of the managed object entity over the specified time.
*/
void SetAlphaEx(Int32 alpha, Uint32 time);
void SetAlphaEx(int32_t alpha, uint32_t time);
/* --------------------------------------------------------------------------------------------
* Move the managed object entity to the specified position over the specified time.
*/
void MoveTo(const Vector3 & pos, Uint32 time) const;
void MoveTo(const Vector3 & pos, uint32_t time) const;
/* --------------------------------------------------------------------------------------------
* Move the managed object entity to the specified position over the specified time.
*/
void MoveToEx(Float32 x, Float32 y, Float32 z, Uint32 time) const;
void MoveToEx(float x, float y, float z, uint32_t time) const;
/* --------------------------------------------------------------------------------------------
* Move the managed object entity by the specified position over the specified time.
*/
void MoveBy(const Vector3 & pos, Uint32 time) const;
void MoveBy(const Vector3 & pos, uint32_t time) const;
/* --------------------------------------------------------------------------------------------
* Move the managed object entity by the specified position over the specified time.
*/
void MoveByEx(Float32 x, Float32 y, Float32 z, Uint32 time) const;
void MoveByEx(float x, float y, float z, uint32_t time) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the position of the managed object entity.
*/
Vector3 GetPosition();
SQMOD_NODISCARD Vector3 GetPosition() const;
/* --------------------------------------------------------------------------------------------
* Modify the position of the managed object entity.
@ -262,62 +263,62 @@ public:
/* --------------------------------------------------------------------------------------------
* Modify the position of the managed object entity.
*/
void SetPositionEx(Float32 x, Float32 y, Float32 z) const;
void SetPositionEx(float x, float y, float z) const;
/* --------------------------------------------------------------------------------------------
* Rotate the managed object entity to the specified rotation over the specified time.
*/
void RotateTo(const Quaternion & rot, Uint32 time) const;
void RotateTo(const Quaternion & rot, uint32_t time) const;
/* --------------------------------------------------------------------------------------------
* Rotate the managed object entity to the specified rotation over the specified time.
*/
void RotateToEx(Float32 x, Float32 y, Float32 z, Float32 w, Uint32 time) const;
void RotateToEx(float x, float y, float z, float w, uint32_t time) const;
/* --------------------------------------------------------------------------------------------
* Rotate the managed object entity to the specified Euler rotation over the specified time.
*/
void RotateToEuler(const Vector3 & rot, Uint32 time) const;
void RotateToEuler(const Vector3 & rot, uint32_t time) const;
/* --------------------------------------------------------------------------------------------
* Rotate the managed object entity to the specified Euler rotation over the specified time.
*/
void RotateToEulerEx(Float32 x, Float32 y, Float32 z, Uint32 time) const;
void RotateToEulerEx(float x, float y, float z, uint32_t time) const;
/* --------------------------------------------------------------------------------------------
* Rotate the managed object entity by the specified rotation over the specified time.
*/
void RotateBy(const Quaternion & rot, Uint32 time) const;
void RotateBy(const Quaternion & rot, uint32_t time) const;
/* --------------------------------------------------------------------------------------------
* Rotate the managed object entity by the specified rotation over the specified time.
*/
void RotateByEx(Float32 x, Float32 y, Float32 z, Float32 w, Uint32 time) const;
void RotateByEx(float x, float y, float z, float w, uint32_t time) const;
/* --------------------------------------------------------------------------------------------
* Rotate the managed object entity by the specified Euler rotation over the specified time.
*/
void RotateByEuler(const Vector3 & rot, Uint32 time) const;
void RotateByEuler(const Vector3 & rot, uint32_t time) const;
/* --------------------------------------------------------------------------------------------
* Rotate the managed object entity by the specified Euler rotation over the specified time.
*/
void RotateByEulerEx(Float32 x, Float32 y, Float32 z, Uint32 time) const;
void RotateByEulerEx(float x, float y, float z, uint32_t time) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the rotation of the managed object entity.
*/
Quaternion GetRotation();
SQMOD_NODISCARD Quaternion GetRotation() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the Euler rotation of the managed object entity.
*/
Vector3 GetRotationEuler();
SQMOD_NODISCARD Vector3 GetRotationEuler() const;
/* --------------------------------------------------------------------------------------------
* See whether the managed object entity reports gunshots.
*/
bool GetShotReport() const;
SQMOD_NODISCARD bool GetShotReport() const;
/* --------------------------------------------------------------------------------------------
* Set whether the managed object entity reports gunshots.
@ -327,7 +328,7 @@ public:
/* --------------------------------------------------------------------------------------------
* See whether the managed object entity reports player bumps.
*/
bool GetTouchedReport() const;
SQMOD_NODISCARD bool GetTouchedReport() const;
/* --------------------------------------------------------------------------------------------
* Set whether the managed object entity reports player bumps.
@ -337,167 +338,167 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve the position on the x axis of the managed object entity.
*/
Float32 GetPositionX() const;
SQMOD_NODISCARD float GetPositionX() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the position on the y axis of the managed object entity.
*/
Float32 GetPositionY() const;
SQMOD_NODISCARD float GetPositionY() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the position on the z axis of the managed object entity.
*/
Float32 GetPositionZ() const;
SQMOD_NODISCARD float GetPositionZ() const;
/* --------------------------------------------------------------------------------------------
* Modify the position on the x axis of the managed object entity.
*/
void SetPositionX(Float32 x) const;
void SetPositionX(float x) const;
/* --------------------------------------------------------------------------------------------
* Modify the position on the y axis of the managed object entity.
*/
void SetPositionY(Float32 y) const;
void SetPositionY(float y) const;
/* --------------------------------------------------------------------------------------------
* Modify the position on the z axis of the managed object entity.
*/
void SetPositionZ(Float32 z) const;
void SetPositionZ(float z) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the rotation on the x axis of the managed object entity.
*/
Float32 GetRotationX() const;
SQMOD_NODISCARD float GetRotationX() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the rotation on the y axis of the managed object entity.
*/
Float32 GetRotationY() const;
SQMOD_NODISCARD float GetRotationY() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the rotation on the z axis of the managed object entity.
*/
Float32 GetRotationZ() const;
SQMOD_NODISCARD float GetRotationZ() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the rotation amount of the managed object entity.
*/
Float32 GetRotationW() const;
SQMOD_NODISCARD float GetRotationW() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the Euler rotation on the x axis of the managed object entity.
*/
Float32 GetEulerRotationX() const;
SQMOD_NODISCARD float GetEulerRotationX() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the Euler rotation on the y axis of the managed object entity.
*/
Float32 GetEulerRotationY() const;
SQMOD_NODISCARD float GetEulerRotationY() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the Euler rotation on the z axis of the managed object entity.
*/
Float32 GetEulerRotationZ() const;
SQMOD_NODISCARD float GetEulerRotationZ() const;
/* --------------------------------------------------------------------------------------------
* Modify the position on the x axis of the managed object entity.
*/
void MoveToX(Float32 x) const;
void MoveToX(float x) const;
/* --------------------------------------------------------------------------------------------
* Modify the position on the y axis of the managed object entity.
*/
void MoveToY(Float32 y) const;
void MoveToY(float y) const;
/* --------------------------------------------------------------------------------------------
* Modify the position on the z axis of the managed object entity.
*/
void MoveToZ(Float32 z) const;
void MoveToZ(float z) const;
/* --------------------------------------------------------------------------------------------
* Modify the position on the x axis of the managed object entity.
*/
void MoveByX(Float32 x) const;
void MoveByX(float x) const;
/* --------------------------------------------------------------------------------------------
* Modify the position on the y axis of the managed object entity.
*/
void MoveByY(Float32 y) const;
void MoveByY(float y) const;
/* --------------------------------------------------------------------------------------------
* Modify the position on the z axis of the managed object entity.
*/
void MoveByZ(Float32 z) const;
void MoveByZ(float z) const;
/* --------------------------------------------------------------------------------------------
* Modify the rotation on the x axis of the managed object entity.
*/
void RotateToX(Float32 x) const;
void RotateToX(float x) const;
/* --------------------------------------------------------------------------------------------
* Modify the rotation on the y axis of the managed object entity.
*/
void RotateToY(Float32 y) const;
void RotateToY(float y) const;
/* --------------------------------------------------------------------------------------------
* Modify the rotation on the z axis of the managed object entity.
*/
void RotateToZ(Float32 z) const;
void RotateToZ(float z) const;
/* --------------------------------------------------------------------------------------------
* Modify the rotation on the w axis of the managed object entity.
*/
void RotateToW(Float32 w) const;
void RotateToW(float w) const;
/* --------------------------------------------------------------------------------------------
* Modify the rotation on the x axis of the managed object entity.
*/
void RotateByX(Float32 x) const;
void RotateByX(float x) const;
/* --------------------------------------------------------------------------------------------
* Modify the rotation on the y axis of the managed object entity.
*/
void RotateByY(Float32 y) const;
void RotateByY(float y) const;
/* --------------------------------------------------------------------------------------------
* Modify the rotation on the z axis of the managed object entity.
*/
void RotateByZ(Float32 z) const;
void RotateByZ(float z) const;
/* --------------------------------------------------------------------------------------------
* Modify the rotation on the w axis of the managed object entity.
*/
void RotateByW(Float32 w) const;
void RotateByW(float w) const;
/* --------------------------------------------------------------------------------------------
* Modify the rotation on the x axis of the managed object entity.
*/
void RotateToEulerX(Float32 x) const;
void RotateToEulerX(float x) const;
/* --------------------------------------------------------------------------------------------
* Modify the rotation on the y axis of the managed object entity.
*/
void RotateToEulerY(Float32 y) const;
void RotateToEulerY(float y) const;
/* --------------------------------------------------------------------------------------------
* Modify the rotation on the z axis of the managed object entity.
*/
void RotateToEulerZ(Float32 z) const;
void RotateToEulerZ(float z) const;
/* --------------------------------------------------------------------------------------------
* Modify the rotation on the x axis of the managed object entity.
*/
void RotateByEulerX(Float32 x) const;
void RotateByEulerX(float x) const;
/* --------------------------------------------------------------------------------------------
* Modify the rotation on the y axis of the managed object entity.
*/
void RotateByEulerY(Float32 y) const;
void RotateByEulerY(float y) const;
/* --------------------------------------------------------------------------------------------
* Modify the rotation on the z axis of the managed object entity.
*/
void RotateByEulerZ(Float32 z) const;
void RotateByEulerZ(float z) const;
};
} // Namespace:: SqMod

View File

@ -3,16 +3,16 @@
#include "Entity/Player.hpp"
#include "Base/Vector3.hpp"
#include "Core.hpp"
#include "Misc/Tasks.hpp"
#include "Core/Tasks.hpp"
// ------------------------------------------------------------------------------------------------
namespace SqMod {
// ------------------------------------------------------------------------------------------------
SQMODE_DECL_TYPENAME(Typename, _SC("SqPickup"))
SQMOD_DECL_TYPENAME(Typename, _SC("SqPickup"))
// ------------------------------------------------------------------------------------------------
const Int32 CPickup::Max = SQMOD_PICKUP_POOL;
const int32_t CPickup::Max = SQMOD_PICKUP_POOL;
// ------------------------------------------------------------------------------------------------
SQInteger CPickup::SqGetNull(HSQUIRRELVM vm)
@ -28,9 +28,9 @@ LightObj & CPickup::GetNull()
}
// ------------------------------------------------------------------------------------------------
CPickup::CPickup(Int32 id)
CPickup::CPickup(int32_t id)
: m_ID(VALID_ENTITYGETEX(id, SQMOD_PICKUP_POOL))
, m_Tag(ToStrF("%d", id)), m_Data(), m_CircularLocks(0)
, m_Tag(fmt::format("{}", id)), m_Data(), m_CircularLocks(0)
{
/* ... */
}
@ -86,7 +86,7 @@ void CPickup::SetData(LightObj & data)
}
// ------------------------------------------------------------------------------------------------
bool CPickup::Destroy(Int32 header, LightObj & payload)
bool CPickup::Destroy(int32_t header, LightObj & payload) const
{
// Validate the managed identifier
Validate();
@ -104,11 +104,11 @@ LightObj & CPickup::GetEvents() const
}
// ------------------------------------------------------------------------------------------------
void CPickup::CustomEvent(Int32 header, LightObj & payload) const
void CPickup::CustomEvent(int32_t header, LightObj & payload) const
{
// Validate the managed identifier
Validate();
// Perfrom the requested action
// Perform the requested action
Core::Get().EmitPickupCustom(m_ID, header, payload);
}
@ -127,7 +127,7 @@ bool CPickup::IsStreamedFor(CPlayer & player) const
}
// ------------------------------------------------------------------------------------------------
bool CPickup::GetOption(Int32 option_id) const
bool CPickup::GetOption(int32_t option_id) const
{
// Attempt to obtain the current value of the specified option
const bool value = _Func->GetPickupOption(m_ID, static_cast< vcmpPickupOption >(option_id));
@ -141,7 +141,7 @@ bool CPickup::GetOption(Int32 option_id) const
}
// ------------------------------------------------------------------------------------------------
void CPickup::SetOption(Int32 option_id, bool toggle)
void CPickup::SetOption(int32_t option_id, bool toggle)
{
// Attempt to obtain the current value of the specified option
const bool value = _Func->GetPickupOption(m_ID, static_cast< vcmpPickupOption >(option_id));
@ -161,7 +161,7 @@ void CPickup::SetOption(Int32 option_id, bool toggle)
}
// ------------------------------------------------------------------------------------------------
void CPickup::SetOptionEx(Int32 option_id, bool toggle, Int32 header, LightObj & payload)
void CPickup::SetOptionEx(int32_t option_id, bool toggle, int32_t header, LightObj & payload)
{
// Attempt to obtain the current value of the specified option
const bool value = _Func->GetPickupOption(m_ID, static_cast< vcmpPickupOption >(option_id));
@ -181,7 +181,7 @@ void CPickup::SetOptionEx(Int32 option_id, bool toggle, Int32 header, LightObj &
}
// ------------------------------------------------------------------------------------------------
Int32 CPickup::GetWorld() const
int32_t CPickup::GetWorld() const
{
// Validate the managed identifier
Validate();
@ -190,12 +190,12 @@ Int32 CPickup::GetWorld() const
}
// ------------------------------------------------------------------------------------------------
void CPickup::SetWorld(Int32 world)
void CPickup::SetWorld(int32_t world)
{
// Validate the managed identifier
Validate();
// Grab the current value for this property
const Int32 current = _Func->GetPickupWorld(m_ID);
const int32_t current = _Func->GetPickupWorld(m_ID);
// Don't even bother if it's the same value
if (current == world)
{
@ -214,7 +214,7 @@ void CPickup::SetWorld(Int32 world)
}
// ------------------------------------------------------------------------------------------------
Int32 CPickup::GetAlpha() const
int32_t CPickup::GetAlpha() const
{
// Validate the managed identifier
Validate();
@ -223,12 +223,12 @@ Int32 CPickup::GetAlpha() const
}
// ------------------------------------------------------------------------------------------------
void CPickup::SetAlpha(Int32 alpha)
void CPickup::SetAlpha(int32_t alpha)
{
// Validate the managed identifier
Validate();
// Grab the current value for this property
const Int32 current = _Func->GetPickupAlpha(m_ID);
const int32_t current = _Func->GetPickupAlpha(m_ID);
// Don't even bother if it's the same value
if (current == alpha)
{
@ -280,7 +280,7 @@ void CPickup::SetAutomatic(bool toggle)
}
// ------------------------------------------------------------------------------------------------
Int32 CPickup::GetAutoTimer() const
int32_t CPickup::GetAutoTimer() const
{
// Validate the managed identifier
Validate();
@ -289,12 +289,12 @@ Int32 CPickup::GetAutoTimer() const
}
// ------------------------------------------------------------------------------------------------
void CPickup::SetAutoTimer(Int32 timer)
void CPickup::SetAutoTimer(int32_t timer)
{
// Validate the managed identifier
Validate();
// Grab the current value for this property
const Int32 current = _Func->GetPickupAutoTimer(m_ID);
const int32_t current = _Func->GetPickupAutoTimer(m_ID);
// Don't even bother if it's the same value
if (current == timer)
{
@ -322,7 +322,7 @@ void CPickup::Refresh() const
}
// ------------------------------------------------------------------------------------------------
Vector3 CPickup::GetPosition()
Vector3 CPickup::GetPosition() const
{
// Validate the managed identifier
Validate();
@ -344,7 +344,7 @@ void CPickup::SetPosition(const Vector3 & pos) const
}
// ------------------------------------------------------------------------------------------------
void CPickup::SetPositionEx(Float32 x, Float32 y, Float32 z) const
void CPickup::SetPositionEx(float x, float y, float z) const
{
// Validate the managed identifier
Validate();
@ -353,7 +353,7 @@ void CPickup::SetPositionEx(Float32 x, Float32 y, Float32 z) const
}
// ------------------------------------------------------------------------------------------------
Int32 CPickup::GetModel() const
int32_t CPickup::GetModel() const
{
// Validate the managed identifier
Validate();
@ -362,7 +362,7 @@ Int32 CPickup::GetModel() const
}
// ------------------------------------------------------------------------------------------------
Int32 CPickup::GetQuantity() const
int32_t CPickup::GetQuantity() const
{
// Validate the managed identifier
Validate();
@ -371,12 +371,12 @@ Int32 CPickup::GetQuantity() const
}
// ------------------------------------------------------------------------------------------------
Float32 CPickup::GetPositionX() const
float CPickup::GetPositionX() const
{
// Validate the managed identifier
Validate();
// Clear previous position information, if any
Float32 x = 0.0f, dummy;
float x = 0.0f, dummy;
// Query the server for the requested component value
_Func->GetPickupPosition(m_ID, &x, &dummy, &dummy);
// Return the requested information
@ -384,12 +384,12 @@ Float32 CPickup::GetPositionX() const
}
// ------------------------------------------------------------------------------------------------
Float32 CPickup::GetPositionY() const
float CPickup::GetPositionY() const
{
// Validate the managed identifier
Validate();
// Clear previous position information, if any
Float32 y = 0.0f, dummy;
float y = 0.0f, dummy;
// Query the server for the requested component value
_Func->GetPickupPosition(m_ID, &dummy, &y, &dummy);
// Return the requested information
@ -397,12 +397,12 @@ Float32 CPickup::GetPositionY() const
}
// ------------------------------------------------------------------------------------------------
Float32 CPickup::GetPositionZ() const
float CPickup::GetPositionZ() const
{
// Validate the managed identifier
Validate();
// Clear previous position information, if any
Float32 z = 0.0f, dummy;
float z = 0.0f, dummy;
// Query the server for the requested component value
_Func->GetPickupPosition(m_ID, &dummy, &dummy, &z);
// Return the requested information
@ -410,12 +410,12 @@ Float32 CPickup::GetPositionZ() const
}
// ------------------------------------------------------------------------------------------------
void CPickup::SetPositionX(Float32 x) const
void CPickup::SetPositionX(float x) const
{
// Validate the managed identifier
Validate();
// Reserve some temporary floats to retrieve the missing components
Float32 y, z, dummy;
float y, z, dummy;
// Retrieve the current values for unchanged components
_Func->GetPickupPosition(m_ID, &dummy, &y, &z);
// Perform the requested operation
@ -423,12 +423,12 @@ void CPickup::SetPositionX(Float32 x) const
}
// ------------------------------------------------------------------------------------------------
void CPickup::SetPositionY(Float32 y) const
void CPickup::SetPositionY(float y) const
{
// Validate the managed identifier
Validate();
// Reserve some temporary floats to retrieve the missing components
Float32 x, z, dummy;
float x, z, dummy;
// Retrieve the current values for unchanged components
_Func->GetPickupPosition(m_ID, &x, &dummy, &z);
// Perform the requested operation
@ -436,12 +436,12 @@ void CPickup::SetPositionY(Float32 y) const
}
// ------------------------------------------------------------------------------------------------
void CPickup::SetPositionZ(Float32 z) const
void CPickup::SetPositionZ(float z) const
{
// Validate the managed identifier
Validate();
// Reserve some temporary floats to retrieve the missing components
Float32 x, y, dummy;
float x, y, dummy;
// Retrieve the current values for unchanged components
_Func->GetPickupPosition(m_ID, &x, &y, &dummy);
// Perform the requested operation
@ -449,30 +449,30 @@ void CPickup::SetPositionZ(Float32 z) const
}
// ------------------------------------------------------------------------------------------------
static LightObj & Pickup_CreateEx(Int32 model, Int32 world, Int32 quantity,
Float32 x, Float32 y, Float32 z, Int32 alpha, bool automatic)
static LightObj & Pickup_CreateEx1a(int32_t model, int32_t world, int32_t quantity,
float x, float y, float z, int32_t alpha, bool automatic)
{
return Core::Get().NewPickup(model, world, quantity, x, y, z, alpha, automatic,
SQMOD_CREATE_DEFAULT, NullLightObj());
}
static LightObj & Pickup_CreateEx(Int32 model, Int32 world, Int32 quantity,
Float32 x, Float32 y, Float32 z, Int32 alpha, bool automatic,
Int32 header, LightObj & payload)
static LightObj & Pickup_CreateEx1b(int32_t model, int32_t world, int32_t quantity,
float x, float y, float z, int32_t alpha, bool automatic,
int32_t header, LightObj & payload)
{
return Core::Get().NewPickup(model, world, quantity, x, y, z, alpha, automatic, header, payload);
}
// ------------------------------------------------------------------------------------------------
static LightObj & Pickup_Create(Int32 model, Int32 world, Int32 quantity, const Vector3 & pos,
Int32 alpha, bool automatic)
static LightObj & Pickup_Create1a(int32_t model, int32_t world, int32_t quantity, const Vector3 & pos,
int32_t alpha, bool automatic)
{
return Core::Get().NewPickup(model, world, quantity, pos.x, pos.y, pos.z, alpha, automatic,
SQMOD_CREATE_DEFAULT, NullLightObj());
}
static LightObj & Pickup_Create(Int32 model, Int32 world, Int32 quantity, const Vector3 & pos,
Int32 alpha, bool automatic, Int32 header, LightObj & payload)
static LightObj & Pickup_Create1b(int32_t model, int32_t world, int32_t quantity, const Vector3 & pos,
int32_t alpha, bool automatic, int32_t header, LightObj & payload)
{
return Core::Get().NewPickup(model, world, quantity, pos.x, pos.y, pos.z, alpha, automatic,
header, payload);
@ -498,9 +498,9 @@ void Register_CPickup(HSQUIRRELVM vm)
.FmtFunc(_SC("SetTag"), &CPickup::ApplyTag)
.Func(_SC("CustomEvent"), &CPickup::CustomEvent)
// Core Overloads
.Overload< bool (CPickup::*)(void) >(_SC("Destroy"), &CPickup::Destroy)
.Overload< bool (CPickup::*)(Int32) >(_SC("Destroy"), &CPickup::Destroy)
.Overload< bool (CPickup::*)(Int32, LightObj &) >(_SC("Destroy"), &CPickup::Destroy)
.Overload(_SC("Destroy"), &CPickup::Destroy)
.Overload(_SC("Destroy"), &CPickup::Destroy)
.Overload(_SC("Destroy"), &CPickup::Destroy)
// Properties
.Prop(_SC("Model"), &CPickup::GetModel)
.Prop(_SC("World"), &CPickup::GetWorld, &CPickup::SetWorld)
@ -508,7 +508,7 @@ void Register_CPickup(HSQUIRRELVM vm)
.Prop(_SC("Auto"), &CPickup::GetAutomatic, &CPickup::SetAutomatic)
.Prop(_SC("Automatic"), &CPickup::GetAutomatic, &CPickup::SetAutomatic)
.Prop(_SC("Timer"), &CPickup::GetAutoTimer, &CPickup::SetAutoTimer)
.Prop(_SC("Autotimer"), &CPickup::GetAutoTimer, &CPickup::SetAutoTimer)
.Prop(_SC("AutoTimer"), &CPickup::GetAutoTimer, &CPickup::SetAutoTimer)
.Prop(_SC("Pos"), &CPickup::GetPosition, &CPickup::SetPosition)
.Prop(_SC("Position"), &CPickup::GetPosition, &CPickup::SetPosition)
.Prop(_SC("Quantity"), &CPickup::GetQuantity)
@ -524,14 +524,10 @@ void Register_CPickup(HSQUIRRELVM vm)
.Func(_SC("SetPos"), &CPickup::SetPositionEx)
.Func(_SC("SetPosition"), &CPickup::SetPositionEx)
// Static Overloads
.StaticOverload< LightObj & (*)(Int32, Int32, Int32, Float32, Float32, Float32, Int32, bool) >
(_SC("CreateEx"), &Pickup_CreateEx)
.StaticOverload< LightObj & (*)(Int32, Int32, Int32, Float32, Float32, Float32, Int32, bool, Int32, LightObj &) >
(_SC("CreateEx"), &Pickup_CreateEx)
.StaticOverload< LightObj & (*)(Int32, Int32, Int32, const Vector3 &, Int32, bool) >
(_SC("Create"), &Pickup_Create)
.StaticOverload< LightObj & (*)(Int32, Int32, Int32, const Vector3 &, Int32, bool, Int32, LightObj &) >
(_SC("Create"), &Pickup_Create)
.StaticOverload(_SC("CreateEx"), &Pickup_CreateEx1a)
.StaticOverload(_SC("CreateEx"), &Pickup_CreateEx1b)
.StaticOverload(_SC("Create"), &Pickup_Create1a)
.StaticOverload(_SC("Create"), &Pickup_Create1b)
// Raw Squirrel Methods
.SquirrelFunc(_SC("NullInst"), &CPickup::SqGetNull)
.SquirrelFunc(_SC("MakeTask"), &Tasks::MakeTask< CPickup, ENT_PICKUP >)

View File

@ -1,7 +1,7 @@
#pragma once
// ------------------------------------------------------------------------------------------------
#include "Base/Shared.hpp"
#include "Core/Common.hpp"
// ------------------------------------------------------------------------------------------------
namespace SqMod {
@ -25,13 +25,14 @@ class CPickup
{
// --------------------------------------------------------------------------------------------
friend class Core;
friend class PickupInst;
private:
/* --------------------------------------------------------------------------------------------
* Identifier of the managed entity.
*/
Int32 m_ID;
int32_t m_ID;
/* --------------------------------------------------------------------------------------------
* User tag associated with this instance.
@ -46,19 +47,19 @@ private:
/* --------------------------------------------------------------------------------------------
* Prevent events from triggering themselves.
*/
Uint32 m_CircularLocks;
uint32_t m_CircularLocks;
/* --------------------------------------------------------------------------------------------
* Base constructor.
*/
explicit CPickup(Int32 id);
explicit CPickup(int32_t id);
public:
/* --------------------------------------------------------------------------------------------
* Maximum possible number that could represent an identifier for this entity type.
*/
static const Int32 Max;
static const int32_t Max;
/* --------------------------------------------------------------------------------------------
* Copy constructor. (disabled)
@ -94,7 +95,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Used by the script engine to convert an instance of this type to a string.
*/
const String & ToString() const;
SQMOD_NODISCARD const String & ToString() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the associated null entity instance.
@ -104,12 +105,12 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve the associated null entity instance.
*/
static LightObj & GetNull();
SQMOD_NODISCARD static LightObj & GetNull();
/* --------------------------------------------------------------------------------------------
* Retrieve the identifier of the entity managed by this instance.
*/
Int32 GetID() const
SQMOD_NODISCARD int32_t GetID() const
{
return m_ID;
}
@ -117,7 +118,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Check whether this instance manages a valid entity.
*/
bool IsActive() const
SQMOD_NODISCARD bool IsActive() const
{
return VALID_ENTITY(m_ID);
}
@ -125,7 +126,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve the associated user tag.
*/
const String & GetTag() const;
SQMOD_NODISCARD const String & GetTag() const;
/* --------------------------------------------------------------------------------------------
* Modify the associated user tag.
@ -140,7 +141,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve the associated user data.
*/
LightObj & GetData();
SQMOD_NODISCARD LightObj & GetData();
/* --------------------------------------------------------------------------------------------
* Modify the associated user data.
@ -150,7 +151,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Destroy the managed pickup entity.
*/
bool Destroy()
bool Destroy0() const // NOLINT(modernize-use-nodiscard)
{
return Destroy(0, NullLightObj());
}
@ -158,7 +159,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Destroy the managed pickup entity.
*/
bool Destroy(Int32 header)
bool Destroy1(int32_t header) const // NOLINT(modernize-use-nodiscard)
{
return Destroy(header, NullLightObj());
}
@ -166,62 +167,62 @@ public:
/* --------------------------------------------------------------------------------------------
* Destroy the managed pickup entity.
*/
bool Destroy(Int32 header, LightObj & payload);
bool Destroy(int32_t header, LightObj & payload) const; // NOLINT(modernize-use-nodiscard)
/* --------------------------------------------------------------------------------------------
* Retrieve the events table of this entity.
*/
LightObj & GetEvents() const;
SQMOD_NODISCARD LightObj & GetEvents() const;
/* --------------------------------------------------------------------------------------------
* Emit a custom event for the managed entity
*/
void CustomEvent(Int32 header, LightObj & payload) const;
void CustomEvent(int32_t header, LightObj & payload) const;
/* --------------------------------------------------------------------------------------------
* See if the managed pickup entity is streamed for the specified player.
*/
bool IsStreamedFor(CPlayer & player) const;
SQMOD_NODISCARD bool IsStreamedFor(CPlayer & player) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the current option value of the managed pickup entity.
*/
bool GetOption(Int32 option_id) const;
SQMOD_NODISCARD bool GetOption(int32_t option_id) const;
/* --------------------------------------------------------------------------------------------
* Modify the current option value of the managed pickup entity.
*/
void SetOption(Int32 option_id, bool toggle);
void SetOption(int32_t option_id, bool toggle);
/* --------------------------------------------------------------------------------------------
* Modify the current option value of the managed pickup entity.
*/
void SetOptionEx(Int32 option_id, bool toggle, Int32 header, LightObj & payload);
void SetOptionEx(int32_t option_id, bool toggle, int32_t header, LightObj & payload);
/* --------------------------------------------------------------------------------------------
* Retrieve the world in which the managed pickup entity exists.
*/
Int32 GetWorld() const;
SQMOD_NODISCARD int32_t GetWorld() const;
/* --------------------------------------------------------------------------------------------
* Mpdify the world in which the managed pickup entity exists.
* Modify the world in which the managed pickup entity exists.
*/
void SetWorld(Int32 world);
void SetWorld(int32_t world);
/* --------------------------------------------------------------------------------------------
* Retrieve the alpha of the managed pickup entity.
*/
Int32 GetAlpha() const;
SQMOD_NODISCARD int32_t GetAlpha() const;
/* --------------------------------------------------------------------------------------------
* Mpdify the alpha of the managed pickup entity.
* Modify the alpha of the managed pickup entity.
*/
void SetAlpha(Int32 alpha);
void SetAlpha(int32_t alpha);
/* --------------------------------------------------------------------------------------------
* See whether the managed pickup entity is automatic.
*/
bool GetAutomatic() const;
SQMOD_NODISCARD bool GetAutomatic() const;
/* --------------------------------------------------------------------------------------------
* Set whether the managed pickup entity is automatic.
@ -231,12 +232,12 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve the automatic timer of the managed pickup entity.
*/
Int32 GetAutoTimer() const;
SQMOD_NODISCARD int32_t GetAutoTimer() const;
/* --------------------------------------------------------------------------------------------
* Mpdify the automatic timer of the managed pickup entity.
* Modify the automatic timer of the managed pickup entity.
*/
void SetAutoTimer(Int32 timer);
void SetAutoTimer(int32_t timer);
/* --------------------------------------------------------------------------------------------
* Refresh the managed pickup entity.
@ -246,57 +247,57 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve the position of the managed pickup entity.
*/
Vector3 GetPosition();
SQMOD_NODISCARD Vector3 GetPosition() const;
/* --------------------------------------------------------------------------------------------
* Mpdify the position of the managed pickup entity.
* Modify the position of the managed pickup entity.
*/
void SetPosition(const Vector3 & pos) const;
/* --------------------------------------------------------------------------------------------
* Mpdify the position of the managed pickup entity.
* Modify the position of the managed pickup entity.
*/
void SetPositionEx(Float32 x, Float32 y, Float32 z) const;
void SetPositionEx(float x, float y, float z) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the model of the managed pickup entity.
*/
Int32 GetModel() const;
SQMOD_NODISCARD int32_t GetModel() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the quantity of the managed pickup entity.
*/
Int32 GetQuantity() const;
SQMOD_NODISCARD int32_t GetQuantity() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the position on the x axis of the managed pickup entity.
*/
Float32 GetPositionX() const;
SQMOD_NODISCARD float GetPositionX() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the position on the y axis of the managed pickup entity.
*/
Float32 GetPositionY() const;
SQMOD_NODISCARD float GetPositionY() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the position on the z axis of the managed pickup entity.
*/
Float32 GetPositionZ() const;
SQMOD_NODISCARD float GetPositionZ() const;
/* --------------------------------------------------------------------------------------------
* Modify the position on the x axis of the managed pickup entity.
*/
void SetPositionX(Float32 x) const;
void SetPositionX(float x) const;
/* --------------------------------------------------------------------------------------------
* Modify the position on the y axis of the managed pickup entity.
*/
void SetPositionY(Float32 y) const;
void SetPositionY(float y) const;
/* --------------------------------------------------------------------------------------------
* Modify the position on the z axis of the managed pickup entity.
*/
void SetPositionZ(Float32 z) const;
void SetPositionZ(float z) const;
};
} // Namespace:: SqMod

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,8 @@
#pragma once
// ------------------------------------------------------------------------------------------------
#include "Base/Shared.hpp"
#include "Base/Buffer.hpp"
#include "Core/Common.hpp"
#include "Core/Buffer.hpp"
// ------------------------------------------------------------------------------------------------
namespace SqMod {
@ -31,6 +31,7 @@ class CPlayer
{
// --------------------------------------------------------------------------------------------
friend class Core;
friend class PlayerInst;
private:
@ -40,7 +41,7 @@ private:
/* --------------------------------------------------------------------------------------------
* Identifier of the managed entity.
*/
Int32 m_ID;
int32_t m_ID;
/* --------------------------------------------------------------------------------------------
* User tag associated with this instance.
@ -60,12 +61,12 @@ private:
/* --------------------------------------------------------------------------------------------
* Prevent events from triggering themselves.
*/
Uint32 m_CircularLocks;
uint32_t m_CircularLocks;
/* --------------------------------------------------------------------------------------------
* Base constructor.
*/
explicit CPlayer(Int32 id);
explicit CPlayer(int32_t id);
public:
@ -75,27 +76,27 @@ public:
/* --------------------------------------------------------------------------------------------
* Maximum possible number that could represent an identifier for this entity type.
*/
static const Int32 Max;
static const int32_t Max;
/* --------------------------------------------------------------------------------------------
* The initial size of the allocated memory buffer when starting a new stream.
*/
Uint32 mBufferInitSize;
uint32_t mBufferInitSize;
/* --------------------------------------------------------------------------------------------
* Default color to use in client messages.
*/
Uint32 mMessageColor;
uint32_t mMessageColor;
/* --------------------------------------------------------------------------------------------
* Default style to use in client announcements.
*/
Int32 mAnnounceStyle;
int32_t mAnnounceStyle;
/* --------------------------------------------------------------------------------------------
* Default ammo to give to the managed player when not specifying any.
*/
Int32 mDefaultAmmo;
int32_t mDefaultAmmo;
/* --------------------------------------------------------------------------------------------
* Set of strings to add before a client message automatically.
@ -161,7 +162,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Used by the script engine to convert an instance of this type to a string.
*/
const String & ToString() const;
SQMOD_NODISCARD const String & ToString() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the associated null entity instance.
@ -171,12 +172,12 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve the associated null entity instance.
*/
static LightObj & GetNull();
SQMOD_NODISCARD static LightObj & GetNull();
/* --------------------------------------------------------------------------------------------
* Retrieve the identifier of the entity managed by this instance.
*/
Int32 GetID() const
SQMOD_NODISCARD int32_t GetID() const
{
return m_ID;
}
@ -184,7 +185,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Check whether this instance manages a valid entity.
*/
bool IsActive() const
SQMOD_NODISCARD bool IsActive() const
{
return VALID_ENTITY(m_ID);
}
@ -192,7 +193,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve the associated user tag.
*/
const String & GetTag() const;
SQMOD_NODISCARD const String & GetTag() const;
/* --------------------------------------------------------------------------------------------
* Modify the associated user tag.
@ -207,7 +208,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve the associated user data.
*/
LightObj & GetData();
SQMOD_NODISCARD LightObj & GetData();
/* --------------------------------------------------------------------------------------------
* Modify the associated user data.
@ -217,17 +218,17 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve the events table of this entity.
*/
LightObj & GetEvents() const;
SQMOD_NODISCARD LightObj & GetEvents() const;
/* --------------------------------------------------------------------------------------------
* Emit a custom event for the managed entity
*/
void CustomEvent(Int32 header, LightObj & payload) const;
void CustomEvent(int32_t header, LightObj & payload) const;
/* --------------------------------------------------------------------------------------------
* See whether the managed player entity is connected.
*/
bool IsConnected() const;
SQMOD_NODISCARD bool IsConnected() const;
/* --------------------------------------------------------------------------------------------
* See if the managed player entity is streamed for the specified player.
@ -237,7 +238,7 @@ public:
/* --------------------------------------------------------------------------------------------
* See whether the managed player entity has administrator privileges.
*/
bool GetAdmin() const;
SQMOD_NODISCARD bool GetAdmin() const;
/* --------------------------------------------------------------------------------------------
* Set whether the managed player entity has administrator privileges.
@ -247,17 +248,17 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve the ip address of the managed player entity.
*/
CSStr GetIP() const;
SQMOD_NODISCARD const SQChar * GetIP() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the unique user identifier of the managed player entity.
*/
CSStr GetUID() const;
SQMOD_NODISCARD const SQChar * GetUID() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the unique user identifier version 2 of the managed player entity.
*/
CSStr GetUID2() const;
SQMOD_NODISCARD const SQChar * GetUID2() const;
#if SQMOD_SDK_LEAST(2, 1)
/* --------------------------------------------------------------------------------------------
* Set player's health to 0 and reset the death reason.
@ -272,7 +273,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Kick the managed player entity from the server.
*/
void KickBecause(Int32 header, LightObj & payload) const;
void KickBecause(int32_t header, LightObj & payload) const;
/* --------------------------------------------------------------------------------------------
* Ban the managed player entity from the server.
@ -282,17 +283,17 @@ public:
/* --------------------------------------------------------------------------------------------
* Ban the managed player entity from the server.
*/
void BanBecause(Int32 header, LightObj & payload) const;
void BanBecause(int32_t header, LightObj & payload) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the key of the managed player entity.
*/
Uint32 GetKey() const;
SQMOD_NODISCARD uint32_t GetKey() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the nick name of the managed player entity.
*/
CSStr GetName() const;
SQMOD_NODISCARD const SQChar * GetName() const;
/* --------------------------------------------------------------------------------------------
* Modify the nick name of the managed player entity.
@ -302,92 +303,92 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve the current state of the managed player entity.
*/
Int32 GetState() const;
SQMOD_NODISCARD int32_t GetState() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the current option value of the managed player entity.
*/
Int32 GetOption(Int32 option_id) const;
SQMOD_NODISCARD int32_t GetOption(int32_t option_id) const;
/* --------------------------------------------------------------------------------------------
* Modify the current option value of the managed player entity.
*/
void SetOption(Int32 option_id, bool toggle);
void SetOption(int32_t option_id, bool toggle);
/* --------------------------------------------------------------------------------------------
* Modify the current option value of the managed player entity.
*/
void SetOptionEx(Int32 option_id, bool toggle, Int32 header, LightObj & payload);
void SetOptionEx(int32_t option_id, bool toggle, int32_t header, LightObj & payload);
#if SQMOD_SDK_LEAST(2, 1)
/* --------------------------------------------------------------------------------------------
* Retrieve network statistics related to the managed player entity.
*/
SQFloat GetNetworkStatisticsF(Int32 option_id) const;
SQMOD_NODISCARD SQFloat GetNetworkStatisticsF(int32_t option_id) const;
/* --------------------------------------------------------------------------------------------
* Retrieve network statistics related to the managed player entity.
*/
SQInteger GetNetworkStatisticsI(Int32 option_id) const;
SQMOD_NODISCARD SQInteger GetNetworkStatisticsI(int32_t option_id) const;
#endif
/* --------------------------------------------------------------------------------------------
* Retrieve the world in which the managed player entity exists.
*/
Int32 GetWorld() const;
SQMOD_NODISCARD int32_t GetWorld() const;
/* --------------------------------------------------------------------------------------------
* Modify the world in which the managed player entity exists.
*/
void SetWorld(Int32 world);
void SetWorld(int32_t world);
/* --------------------------------------------------------------------------------------------
* Retrieve the secondary world of the managed player entity.
*/
Int32 GetSecondaryWorld() const;
SQMOD_NODISCARD int32_t GetSecondaryWorld() const;
/* --------------------------------------------------------------------------------------------
* Modify the secondary world of the managed player entity.
*/
void SetSecondaryWorld(Int32 world);
void SetSecondaryWorld(int32_t world);
/* --------------------------------------------------------------------------------------------
* Retrieve the unique world of the managed player entity.
*/
Int32 GetUniqueWorld() const;
SQMOD_NODISCARD int32_t GetUniqueWorld() const;
/* --------------------------------------------------------------------------------------------
* See whether the managed player entity is compatible with the specified world.
*/
bool IsWorldCompatible(Int32 world) const;
SQMOD_NODISCARD bool IsWorldCompatible(int32_t world) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the class of the managed player entity.
*/
Int32 GetClass() const;
SQMOD_NODISCARD int32_t GetClass() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the team of the managed player entity.
*/
Int32 GetTeam() const;
SQMOD_NODISCARD int32_t GetTeam() const;
/* --------------------------------------------------------------------------------------------
* Modify the team of the managed player entity.
*/
void SetTeam(Int32 team);
void SetTeam(int32_t team);
/* --------------------------------------------------------------------------------------------
* Retrieve the skin identifier of the managed player entity.
*/
Int32 GetSkin() const;
SQMOD_NODISCARD int32_t GetSkin() const;
/* --------------------------------------------------------------------------------------------
* Modify the skin identifier of the managed player entity.
*/
void SetSkin(Int32 skin);
void SetSkin(int32_t skin);
/* --------------------------------------------------------------------------------------------
* Retrieve the color of the managed player entity.
*/
Color3 GetColor() const;
SQMOD_NODISCARD Color3 GetColor() const;
/* --------------------------------------------------------------------------------------------
* Modify the color of the managed player entity.
@ -397,12 +398,12 @@ public:
/* --------------------------------------------------------------------------------------------
* Modify the color of the managed player entity.
*/
void SetColorEx(Uint8 r, Uint8 g, Uint8 b) const;
void SetColorEx(uint8_t r, uint8_t g, uint8_t b) const;
/* --------------------------------------------------------------------------------------------
* See whether the managed player entity is spawned.
*/
bool IsSpawned() const;
SQMOD_NODISCARD bool IsSpawned() const;
/* --------------------------------------------------------------------------------------------
* Force the managed player entity to spawn in the game.
@ -417,87 +418,87 @@ public:
/* --------------------------------------------------------------------------------------------
* See whether the managed player entity is typing.
*/
bool IsTyping() const;
SQMOD_NODISCARD bool IsTyping() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the money amount of the managed player entity.
*/
Int32 GetMoney() const;
SQMOD_NODISCARD int32_t GetMoney() const;
/* --------------------------------------------------------------------------------------------
* Modify the money amount of the managed player entity.
*/
void SetMoney(Int32 amount);
void SetMoney(int32_t amount);
/* --------------------------------------------------------------------------------------------
* Give a certain amount of money to the managed player entity.
*/
void GiveMoney(Int32 amount);
void GiveMoney(int32_t amount);
/* --------------------------------------------------------------------------------------------
* Retrieve the score of the managed player entity.
*/
Int32 GetScore() const;
SQMOD_NODISCARD int32_t GetScore() const;
/* --------------------------------------------------------------------------------------------
* Modify the score of the managed player entity.
*/
void SetScore(Int32 score);
void SetScore(int32_t score);
/* --------------------------------------------------------------------------------------------
* Retrieve the wanted level of the managed player entity.
*/
Int32 GetWantedLevel() const;
SQMOD_NODISCARD int32_t GetWantedLevel() const;
/* --------------------------------------------------------------------------------------------
* Modify the wanted level of the managed player entity.
*/
void SetWantedLevel(Int32 level);
void SetWantedLevel(int32_t level);
/* --------------------------------------------------------------------------------------------
* Retrieve the connection latency of the managed player entity.
*/
Int32 GetPing() const;
SQMOD_NODISCARD int32_t GetPing() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the frames per second of the managed player entity.
*/
SQFloat GetFPS() const;
SQMOD_NODISCARD SQFloat GetFPS() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the current health of the managed player entity.
*/
Float32 GetHealth() const;
SQMOD_NODISCARD float GetHealth() const;
/* --------------------------------------------------------------------------------------------
* Modify the health of the managed player entity.
*/
void SetHealth(Float32 amount) const;
void SetHealth(float amount) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the current health of the managed player entity.
*/
Float32 GetArmor() const;
SQMOD_NODISCARD float GetArmor() const;
/* --------------------------------------------------------------------------------------------
* Modify the health of the managed player entity.
*/
void SetArmor(Float32 amount) const;
void SetArmor(float amount) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the immunity flags of the managed player entity.
*/
Int32 GetImmunity() const;
SQMOD_NODISCARD int32_t GetImmunity() const;
/* --------------------------------------------------------------------------------------------
* Modify the immunity flags of the managed player entity.
*/
void SetImmunity(Int32 flags);
void SetImmunity(int32_t flags);
/* --------------------------------------------------------------------------------------------
* Retrieve the position of the managed player entity.
*/
Vector3 GetPosition() const;
SQMOD_NODISCARD Vector3 GetPosition() const;
/* --------------------------------------------------------------------------------------------
* Modify the position of the managed player entity.
@ -507,12 +508,12 @@ public:
/* --------------------------------------------------------------------------------------------
* Modify the position of the managed player entity.
*/
void SetPositionEx(Float32 x, Float32 y, Float32 z) const;
void SetPositionEx(float x, float y, float z) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the speed of the managed player entity.
*/
Vector3 GetSpeed() const;
SQMOD_NODISCARD Vector3 GetSpeed() const;
/* --------------------------------------------------------------------------------------------
* Modify the speed of the managed player entity.
@ -522,7 +523,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Modify the speed of the managed player entity.
*/
void SetSpeedEx(Float32 x, Float32 y, Float32 z) const;
void SetSpeedEx(float x, float y, float z) const;
/* --------------------------------------------------------------------------------------------
* Modify the speed of the managed player entity.
@ -532,62 +533,62 @@ public:
/* --------------------------------------------------------------------------------------------
* Modify the speed of the managed player entity.
*/
void AddSpeedEx(Float32 x, Float32 y, Float32 z) const;
void AddSpeedEx(float x, float y, float z) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the heading angle of the managed player entity.
*/
Float32 GetHeading() const;
SQMOD_NODISCARD float GetHeading() const;
/* --------------------------------------------------------------------------------------------
* Modify the heading angle of the managed player entity.
*/
void SetHeading(Float32 angle) const;
void SetHeading(float angle) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the alpha of the managed player entity.
*/
Int32 GetAlpha() const;
SQMOD_NODISCARD int32_t GetAlpha() const;
/* --------------------------------------------------------------------------------------------
* Modify the alpha of the managed player entity.
*/
void SetAlpha(Int32 alpha);
void SetAlpha(int32_t alpha);
/* --------------------------------------------------------------------------------------------
* Modify the alpha of the managed player entity.
*/
void SetAlphaEx(Int32 alpha, Int32 fade);
void SetAlphaEx(int32_t alpha, int32_t fade);
/* --------------------------------------------------------------------------------------------
* Retrieve the aim position of the managed player entity.
*/
Vector3 GetAimPosition() const;
SQMOD_NODISCARD Vector3 GetAimPosition() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the aim direction of the managed player entity.
*/
Vector3 GetAimDirection() const;
SQMOD_NODISCARD Vector3 GetAimDirection() const;
/* --------------------------------------------------------------------------------------------
* See whether the managed player entity is burning.
*/
bool IsBurning() const;
SQMOD_NODISCARD bool IsBurning() const;
/* --------------------------------------------------------------------------------------------
* See whether the managed player entity is crouched.
*/
bool IsCrouched() const;
SQMOD_NODISCARD bool IsCrouched() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the current action of the managed player entity.
*/
Int32 GetAction() const;
SQMOD_NODISCARD int32_t GetAction() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the game keys of the managed player entity.
*/
Int32 GetGameKeys() const;
SQMOD_NODISCARD int32_t GetGameKeys() const;
/* --------------------------------------------------------------------------------------------
* Embark the managed player entity into the specified vehicle entity.
@ -597,7 +598,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Embark the managed player entity into the specified vehicle entity.
*/
bool Embark(CVehicle & vehicle, Int32 slot, bool allocate, bool warp) const;
bool EmbarkEx(CVehicle & vehicle, int32_t slot, bool allocate, bool warp) const;
/* --------------------------------------------------------------------------------------------
* Disembark the managed player entity from the currently embarked vehicle entity.
@ -607,72 +608,72 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve the vehicle status of the managed player entity.
*/
Int32 GetVehicleStatus() const;
SQMOD_NODISCARD int32_t GetVehicleStatus() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the occupied vehicle slot by the managed player entity.
*/
Int32 GetVehicleSlot() const;
SQMOD_NODISCARD int32_t GetVehicleSlot() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the vehicle in which the managed player entity is embarked.
*/
LightObj & GetVehicle() const;
SQMOD_NODISCARD LightObj & GetVehicle() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the vehicle identifier in which the managed player entity is embarked.
*/
Int32 GetVehicleID() const;
SQMOD_NODISCARD int32_t GetVehicleID() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the weapon identifier of the managed player entity.
*/
Int32 GetWeapon() const;
SQMOD_NODISCARD int32_t GetWeapon() const;
/* --------------------------------------------------------------------------------------------
* Modify the weapon of the managed player entity.
*/
void SetWeapon(Int32 wep) const;
void SetWeapon(int32_t wep) const;
/* --------------------------------------------------------------------------------------------
* Modify the weapon of the managed player entity.
*/
void SetWeaponEx(Int32 wep, Int32 ammo) const;
void SetWeaponEx(int32_t wep, int32_t ammo) const;
/* --------------------------------------------------------------------------------------------
* Give a weapon of the managed player entity.
*/
void GiveWeapon(Int32 wep, Int32 ammo) const;
void GiveWeapon(int32_t wep, int32_t ammo) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the active weapon ammo of the managed player entity.
*/
Int32 GetAmmo() const;
SQMOD_NODISCARD int32_t GetAmmo() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the weapon slot of the managed player entity.
*/
Int32 GetWeaponSlot() const;
SQMOD_NODISCARD int32_t GetWeaponSlot() const;
/* --------------------------------------------------------------------------------------------
* Modify the weapon slot of the managed player entity.
*/
void SetWeaponSlot(Int32 slot) const;
void SetWeaponSlot(int32_t slot) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the weapon identifier at the specified slot for the managed player entity.
*/
Int32 GetWeaponAtSlot(Int32 slot) const;
SQMOD_NODISCARD int32_t GetWeaponAtSlot(int32_t slot) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the ammo from the weapon at the specified slot for the managed player entity.
*/
Int32 GetAmmoAtSlot(Int32 slot) const;
SQMOD_NODISCARD int32_t GetAmmoAtSlot(int32_t slot) const;
/* --------------------------------------------------------------------------------------------
* Remove a certain weapon from the managed player entity.
*/
void RemoveWeapon(Int32 wep) const;
void RemoveWeapon(int32_t wep) const;
/* --------------------------------------------------------------------------------------------
* Strip the managed player entity of all weapons.
@ -687,7 +688,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Modify the camera position of the managed player entity.
*/
void SetCameraPosition(Float32 xp, Float32 yp, Float32 zp, Float32 xa, Float32 ya, Float32 za) const;
void SetCameraPositionEx(float xp, float yp, float zp, float xa, float ya, float za) const;
/* --------------------------------------------------------------------------------------------
* Restore the camera position of the managed player entity.
@ -697,37 +698,37 @@ public:
/* --------------------------------------------------------------------------------------------
* See whether the managed player entity has camera locked.
*/
bool IsCameraLocked() const;
SQMOD_NODISCARD bool IsCameraLocked() const;
/* --------------------------------------------------------------------------------------------
* Modify the animation of the managed player entity.
*/
void SetAnimation(Int32 anim) const;
void SetAnimation(int32_t anim) const;
/* --------------------------------------------------------------------------------------------
* Modify the animation of the managed player entity.
*/
void SetAnimation(Int32 anim, Int32 group) const;
void SetAnimationEx(int32_t anim, int32_t group) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the vehicle that the managed player entity is standing on.
*/
LightObj & StandingOnVehicle() const;
SQMOD_NODISCARD LightObj & StandingOnVehicle() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the object that the managed player entity is standing on.
*/
LightObj & StandingOnObject() const;
SQMOD_NODISCARD LightObj & StandingOnObject() const;
/* --------------------------------------------------------------------------------------------
* See whether the managed player entity is away.
*/
bool IsAway() const;
SQMOD_NODISCARD bool IsAway() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the player that the managed player entity is spectating.
*/
LightObj & GetSpectator() const;
SQMOD_NODISCARD LightObj & GetSpectator() const;
/* --------------------------------------------------------------------------------------------
* Set the managed player entity to spectate the specified player entity.
@ -737,7 +738,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve the identifier of the player that the managed player entity is spectating.
*/
SQInteger GetSpectatorID() const;
SQMOD_NODISCARD SQInteger GetSpectatorID() const;
/* --------------------------------------------------------------------------------------------
* Set the managed player entity to spectate the specified player entity.
@ -757,7 +758,7 @@ public:
/* --------------------------------------------------------------------------------------------
* See whether the target player sees an objective arrow over a player.
*/
bool GetPlayer3DArrow(CPlayer & target) const;
SQMOD_NODISCARD bool GetPlayer3DArrow(CPlayer & target) const;
/* --------------------------------------------------------------------------------------------
* Set whether the target player will see an objective arrow over a player.
@ -767,23 +768,23 @@ public:
/* --------------------------------------------------------------------------------------------
* See whether the target player sees an objective arrow over a player.
*/
bool GetPlayer3DArrowID(SQInteger id) const;
SQMOD_NODISCARD bool GetPlayer3DArrowID(SQInteger id) const;
/* --------------------------------------------------------------------------------------------
* Smoothly pivots the camera angle.
*/
bool InterpolateCameraLookAt(const Vector3 & pos, Uint32 ms) const;
SQMOD_NODISCARD bool InterpolateCameraLookAt(const Vector3 & pos, uint32_t ms) const;
/* --------------------------------------------------------------------------------------------
* Smoothly pivots the camera angle.
*/
bool InterpolateCameraLookAtEx(Float32 x, Float32 y, Float32 z, Uint32 ms) const;
SQMOD_NODISCARD bool InterpolateCameraLookAtEx(float x, float y, float z, uint32_t ms) const;
#endif
/* --------------------------------------------------------------------------------------------
* Redirect the managed player entity to the specified server.
*/
void Redirect(StackStrF & ip, Uint32 port, StackStrF & nick,
StackStrF & server_pass, StackStrF & user_pass);
void Redirect(StackStrF & ip, uint32_t port, StackStrF & nick,
StackStrF & server_pass, StackStrF & user_pass) const;
/* --------------------------------------------------------------------------------------------
* Request a list of the modules loaded into the client session.
@ -793,7 +794,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve the authority level of the managed player entity.
*/
void PlaySound(Int32 sound_id) const;
void PlaySound(int32_t sound_id) const;
#if SQMOD_SDK_LEAST(2, 1)
/* --------------------------------------------------------------------------------------------
* Set how delayed a player's turn handling is when in a vehicle.
@ -803,7 +804,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve how delayed a player's turn handling is when in a vehicle.
*/
SQInteger GetDrunkHandling() const;
SQMOD_NODISCARD SQInteger GetDrunkHandling() const;
/* --------------------------------------------------------------------------------------------
* Set how intense the drunk blur overlay is for a player.
@ -813,37 +814,37 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve how intense the drunk blur overlay is for a player.
*/
SQInteger GetDrunkVisuals() const;
SQMOD_NODISCARD SQInteger GetDrunkVisuals() const;
#endif
/* --------------------------------------------------------------------------------------------
* Create a checkpoint or sphere for this player.
*/
LightObj & CreateCheckpointEx(Int32 world, bool sphere, Float32 x, Float32 y, Float32 z,
Uint8 r, Uint8 g, Uint8 b, Uint8 a, Float32 radius) const;
LightObj & CreateCheckpointEx1a(int32_t world, bool sphere, float x, float y, float z, // NOLINT(modernize-use-nodiscard)
uint8_t r, uint8_t g, uint8_t b, uint8_t a, float radius) const;
/* --------------------------------------------------------------------------------------------
* Create a checkpoint or sphere for this player.
*/
LightObj & CreateCheckpointEx(Int32 world, bool sphere, Float32 x, Float32 y, Float32 z,
Uint8 r, Uint8 g, Uint8 b, Uint8 a, Float32 radius,
Int32 header, LightObj & payload) const;
LightObj & CreateCheckpointEx1b(int32_t world, bool sphere, float x, float y, float z, // NOLINT(modernize-use-nodiscard)
uint8_t r, uint8_t g, uint8_t b, uint8_t a, float radius,
int32_t header, LightObj & payload) const;
/* --------------------------------------------------------------------------------------------
* Create a checkpoint or sphere for this player.
*/
LightObj & CreateCheckpoint(Int32 world, bool sphere, const Vector3 & pos,
const Color4 & color, Float32 radius) const;
LightObj & CreateCheckpoint1a(int32_t world, bool sphere, const Vector3 & pos, // NOLINT(modernize-use-nodiscard)
const Color4 & color, float radius) const;
/* --------------------------------------------------------------------------------------------
* Create a checkpoint or sphere for this player.
*/
LightObj & CreateCheckpoint(Int32 world, bool sphere, const Vector3 & pos, const Color4 & color,
Float32 radius, Int32 header, LightObj & payload) const;
LightObj & CreateCheckpoint1b(int32_t world, bool sphere, const Vector3 & pos, const Color4 & color, // NOLINT(modernize-use-nodiscard)
float radius, int32_t header, LightObj & payload) const;
/* --------------------------------------------------------------------------------------------
* See whether the managed player entity collides with user defined areas.
*/
bool GetCollideAreas() const;
SQMOD_NODISCARD bool GetCollideAreas() const;
/* --------------------------------------------------------------------------------------------
* Set whether the managed player entity can collide with user defined areas.
@ -858,27 +859,27 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve the authority level of the managed player entity.
*/
Int32 GetAuthority() const;
SQMOD_NODISCARD int32_t GetAuthority() const;
/* --------------------------------------------------------------------------------------------
* Modify the authority level of the managed player entity.
*/
void SetAuthority(Int32 level) const;
void SetAuthority(int32_t level) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the message prefix at the specified index for the managed player entity.
*/
const String & GetMessagePrefix(Uint32 index) const;
SQMOD_NODISCARD const String & GetMessagePrefix(uint32_t index) const;
/* --------------------------------------------------------------------------------------------
* Modify the message prefix at the specified index for the managed player entity.
*/
void SetMessagePrefix(Uint32 index, StackStrF & prefix);
void SetMessagePrefix(uint32_t index, StackStrF & prefix);
/* --------------------------------------------------------------------------------------------
* Retrieve the amount of tracked position changes for the managed player entity.
*/
SQInteger GetTrackPosition() const;
SQMOD_NODISCARD SQInteger GetTrackPosition() const;
/* --------------------------------------------------------------------------------------------
* Modify the amount of tracked position changes for the managed player entity.
@ -888,12 +889,12 @@ public:
/* --------------------------------------------------------------------------------------------
* Modify the amount of tracked position changes for the managed player entity.
*/
void SetTrackPositionEx(SQInteger num, Int32 header, const LightObj & payload) const;
void SetTrackPositionEx(SQInteger num, int32_t header, const LightObj & payload) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the amount of tracked heading changes for the managed player entity.
*/
SQInteger GetTrackHeading() const;
SQMOD_NODISCARD SQInteger GetTrackHeading() const;
/* --------------------------------------------------------------------------------------------
* Modify the amount of tracked heading changes for the managed player entity.
@ -903,32 +904,32 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve the last known weapon for the managed player entity.
*/
Int32 GetLastWeapon() const;
SQMOD_NODISCARD int32_t GetLastWeapon() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the last known health for the managed player entity.
*/
Float32 GetLastHealth() const;
SQMOD_NODISCARD float GetLastHealth() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the last known armour for the managed player entity.
*/
Float32 GetLastArmour() const;
SQMOD_NODISCARD float GetLastArmour() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the last known heading for the managed player entity.
*/
Float32 GetLastHeading() const;
SQMOD_NODISCARD float GetLastHeading() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the last known position for the managed player entity.
*/
const Vector3 & GetLastPosition() const;
SQMOD_NODISCARD const Vector3 & GetLastPosition() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the distance traveled by the managed player entity while tracking was enabled.
*/
SQFloat GetDistance() const;
SQMOD_NODISCARD SQFloat GetDistance() const;
/* --------------------------------------------------------------------------------------------
* Modify the distance traveled by the managed player entity.
@ -938,7 +939,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Check whether distance tracking is enabled for the managed player entity.
*/
bool GetTrackDistance() const;
SQMOD_NODISCARD bool GetTrackDistance() const;
/* --------------------------------------------------------------------------------------------
* Set whether distance tracking is enabled for the managed player entity.
@ -953,17 +954,17 @@ public:
/* --------------------------------------------------------------------------------------------
* Start a new stream with a custom size.
*/
void StartStream(Uint32 size);
void StartStreamEx(uint32_t size);
/* --------------------------------------------------------------------------------------------
* Retrieve the current cursor position of the stream buffer.
*/
Int32 GetBufferCursor() const;
SQMOD_NODISCARD int32_t GetBufferCursor() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the current cursor position of the stream buffer.
*/
void SetBufferCursor(Int32 pos);
void SetBufferCursor(int32_t pos);
/* --------------------------------------------------------------------------------------------
* Write a 8bit byte to the stream buffer.
@ -1003,7 +1004,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve the total capacity of the buffer stream in bytes.
*/
Uint32 GetBufferCapacity() const;
SQMOD_NODISCARD uint32_t GetBufferCapacity() const;
/* --------------------------------------------------------------------------------------------
* Send the specified buffer contents to the managed player entity.
@ -1013,62 +1014,62 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve the position on the x axis of the managed player entity.
*/
Float32 GetPositionX() const;
SQMOD_NODISCARD float GetPositionX() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the position on the y axis of the managed player entity.
*/
Float32 GetPositionY() const;
SQMOD_NODISCARD float GetPositionY() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the position on the z axis of the managed player entity.
*/
Float32 GetPositionZ() const;
SQMOD_NODISCARD float GetPositionZ() const;
/* --------------------------------------------------------------------------------------------
* Modify the position on the x axis of the managed player entity.
*/
void SetPositionX(Float32 x) const;
void SetPositionX(float x) const;
/* --------------------------------------------------------------------------------------------
* Modify the position on the y axis of the managed player entity.
*/
void SetPositionY(Float32 y) const;
void SetPositionY(float y) const;
/* --------------------------------------------------------------------------------------------
* Modify the position on the z axis of the managed player entity.
*/
void SetPositionZ(Float32 z) const;
void SetPositionZ(float z) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the red color of the managed player entity.
*/
Int32 GetColorR() const;
SQMOD_NODISCARD int32_t GetColorR() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the green color of the managed player entity.
*/
Int32 GetColorG() const;
SQMOD_NODISCARD int32_t GetColorG() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the blue color of the managed player entity.
*/
Int32 GetColorB() const;
SQMOD_NODISCARD int32_t GetColorB() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the red color of the managed player entity.
*/
void SetColorR(Int32 r) const;
void SetColorR(int32_t r) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the green color of the managed player entity.
*/
void SetColorG(Int32 g) const;
void SetColorG(int32_t g) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the blue color of the managed player entity.
*/
void SetColorB(Int32 b) const;
void SetColorB(int32_t b) const;
/* --------------------------------------------------------------------------------------------
* Send a formatted colored message to the managed player entity.

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
#pragma once
// ------------------------------------------------------------------------------------------------
#include "Base/Shared.hpp"
#include "Core/Common.hpp"
// ------------------------------------------------------------------------------------------------
namespace SqMod {
@ -28,13 +28,14 @@ class CVehicle
{
// --------------------------------------------------------------------------------------------
friend class Core;
friend class VehicleInst;
private:
/* --------------------------------------------------------------------------------------------
* Identifier of the managed entity.
*/
Int32 m_ID;
int32_t m_ID;
/* --------------------------------------------------------------------------------------------
* User tag associated with this instance.
@ -49,19 +50,19 @@ private:
/* --------------------------------------------------------------------------------------------
* Prevent events from triggering themselves.
*/
Uint32 m_CircularLocks;
uint32_t m_CircularLocks;
/* --------------------------------------------------------------------------------------------
* Base constructor.
*/
explicit CVehicle(Int32 id);
explicit CVehicle(int32_t id);
public:
/* --------------------------------------------------------------------------------------------
* Maximum possible number that could represent an identifier for this entity type.
*/
static const Int32 Max;
static const int32_t Max;
/* --------------------------------------------------------------------------------------------
* Copy constructor. (disabled)
@ -97,7 +98,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Used by the script engine to convert an instance of this type to a string.
*/
const String & ToString() const;
SQMOD_NODISCARD const String & ToString() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the associated null entity instance.
@ -107,12 +108,12 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve the associated null entity instance.
*/
static LightObj & GetNull();
SQMOD_NODISCARD static LightObj & GetNull();
/* --------------------------------------------------------------------------------------------
* Retrieve the identifier of the entity managed by this instance.
*/
Int32 GetID() const
SQMOD_NODISCARD int32_t GetID() const
{
return m_ID;
}
@ -120,7 +121,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Check whether this instance manages a valid entity.
*/
bool IsActive() const
SQMOD_NODISCARD bool IsActive() const
{
return VALID_ENTITY(m_ID);
}
@ -128,7 +129,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve the associated user tag.
*/
const String & GetTag() const;
SQMOD_NODISCARD const String & GetTag() const;
/* --------------------------------------------------------------------------------------------
* Modify the associated user tag.
@ -143,7 +144,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve the associated user data.
*/
LightObj & GetData();
SQMOD_NODISCARD LightObj & GetData();
/* --------------------------------------------------------------------------------------------
* Modify the associated user data.
@ -153,7 +154,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Destroy the managed vehicle entity.
*/
bool Destroy()
bool Destroy0() const // NOLINT(modernize-use-nodiscard)
{
return Destroy(0, NullLightObj());
}
@ -161,7 +162,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Destroy the managed vehicle entity.
*/
bool Destroy(Int32 header)
bool Destroy1(int32_t header) const // NOLINT(modernize-use-nodiscard)
{
return Destroy(header, NullLightObj());
}
@ -169,17 +170,17 @@ public:
/* --------------------------------------------------------------------------------------------
* Destroy the managed vehicle entity.
*/
bool Destroy(Int32 header, LightObj & payload);
bool Destroy(int32_t header, LightObj & payload) const; // NOLINT(modernize-use-nodiscard)
/* --------------------------------------------------------------------------------------------
* Retrieve the events table of this entity.
*/
LightObj & GetEvents() const;
SQMOD_NODISCARD LightObj & GetEvents() const;
/* --------------------------------------------------------------------------------------------
* Emit a custom event for the managed entity
*/
void CustomEvent(Int32 header, LightObj & payload) const;
void CustomEvent(int32_t header, LightObj & payload) const;
/* --------------------------------------------------------------------------------------------
* See if the managed vehicle entity is streamed for the specified player.
@ -189,57 +190,57 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve the current option value of the managed vehicle entity.
*/
bool GetOption(Int32 option_id) const;
SQMOD_NODISCARD bool GetOption(int32_t option_id) const;
/* --------------------------------------------------------------------------------------------
* Modify the current option value of the managed vehicle entity.
*/
void SetOption(Int32 option_id, bool toggle);
void SetOption(int32_t option_id, bool toggle);
/* --------------------------------------------------------------------------------------------
* Modify the current option value of the managed vehicle entity.
*/
void SetOptionEx(Int32 option_id, bool toggle, Int32 header, LightObj & payload);
void SetOptionEx(int32_t option_id, bool toggle, int32_t header, LightObj & payload);
/* --------------------------------------------------------------------------------------------
* Retrieve the synchronization source of the managed vehicle entity.
*/
Int32 GetSyncSource() const;
SQMOD_NODISCARD int32_t GetSyncSource() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the synchronization type of the managed vehicle entity.
*/
Int32 GetSyncType() const;
SQMOD_NODISCARD int32_t GetSyncType() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the world in which the managed vehicle entity exists.
*/
Int32 GetWorld() const;
SQMOD_NODISCARD int32_t GetWorld() const;
/* --------------------------------------------------------------------------------------------
* Modify the world in which the managed vehicle entity exists.
*/
void SetWorld(Int32 world);
void SetWorld(int32_t world);
/* --------------------------------------------------------------------------------------------
* Retrieve the vehicle model of the managed vehicle entity.
*/
Int32 GetModel() const;
SQMOD_NODISCARD int32_t GetModel() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the slot occupant from the managed vehicle entity.
*/
LightObj & GetOccupant(Int32 slot) const;
SQMOD_NODISCARD LightObj & GetOccupant(int32_t slot) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the slot occupant identifier from the managed vehicle entity.
*/
Int32 GetOccupantID(Int32 slot) const;
SQMOD_NODISCARD int32_t GetOccupantID(int32_t slot) const;
/* --------------------------------------------------------------------------------------------
* See whether the managed vehicle entity has an occupant in a certain slot.
*/
bool HasOccupant(Int32 slot) const;
SQMOD_NODISCARD bool HasOccupant(int32_t slot) const;
/* --------------------------------------------------------------------------------------------
* Respawn the managed vehicle entity.
@ -249,12 +250,12 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve the immunity flags of the managed vehicle entity.
*/
Int32 GetImmunity() const;
SQMOD_NODISCARD int32_t GetImmunity() const;
/* --------------------------------------------------------------------------------------------
* Modify the immunity flags of the managed vehicle entity.
*/
void SetImmunity(Int32 flags);
void SetImmunity(int32_t flags);
/* --------------------------------------------------------------------------------------------
* Explode the managed vehicle entity.
@ -264,12 +265,12 @@ public:
/* --------------------------------------------------------------------------------------------
* See whether the managed vehicle entity is wrecked.
*/
bool IsWrecked() const;
SQMOD_NODISCARD bool IsWrecked() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the position of the managed vehicle entity.
*/
Vector3 GetPosition() const;
SQMOD_NODISCARD Vector3 GetPosition() const;
/* --------------------------------------------------------------------------------------------
* Modify the position of the managed vehicle entity.
@ -279,22 +280,22 @@ public:
/* --------------------------------------------------------------------------------------------
* Modify the position of the managed vehicle entity.
*/
void SetPositionEx(const Vector3 & pos, bool empty) const;
void SetPositionB(const Vector3 & pos, bool empty) const;
/* --------------------------------------------------------------------------------------------
* Modify the position of the managed vehicle entity.
*/
void SetPositionEx(Float32 x, Float32 y, Float32 z) const;
void SetPositionEx(float x, float y, float z) const;
/* --------------------------------------------------------------------------------------------
* Modify the position of the managed vehicle entity.
*/
void SetPositionEx(Float32 x, Float32 y, Float32 z, bool empty) const;
void SetPositionExB(float x, float y, float z, bool empty) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the rotation of the managed vehicle entity.
*/
Quaternion GetRotation() const;
SQMOD_NODISCARD Quaternion GetRotation() const;
/* --------------------------------------------------------------------------------------------
* Modify the rotation of the managed vehicle entity.
@ -304,12 +305,12 @@ public:
/* --------------------------------------------------------------------------------------------
* Modify the rotation of the managed vehicle entity.
*/
void SetRotationEx(Float32 x, Float32 y, Float32 z, Float32 w) const;
void SetRotationEx(float x, float y, float z, float w) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the euler rotation of the managed vehicle entity.
*/
Vector3 GetRotationEuler() const;
SQMOD_NODISCARD Vector3 GetRotationEuler() const;
/* --------------------------------------------------------------------------------------------
* Modify the euler rotation of the managed vehicle entity.
@ -319,12 +320,12 @@ public:
/* --------------------------------------------------------------------------------------------
* Modify the euler rotation of the managed vehicle entity.
*/
void SetRotationEulerEx(Float32 x, Float32 y, Float32 z) const;
void SetRotationEulerEx(float x, float y, float z) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the speed of the managed vehicle entity.
*/
Vector3 GetSpeed() const;
SQMOD_NODISCARD Vector3 GetSpeed() const;
/* --------------------------------------------------------------------------------------------
* Modify the speed of the managed vehicle entity.
@ -334,7 +335,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Modify the speed of the managed vehicle entity.
*/
void SetSpeedEx(Float32 x, Float32 y, Float32 z) const;
void SetSpeedEx(float x, float y, float z) const;
/* --------------------------------------------------------------------------------------------
* Modify the speed of the managed vehicle entity.
@ -344,12 +345,12 @@ public:
/* --------------------------------------------------------------------------------------------
* Modify the speed of the managed vehicle entity.
*/
void AddSpeedEx(Float32 x, Float32 y, Float32 z) const;
void AddSpeedEx(float x, float y, float z) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the relative speed of the managed vehicle entity.
*/
Vector3 GetRelativeSpeed() const;
SQMOD_NODISCARD Vector3 GetRelativeSpeed() const;
/* --------------------------------------------------------------------------------------------
* Modify the relative speed of the managed vehicle entity.
@ -359,7 +360,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Modify the relative speed of the managed vehicle entity.
*/
void SetRelativeSpeedEx(Float32 x, Float32 y, Float32 z) const;
void SetRelativeSpeedEx(float x, float y, float z) const;
/* --------------------------------------------------------------------------------------------
* Modify the relative speed of the managed vehicle entity.
@ -369,12 +370,12 @@ public:
/* --------------------------------------------------------------------------------------------
* Modify the relative speed of the managed vehicle entity.
*/
void AddRelativeSpeedEx(Float32 x, Float32 y, Float32 z) const;
void AddRelativeSpeedEx(float x, float y, float z) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the turn speed of the managed vehicle entity.
*/
Vector3 GetTurnSpeed() const;
SQMOD_NODISCARD Vector3 GetTurnSpeed() const;
/* --------------------------------------------------------------------------------------------
* Modify the turn speed of the managed vehicle entity.
@ -384,7 +385,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Modify the turn speed of the managed vehicle entity.
*/
void SetTurnSpeedEx(Float32 x, Float32 y, Float32 z) const;
void SetTurnSpeedEx(float x, float y, float z) const;
/* --------------------------------------------------------------------------------------------
* Modify the turn speed of the managed vehicle entity.
@ -394,12 +395,12 @@ public:
/* --------------------------------------------------------------------------------------------
* Modify the turn speed of the managed vehicle entity.
*/
void AddTurnSpeedEx(Float32 x, Float32 y, Float32 z) const;
void AddTurnSpeedEx(float x, float y, float z) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the relative turn speed of the managed vehicle entity.
*/
Vector3 GetRelativeTurnSpeed() const;
SQMOD_NODISCARD Vector3 GetRelativeTurnSpeed() const;
/* --------------------------------------------------------------------------------------------
* Modify the relative turn speed of the managed vehicle entity.
@ -409,7 +410,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Modify the relative turn speed of the managed vehicle entity.
*/
void SetRelativeTurnSpeedEx(Float32 x, Float32 y, Float32 z) const;
void SetRelativeTurnSpeedEx(float x, float y, float z) const;
/* --------------------------------------------------------------------------------------------
* Modify the relative turn speed of the managed vehicle entity.
@ -419,12 +420,12 @@ public:
/* --------------------------------------------------------------------------------------------
* Modify the relative turn speed of the managed vehicle entity.
*/
void AddRelativeTurnSpeedEx(Float32 x, Float32 y, Float32 z) const;
void AddRelativeTurnSpeedEx(float x, float y, float z) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the spawn position of the managed vehicle entity.
*/
Vector3 GetSpawnPosition() const;
SQMOD_NODISCARD Vector3 GetSpawnPosition() const;
/* --------------------------------------------------------------------------------------------
* Modify the spawn position of the managed vehicle entity.
@ -434,12 +435,12 @@ public:
/* --------------------------------------------------------------------------------------------
* Modify the spawn position of the managed vehicle entity.
*/
void SetSpawnPositionEx(Float32 x, Float32 y, Float32 z) const;
void SetSpawnPositionEx(float x, float y, float z) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the spawn rotation of the managed vehicle entity.
*/
Quaternion GetSpawnRotation() const;
SQMOD_NODISCARD Quaternion GetSpawnRotation() const;
/* --------------------------------------------------------------------------------------------
* Modify the spawn rotation of the managed vehicle entity.
@ -449,12 +450,12 @@ public:
/* --------------------------------------------------------------------------------------------
* Modify the spawn rotation of the managed vehicle entity.
*/
void SetSpawnRotationEx(Float32 x, Float32 y, Float32 z, Float32 w) const;
void SetSpawnRotationEx(float x, float y, float z, float w) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the euler spawn rotation of the managed vehicle entity.
*/
Vector3 GetSpawnRotationEuler() const;
SQMOD_NODISCARD Vector3 GetSpawnRotationEuler() const;
/* --------------------------------------------------------------------------------------------
* Modify the euler spawn rotation of the managed vehicle entity.
@ -464,27 +465,27 @@ public:
/* --------------------------------------------------------------------------------------------
* Modify the euler spawn rotation of the managed vehicle entity.
*/
void SetSpawnRotationEulerEx(Float32 x, Float32 y, Float32 z) const;
void SetSpawnRotationEulerEx(float x, float y, float z) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the respawn timer of the managed vehicle entity.
*/
Uint32 GetIdleRespawnTimer() const;
SQMOD_NODISCARD uint32_t GetIdleRespawnTimer() const;
/* --------------------------------------------------------------------------------------------
* Modify the respawn timer of the managed vehicle entity.
*/
void SetIdleRespawnTimer(Uint32 millis) const;
void SetIdleRespawnTimer(uint32_t millis) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the health of the managed vehicle entity.
*/
Float32 GetHealth() const;
SQMOD_NODISCARD float GetHealth() const;
/* --------------------------------------------------------------------------------------------
* Modify the health of the managed vehicle entity.
*/
void SetHealth(Float32 amount) const;
void SetHealth(float amount) const;
/* --------------------------------------------------------------------------------------------
* Fix the damage and restore health for the managed vehicle entity.
@ -494,102 +495,102 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve the primary color of the managed vehicle entity.
*/
Int32 GetPrimaryColor() const;
SQMOD_NODISCARD int32_t GetPrimaryColor() const;
/* --------------------------------------------------------------------------------------------
* Modify the primary color of the managed vehicle entity.
*/
void SetPrimaryColor(Int32 col) const;
void SetPrimaryColor(int32_t col) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the secondary color of the managed vehicle entity.
*/
Int32 GetSecondaryColor() const;
SQMOD_NODISCARD int32_t GetSecondaryColor() const;
/* --------------------------------------------------------------------------------------------
* Modify the secondary color of the managed vehicle entity.
*/
void SetSecondaryColor(Int32 col) const;
void SetSecondaryColor(int32_t col) const;
/* --------------------------------------------------------------------------------------------
* Modify the primary and secondary colors of the managed vehicle entity.
*/
void SetColors(Int32 primary, Int32 secondary) const;
void SetColors(int32_t primary, int32_t secondary) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the part status of the managed vehicle entity.
*/
Int32 GetPartStatus(Int32 part) const;
SQMOD_NODISCARD int32_t GetPartStatus(int32_t part) const;
/* --------------------------------------------------------------------------------------------
* Modify the part status of the managed vehicle entity.
*/
void SetPartStatus(Int32 part, Int32 status);
void SetPartStatus(int32_t part, int32_t status);
/* --------------------------------------------------------------------------------------------
* Retrieve the tyre status of the managed vehicle entity.
*/
Int32 GetTyreStatus(Int32 tyre) const;
SQMOD_NODISCARD int32_t GetTyreStatus(int32_t tyre) const;
/* --------------------------------------------------------------------------------------------
* Modify the tyre status of the managed vehicle entity.
*/
void SetTyreStatus(Int32 tyre, Int32 status);
void SetTyreStatus(int32_t tyre, int32_t status);
/* --------------------------------------------------------------------------------------------
* Retrieve the damage data of the managed vehicle entity.
*/
Uint32 GetDamageData() const;
SQMOD_NODISCARD uint32_t GetDamageData() const;
/* --------------------------------------------------------------------------------------------
* Modify the damage data of the managed vehicle entity.
*/
void SetDamageData(Uint32 data);
void SetDamageData(uint32_t data);
/* --------------------------------------------------------------------------------------------
* Retrieve the radio of the managed vehicle entity.
*/
Int32 GetRadio() const;
SQMOD_NODISCARD int32_t GetRadio() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the radio of the managed vehicle entity.
*/
void SetRadio(Int32 radio);
void SetRadio(int32_t radio);
/* --------------------------------------------------------------------------------------------
* Retrieve the turret rotation of the managed vehicle entity.
*/
Vector2 GetTurretRotation() const;
SQMOD_NODISCARD Vector2 GetTurretRotation() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the horizontal turret rotation of the managed vehicle entity.
*/
Float32 GetHorizontalTurretRotation() const;
SQMOD_NODISCARD float GetHorizontalTurretRotation() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the vertical turret rotation of the managed vehicle entity.
*/
Float32 GetVerticalTurretRotation() const;
SQMOD_NODISCARD float GetVerticalTurretRotation() const;
/* --------------------------------------------------------------------------------------------
* See whether the specified handling ruleexists in the managed vehicle entity.
* See whether the specified handling rule exists in the managed vehicle entity.
*/
bool ExistsHandlingRule(Int32 rule) const;
SQMOD_NODISCARD bool ExistsHandlingRule(int32_t rule) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the handling data of the managed vehicle entity.
*/
SQFloat GetHandlingRule(Int32 rule) const;
SQMOD_NODISCARD SQFloat GetHandlingRule(int32_t rule) const;
/* --------------------------------------------------------------------------------------------
* Modify the handling data of the managed vehicle entity.
*/
void SetHandlingRule(Int32 rule, Float32 data);
void SetHandlingRule(int32_t rule, float data);
/* --------------------------------------------------------------------------------------------
* Reset the specified handling rule for the managed vehicle entity.
*/
void ResetHandlingRule(Int32 rule);
void ResetHandlingRule(int32_t rule);
/* --------------------------------------------------------------------------------------------
* Reset all the handling rules for the managed vehicle entity.
@ -599,12 +600,12 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve the lights data for the managed vehicle entity.
*/
Int32 GetLightsData() const;
SQMOD_NODISCARD int32_t GetLightsData() const;
/* --------------------------------------------------------------------------------------------
* Modify the lights data for the managed vehicle entity.
*/
void SetLightsData(Int32 data) const;
void SetLightsData(int32_t data) const;
/* --------------------------------------------------------------------------------------------
* Embark the specified player entity into the managed vehicle entity.
@ -614,7 +615,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Embark the specified player entity into the managed vehicle entity.
*/
bool Embark(CPlayer & player, Int32 slot, bool allocate, bool warp) const;
bool EmbarkEx(CPlayer & player, int32_t slot, bool allocate, bool warp) const;
#if SQMOD_SDK_LEAST(2, 1)
/* --------------------------------------------------------------------------------------------
* Set whether the target player will see an objective arrow over a vehicle.
@ -624,7 +625,7 @@ public:
/* --------------------------------------------------------------------------------------------
* See whether the target player sees an objective arrow over a vehicle.
*/
bool GetPlayer3DArrow(CPlayer & target) const;
SQMOD_NODISCARD bool GetPlayer3DArrow(CPlayer & target) const;
/* --------------------------------------------------------------------------------------------
* Set whether the target player will see an objective arrow over a vehicle.
@ -634,12 +635,12 @@ public:
/* --------------------------------------------------------------------------------------------
* See whether the target player sees an objective arrow over a vehicle.
*/
bool GetPlayer3DArrowID(SQInteger id) const;
SQMOD_NODISCARD bool GetPlayer3DArrowID(SQInteger id) const;
#endif
/* --------------------------------------------------------------------------------------------
* See whether the managed vehicle entity collides with user defined areas.
*/
bool GetCollideAreas() const;
SQMOD_NODISCARD bool GetCollideAreas() const;
/* --------------------------------------------------------------------------------------------
* Set whether the managed vehicle entity can collide with user defined areas.
@ -654,7 +655,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve the amount of tracked position changes for the managed vehicle entity.
*/
SQInteger GetTrackPosition() const;
SQMOD_NODISCARD SQInteger GetTrackPosition() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the amount of tracked position changes for the managed vehicle entity.
@ -664,7 +665,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve the amount of tracked rotation changes for the managed vehicle entity.
*/
SQInteger GetTrackRotation() const;
SQMOD_NODISCARD SQInteger GetTrackRotation() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the amount of tracked rotation changes for the managed vehicle entity.
@ -674,32 +675,32 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve the last known primary color for the managed vehicle entity.
*/
Int32 GetLastPrimaryColor() const;
SQMOD_NODISCARD int32_t GetLastPrimaryColor() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the last known secondary color for the managed vehicle entity.
*/
Int32 GetLastSecondaryColor() const;
SQMOD_NODISCARD int32_t GetLastSecondaryColor() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the last known health for the managed vehicle entity.
*/
Float32 GetLastHealth() const;
SQMOD_NODISCARD float GetLastHealth() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the last known position for the managed vehicle entity.
*/
const Vector3 & GetLastPosition() const;
SQMOD_NODISCARD const Vector3 & GetLastPosition() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the last known rotation for the managed vehicle entity.
*/
const Quaternion & GetLastRotation() const;
SQMOD_NODISCARD const Quaternion & GetLastRotation() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the distance traveled by the managed vehicle entity while tracking was enabled.
*/
SQFloat GetDistance() const;
SQMOD_NODISCARD SQFloat GetDistance() const;
/* --------------------------------------------------------------------------------------------
* Modify the distance traveled by the managed vehicle entity.
@ -709,7 +710,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Check whether distance tracking is enabled for the managed vehicle entity.
*/
bool GetTrackDistance() const;
SQMOD_NODISCARD bool GetTrackDistance() const;
/* --------------------------------------------------------------------------------------------
* Set whether distance tracking is enabled for the managed vehicle entity.
@ -719,222 +720,222 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve the position on the x axis of the managed vehicle entity.
*/
Float32 GetPositionX() const;
SQMOD_NODISCARD float GetPositionX() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the position on the y axis of the managed vehicle entity.
*/
Float32 GetPositionY() const;
SQMOD_NODISCARD float GetPositionY() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the position on the z axis of the managed vehicle entity.
*/
Float32 GetPositionZ() const;
SQMOD_NODISCARD float GetPositionZ() const;
/* --------------------------------------------------------------------------------------------
* Modify the position on the x axis of the managed vehicle entity.
*/
void SetPositionX(Float32 x) const;
void SetPositionX(float x) const;
/* --------------------------------------------------------------------------------------------
* Modify the position on the y axis of the managed vehicle entity.
*/
void SetPositionY(Float32 y) const;
void SetPositionY(float y) const;
/* --------------------------------------------------------------------------------------------
* Modify the position on the z axis of the managed vehicle entity.
*/
void SetPositionZ(Float32 z) const;
void SetPositionZ(float z) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the rotation on the x axis of the managed vehicle entity.
*/
Float32 GetRotationX() const;
SQMOD_NODISCARD float GetRotationX() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the rotation on the y axis of the managed vehicle entity.
*/
Float32 GetRotationY() const;
SQMOD_NODISCARD float GetRotationY() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the rotation on the z axis of the managed vehicle entity.
*/
Float32 GetRotationZ() const;
SQMOD_NODISCARD float GetRotationZ() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the rotation amount of the managed vehicle entity.
*/
Float32 GetRotationW() const;
SQMOD_NODISCARD float GetRotationW() const;
/* --------------------------------------------------------------------------------------------
* Modify the rotation on the x axis of the managed vehicle entity.
*/
void SetRotationX(Float32 x) const;
void SetRotationX(float x) const;
/* --------------------------------------------------------------------------------------------
* Modify the rotation on the y axis of the managed vehicle entity.
*/
void SetRotationY(Float32 y) const;
void SetRotationY(float y) const;
/* --------------------------------------------------------------------------------------------
* Modify the rotation on the z axis of the managed vehicle entity.
*/
void SetRotationZ(Float32 z) const;
void SetRotationZ(float z) const;
/* --------------------------------------------------------------------------------------------
* Modify the rotation amount of the managed vehicle entity.
*/
void SetRotationW(Float32 w) const;
void SetRotationW(float w) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the euler rotation on the x axis of the managed vehicle entity.
*/
Float32 GetEulerRotationX() const;
SQMOD_NODISCARD float GetEulerRotationX() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the euler rotation on the y axis of the managed vehicle entity.
*/
Float32 GetEulerRotationY() const;
SQMOD_NODISCARD float GetEulerRotationY() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the euler rotation on the z axis of the managed vehicle entity.
*/
Float32 GetEulerRotationZ() const;
SQMOD_NODISCARD float GetEulerRotationZ() const;
/* --------------------------------------------------------------------------------------------
* Modify the euler rotation on the x axis of the managed vehicle entity.
*/
void SetEulerRotationX(Float32 x) const;
void SetEulerRotationX(float x) const;
/* --------------------------------------------------------------------------------------------
* Modify the euler rotation on the y axis of the managed vehicle entity.
*/
void SetEulerRotationY(Float32 y) const;
void SetEulerRotationY(float y) const;
/* --------------------------------------------------------------------------------------------
* Modify the euler rotation on the z axis of the managed vehicle entity.
*/
void SetEulerRotationZ(Float32 z) const;
void SetEulerRotationZ(float z) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the velocity on the x axis of the managed vehicle entity.
*/
Float32 GetSpeedX() const;
SQMOD_NODISCARD float GetSpeedX() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the velocity on the y axis of the managed vehicle entity.
*/
Float32 GetSpeedY() const;
SQMOD_NODISCARD float GetSpeedY() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the velocity on the z axis of the managed vehicle entity.
*/
Float32 GetSpeedZ() const;
SQMOD_NODISCARD float GetSpeedZ() const;
/* --------------------------------------------------------------------------------------------
* Modify the velocity on the x axis of the managed vehicle entity.
*/
void SetSpeedX(Float32 x) const;
void SetSpeedX(float x) const;
/* --------------------------------------------------------------------------------------------
* Modify the velocity on the y axis of the managed vehicle entity.
*/
void SetSpeedY(Float32 y) const;
void SetSpeedY(float y) const;
/* --------------------------------------------------------------------------------------------
* Modify the velocity on the z axis of the managed vehicle entity.
*/
void SetSpeedZ(Float32 z) const;
void SetSpeedZ(float z) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the relative velocity on the x axis of the managed vehicle entity.
*/
Float32 GetRelativeSpeedX() const;
SQMOD_NODISCARD float GetRelativeSpeedX() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the relative velocity on the y axis of the managed vehicle entity.
*/
Float32 GetRelativeSpeedY() const;
SQMOD_NODISCARD float GetRelativeSpeedY() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the relative velocity on the z axis of the managed vehicle entity.
*/
Float32 GetRelativeSpeedZ() const;
SQMOD_NODISCARD float GetRelativeSpeedZ() const;
/* --------------------------------------------------------------------------------------------
* Modify the relative velocity on the x axis of the managed vehicle entity.
*/
void SetRelativeSpeedX(Float32 x) const;
void SetRelativeSpeedX(float x) const;
/* --------------------------------------------------------------------------------------------
* Modify the relative velocity on the y axis of the managed vehicle entity.
*/
void SetRelativeSpeedY(Float32 y) const;
void SetRelativeSpeedY(float y) const;
/* --------------------------------------------------------------------------------------------
* Modify the relative velocity on the z axis of the managed vehicle entity.
*/
void SetRelativeSpeedZ(Float32 z) const;
void SetRelativeSpeedZ(float z) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the turn velocity on the x axis of the managed vehicle entity.
*/
Float32 GetTurnSpeedX() const;
SQMOD_NODISCARD float GetTurnSpeedX() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the turn velocity on the y axis of the managed vehicle entity.
*/
Float32 GetTurnSpeedY() const;
SQMOD_NODISCARD float GetTurnSpeedY() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the turn velocity on the z axis of the managed vehicle entity.
*/
Float32 GetTurnSpeedZ() const;
SQMOD_NODISCARD float GetTurnSpeedZ() const;
/* --------------------------------------------------------------------------------------------
* Modify the turn velocity on the x axis of the managed vehicle entity.
*/
void SetTurnSpeedX(Float32 x) const;
void SetTurnSpeedX(float x) const;
/* --------------------------------------------------------------------------------------------
* Modify the turn velocity on the y axis of the managed vehicle entity.
*/
void SetTurnSpeedY(Float32 y) const;
void SetTurnSpeedY(float y) const;
/* --------------------------------------------------------------------------------------------
* Modify the turn velocity on the z axis of the managed vehicle entity.
*/
void SetTurnSpeedZ(Float32 z) const;
void SetTurnSpeedZ(float z) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the relative turn velocity on the x axis of the managed vehicle entity.
*/
Float32 GetRelativeTurnSpeedX() const;
SQMOD_NODISCARD float GetRelativeTurnSpeedX() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the relative turn velocity on the y axis of the managed vehicle entity.
*/
Float32 GetRelativeTurnSpeedY() const;
SQMOD_NODISCARD float GetRelativeTurnSpeedY() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the relative turn velocity on the z axis of the managed vehicle entity.
*/
Float32 GetRelativeTurnSpeedZ() const;
SQMOD_NODISCARD float GetRelativeTurnSpeedZ() const;
/* --------------------------------------------------------------------------------------------
* Modify the relative turn velocity on the x axis of the managed vehicle entity.
*/
void SetRelativeTurnSpeedX(Float32 x) const;
void SetRelativeTurnSpeedX(float x) const;
/* --------------------------------------------------------------------------------------------
* Modify the relative turn velocity on the y axis of the managed vehicle entity.
*/
void SetRelativeTurnSpeedY(Float32 y) const;
void SetRelativeTurnSpeedY(float y) const;
/* --------------------------------------------------------------------------------------------
* Modify the relative turn velocity on the z axis of the managed vehicle entity.
*/
void SetRelativeTurnSpeedZ(Float32 z) const;
void SetRelativeTurnSpeedZ(float z) const;
};
} // Namespace:: SqMod