1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-02-20 19:57:12 +01:00

Minor documentation in core class and some const-correctness when cleaning entity instance containers.

This commit is contained in:
Sandu Liviu Catalin 2016-07-16 16:17:09 +03:00
parent e32464b6ea
commit 0599b57087
2 changed files with 70 additions and 69 deletions

View File

@ -446,13 +446,13 @@ void Core::Terminate()
} }
LogDbg("Clearing the entity containers"); LogDbg("Clearing the entity containers");
// Release all entity resources by clearing the containers // Release all entity resources by clearing the containers
ContainerCleaner< Players > cc_players(m_Players, ENT_PLAYER); const ContainerCleaner< Players > cc_players(m_Players, ENT_PLAYER);
ContainerCleaner< Vehicles > cc_vehicles(m_Vehicles, ENT_VEHICLE); const ContainerCleaner< Vehicles > cc_vehicles(m_Vehicles, ENT_VEHICLE);
ContainerCleaner< Objects > cc_objects(m_Objects, ENT_OBJECT); const ContainerCleaner< Objects > cc_objects(m_Objects, ENT_OBJECT);
ContainerCleaner< Pickups > cc_pickups(m_Pickups, ENT_PICKUP); const ContainerCleaner< Pickups > cc_pickups(m_Pickups, ENT_PICKUP);
ContainerCleaner< Checkpoints > cc_checkpoints(m_Checkpoints, ENT_CHECKPOINT); const ContainerCleaner< Checkpoints > cc_checkpoints(m_Checkpoints, ENT_CHECKPOINT);
ContainerCleaner< Blips > cc_blips(m_Blips, ENT_BLIP); const ContainerCleaner< Blips > cc_blips(m_Blips, ENT_BLIP);
ContainerCleaner< Keybinds > cc_keybinds(m_Keybinds, ENT_KEYBIND); const ContainerCleaner< Keybinds > cc_keybinds(m_Keybinds, ENT_KEYBIND);
LogDbg("Terminating routines an commands"); LogDbg("Terminating routines an commands");
// Release all resources from routines // Release all resources from routines
TerminateRoutines(); TerminateRoutines();

View File

