2015-09-30 02:56:11 +02:00
|
|
|
#ifndef _ENTITY_SPHERE_HPP_
|
|
|
|
#define _ENTITY_SPHERE_HPP_
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
#include "Entity.hpp"
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
namespace SqMod {
|
|
|
|
|
|
|
|
/* ------------------------------------------------------------------------------------------------
|
2015-10-29 21:11:47 +01:00
|
|
|
* Class responsible for managing the referenced sphere instance.
|
2015-09-30 02:56:11 +02:00
|
|
|
*/
|
|
|
|
class CSphere : public Reference< CSphere >
|
|
|
|
{
|
|
|
|
// --------------------------------------------------------------------------------------------
|
2015-10-29 21:11:47 +01:00
|
|
|
static Color3 s_Color3;
|
|
|
|
static Vector3 s_Vector3;
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------------------------------
|
|
|
|
static SQUint32 s_ColorR, s_ColorG, s_ColorB;
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Import the constructors, destructors and assignment operators from the base class.
|
|
|
|
*/
|
2015-09-30 02:56:11 +02:00
|
|
|
using RefType::Reference;
|
2015-10-29 21:11:47 +01:00
|
|
|
|
2015-11-01 00:32:50 +01:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Construct a reference from a base reference.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
CSphere(const Reference< CSphere > & o);
|
2015-11-01 00:32:50 +01:00
|
|
|
|
2015-10-29 21:11:47 +01:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* See if the referenced sphere instance is streamed for the specified player.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
bool IsStreamedFor(const Reference< CPlayer > & player) const;
|
2015-10-29 21:11:47 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the world in which the referenced sphere instance exists.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
SQInt32 GetWorld() const;
|
2015-10-29 21:11:47 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Change the world in which the referenced sphere instance exists.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
void SetWorld(SQInt32 world) const;
|
2015-10-29 21:11:47 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the color of the referenced sphere instance.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
const Color3 & GetColor() const;
|
2015-10-29 21:11:47 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Change the color of the referenced sphere instance.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
void SetColor(const Color3 & col) const;
|
2015-10-29 21:11:47 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Change the color of the referenced sphere instance.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
void SetColorEx(Uint8 r, Uint8 g, Uint8 b) const;
|
2015-10-29 21:11:47 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the position of the referenced sphere instance.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
const Vector3 & GetPosition() const;
|
2015-10-29 21:11:47 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Change the position of the referenced sphere instance.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
void SetPosition(const Vector3 & pos) const;
|
2015-10-29 21:11:47 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Change the position of the referenced sphere instance.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
void SetPositionEx(SQFloat x, SQFloat y, SQFloat z) const;
|
2015-10-29 21:11:47 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the radius of the referenced sphere instance.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
SQFloat GetRadius() const;
|
2015-10-29 21:11:47 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Change the radius of the referenced sphere instance.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
void SetRadius(SQFloat radius) const;
|
2015-10-29 21:11:47 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the owner of the referenced sphere instance.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
Reference< CPlayer > GetOwner() const;
|
2015-10-29 21:11:47 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the owner identifier of the referenced sphere instance.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
SQInt32 GetOwnerID() const;
|
2015-09-30 02:56:11 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
} // Namespace:: SqMod
|
|
|
|
|
|
|
|
#endif // _ENTITY_SPHERE_HPP_
|