diff --git a/ICore.h b/ICore.h index 93c2d64..7a3ccd8 100644 --- a/ICore.h +++ b/ICore.h @@ -28,6 +28,7 @@ #include "script-objects/IWebView.h" #include "script-objects/IStatData.h" #include "script-objects/IHandlingData.h" +#include "script-objects/IInterior.h" #include "script-objects/IAudioCategory.h" #include "script-objects/INative.h" #include "script-objects/IMapData.h" @@ -180,6 +181,8 @@ namespace alt virtual std::vector> GetAllWeaponData() const = 0; virtual std::shared_ptr GetAudioCategory(const std::string& name) const = 0; + virtual std::shared_ptr GetInterior(uint32_t interiorId) const = 0; + virtual void TriggerServerEvent(const std::string& ev, MValueArgs args) = 0; virtual void TriggerServerEventUnreliable(const std::string& ev, MValueArgs args) = 0; /** diff --git a/script-objects/IInterior.h b/script-objects/IInterior.h new file mode 100644 index 0000000..d01f81c --- /dev/null +++ b/script-objects/IInterior.h @@ -0,0 +1,33 @@ +#pragma once +#include +//#ifdef ALT_CLIENT_API + +namespace alt +{ + class IInteriorRoom; + class IInteriorPortal; + + class IInterior + { + protected: + virtual ~IInterior() = default; + + public: + struct ExtentInfo + { + alt::Position min; + alt::Position max; + }; + + virtual std::shared_ptr GetRoomByHash(uint32_t hash) const = 0; + virtual std::shared_ptr GetRoomByIndex(uint32_t roomIndex) const = 0; + virtual std::shared_ptr GetPortalByIndex(uint32_t portalIndex) const = 0; + + virtual uint16_t GetRoomCount() const = 0; + virtual uint16_t GetPortalCount() const = 0; + virtual alt::Position GetPosition() const = 0; + virtual alt::Rotation GetRotation() const = 0; + virtual alt::IInterior::ExtentInfo GetEntitiesExtents() const = 0; + }; +} +//##endif \ No newline at end of file diff --git a/script-objects/IInteriorPortal.h b/script-objects/IInteriorPortal.h new file mode 100644 index 0000000..4bae208 --- /dev/null +++ b/script-objects/IInteriorPortal.h @@ -0,0 +1,36 @@ +#pragma once +#include + +#include "cpp-sdk/deps/alt-math/alt-math.h" + +namespace alt +{ + class IInteriorPortal + { + protected: + virtual ~IInteriorPortal() = default; + + public: + virtual uint32_t GetIndex() const = 0; + virtual uint16_t GetCornerCount() const = 0; + virtual Position GetCornerPosition(uint32_t cornerIndex) const = 0; + virtual int32_t GetRoomFrom() const = 0; + virtual int32_t GetRoomTo() const = 0; + virtual int32_t GetFlag() const = 0; + + virtual uint16_t GetEntityCount() const = 0; + virtual uint32_t GetEntityArcheType(uint32_t entityIndex) const = 0; + virtual int32_t GetEntityFlag(uint32_t entityIndex) const = 0; + virtual alt::Position GetEntityPosition(uint32_t entityIndex) const = 0; + virtual alt::Rotation GetEntityRotation(uint32_t entityIndex) const = 0; + + + virtual void SetCornerPosition(uint32_t cornerIndex, + const alt::Position& position) = 0; + virtual void SetRoomFrom(uint32_t roomFrom) = 0; + virtual void SetRoomTo(uint32_t roomTo) = 0; + virtual void SetFlag(uint32_t flag) = 0; + virtual void SetEntityFlag(uint32_t entityIndex, uint32_t flag) = 0; + + }; +} \ No newline at end of file diff --git a/script-objects/IInteriorRoom.h b/script-objects/IInteriorRoom.h new file mode 100644 index 0000000..d0f0e48 --- /dev/null +++ b/script-objects/IInteriorRoom.h @@ -0,0 +1,24 @@ +#pragma once +#include + +#include "IInterior.h" + +namespace alt +{ + class IInteriorRoom + { + protected: + virtual ~IInteriorRoom() = default; + public: + virtual uint32_t GetIndex() const = 0; + virtual std::string GetName() const = 0; + virtual uint32_t GetNameHash() const = 0; + virtual int32_t GetFlag() const = 0; + virtual uint32_t GetTimecycle() const = 0; + virtual alt::IInterior::ExtentInfo GetExtents() const = 0; + + virtual void SetFlag(uint32_t flag) = 0; + virtual void SetTimecycle(uint32_t timecycleHash) = 0; + virtual void SetExtents(alt::IInterior::ExtentInfo extentInfo) = 0; + }; +} \ No newline at end of file