@ -104,14 +104,14 @@ protected:
void Destroy(); void Destroy();
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
Int32 mID; Int32 mID; // The unique number that identifies this entity on the server.
Uint16 mFlags; Uint16 mFlags; // Various options and states that can be toggled on the instance.
CBlip * mInst; CBlip * mInst; // Pointer to the actual instance used to interact this entity.
Object mObj; Object mObj; // Script object of the instance used to interact this entity.
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
Int32 mWorld; Int32 mWorld; // The identifier of the world in which this blip was created.
Int32 mScale; Int32 mScale; // The scale of the blip.
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
Int32 mSprID; Int32 mSprID;
@ -155,10 +155,11 @@ protected:
void Destroy(); void Destroy();
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
Int32 mID; Int32 mID; // The unique number that identifies this entity on the server.
Uint16 mFlags; Uint16 mFlags; // Various options and states that can be toggled on the instance.
CCheckpoint * mInst; CCheckpoint * mInst; // Pointer to the actual instance used to interact this entity.
Object mObj; Object mObj; // Script object of the instance used to interact this entity.
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
Function mOnDestroyed; Function mOnDestroyed;
Function mOnCustom; Function mOnCustom;
@ -169,7 +170,7 @@ protected:
}; };
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Helper structure used to identify a keybind entity instance on the server. * Helper structure used to identify a key-bind entity instance on the server.
*/ */
struct KeybindInst struct KeybindInst
{ {
@ -198,16 +199,16 @@ protected:
void Destroy(); void Destroy();
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
Int32 mID; Int32 mID; // The unique number that identifies this entity on the server.
Uint16 mFlags; Uint16 mFlags; // Various options and states that can be toggled on the instance.
CKeybind * mInst; CKeybind * mInst; // Pointer to the actual instance used to interact this entity.
Object mObj; Object mObj; // Script object of the instance used to interact this entity.
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
Int32 mFirst; Int32 mFirst; // Key-code of the first button from the triggering combination.
Int32 mSecond; Int32 mSecond; // Key-code of the second button from the triggering combination.
Int32 mThird; Int32 mThird; // Key-code of the third button from the triggering combination.
Int32 mRelease; Int32 mRelease; // Whether the key-bind reacts to button press or release.
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
Function mOnDestroyed; Function mOnDestroyed;
@ -248,10 +249,10 @@ protected:
void Destroy(); void Destroy();
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
Int32 mID; Int32 mID; // The unique number that identifies this entity on the server.
Uint16 mFlags; Uint16 mFlags; // Various options and states that can be toggled on the instance.
CObject * mInst; CObject * mInst; // Pointer to the actual instance used to interact this entity.
Object mObj; Object mObj; // Script object of the instance used to interact this entity.
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
Function mOnDestroyed; Function mOnDestroyed;
@ -292,10 +293,10 @@ protected:
void Destroy(); void Destroy();
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
Int32 mID; Int32 mID; // The unique number that identifies this entity on the server.
Uint16 mFlags; Uint16 mFlags; // Various options and states that can be toggled on the instance.
CPickup * mInst; CPickup * mInst; // Pointer to the actual instance used to interact this entity.
Object mObj; Object mObj; // Script object of the instance used to interact this entity.
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
Function mOnDestroyed; Function mOnDestroyed;
@ -337,28 +338,28 @@ protected:
void Destroy(); void Destroy();
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
Int32 mID; Int32 mID; // The unique number that identifies this entity on the server.
Uint16 mFlags; Uint16 mFlags; // Various options and states that can be toggled on the instance.
CPlayer * mInst; CPlayer * mInst; // Pointer to the actual instance used to interact this entity.
Object mObj; Object mObj; // Script object of the instance used to interact this entity.
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
SQInteger mTrackPosition; SQInteger mTrackPosition; // The number of times to track position changes.
SQInteger mTrackHeading; SQInteger mTrackHeading; // The number of times to track heading changes.
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
Int32 mTrackPositionHeader; Int32 mTrackPositionHeader; // Header to send when triggering position callback.
Object mTrackPositionPayload; Object mTrackPositionPayload; // Payload to send when triggering position callback.
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
Int32 mLastWeapon; Int32 mLastWeapon; // Last known weapon of the player entity.
Float32 mLastHealth; Float32 mLastHealth; // Last known health of the player entity.
Float32 mLastArmour; Float32 mLastArmour; // Last known armor of the player entity.
Float32 mLastHeading; Float32 mLastHeading; // Last known heading of the player entity.
Vector3 mLastPosition; Vector3 mLastPosition; // Last known position of the player entity.
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
Int32 mAuthority; Int32 mAuthority; // The authority level of the managed player.
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
Function mOnDestroyed; Function mOnDestroyed;
@ -457,21 +458,21 @@ protected:
void Destroy(); void Destroy();
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
Int32 mID; Int32 mID; // The unique number that identifies this entity on the server.
Uint16 mFlags; Uint16 mFlags; // Various options and states that can be toggled on the instance.
CVehicle * mInst; CVehicle * mInst; // Pointer to the actual instance used to interact this entity.
Object mObj; Object mObj; // Script object of the instance used to interact this entity.
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
SQInteger mTrackPosition; SQInteger mTrackPosition; // The number of times to track position changes.
SQInteger mTrackRotation; SQInteger mTrackRotation; // The number of times to track rotation changes.
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
Int32 mLastPrimaryColour; Int32 mLastPrimaryColour; // Last known secondary-color of the player entity.
Int32 mLastSecondaryColour; Int32 mLastSecondaryColour; // Last known primary-color of the player entity.
Float32 mLastHealth; Float32 mLastHealth; // Last known health of the player entity.
Vector3 mLastPosition; Vector3 mLastPosition; // Last known position of the player entity.
Quaternion mLastRotation; Quaternion mLastRotation; // Last known rotation of the player entity.
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
Function mOnDestroyed; Function mOnDestroyed;
@ -494,19 +495,19 @@ protected:
public: public:
// -------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------
typedef std::vector< BlipInst > Blips; typedef std::vector< BlipInst > Blips; // Blips entity instances container.
typedef std::vector< CheckpointInst > Checkpoints; typedef std::vector< CheckpointInst > Checkpoints; // Checkpoints entity instances container.
typedef std::vector< KeybindInst > Keybinds; typedef std::vector< KeybindInst > Keybinds; // Key-binds entity instances container.
typedef std::vector< ObjectInst > Objects; typedef std::vector< ObjectInst > Objects; // Objects entity instances container.
typedef std::vector< PickupInst > Pickups; typedef std::vector< PickupInst > Pickups; // Pickups entity instances container.
typedef std::vector< PlayerInst > Players; typedef std::vector< PlayerInst > Players; // Players entity instances container.
typedef std::vector< VehicleInst > Vehicles; typedef std::vector< VehicleInst > Vehicles; // Vehicles entity instances container.
// -------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------
typedef std::vector< ScriptSrc > Scripts; typedef std::vector< ScriptSrc > Scripts; // List of loaded scripts.
// -------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------
typedef std::unordered_map< String, String > Options; typedef std::unordered_map< String, String > Options; // List of custom options.
private: private:
@ -519,7 +520,7 @@ private:
// -------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------
Blips m_Blips; // Blips pool. Blips m_Blips; // Blips pool.
Checkpoints m_Checkpoints; // Checkpoints pool. Checkpoints m_Checkpoints; // Checkpoints pool.
Keybinds m_Keybinds; // Keybinds pool. Keybinds m_Keybinds; // Key-binds pool.
Objects m_Objects; // Objects pool. Objects m_Objects; // Objects pool.
Pickups m_Pickups; // Pickups pool. Pickups m_Pickups; // Pickups pool.
Players m_Players; // Players pool. Players m_Players; // Players pool.