18 #include "precompiled.h"
61 "<element name='Type'>"
65 "<value>stone</value>"
66 "<value>metal</value>"
67 "<value>structure</value>"
68 "<value>settlement</value>"
70 "<value>support</value>"
75 "<element name='Colour'>"
76 "<attribute name='r'>"
77 "<data type='integer'><param name='minInclusive'>0</param><param name='maxInclusive'>255</param></data>"
79 "<attribute name='g'>"
80 "<data type='integer'><param name='minInclusive'>0</param><param name='maxInclusive'>255</param></data>"
82 "<attribute name='b'>"
83 "<data type='integer'><param name='minInclusive'>0</param><param name='maxInclusive'>255</param></data>"
122 serialize.NumberU8_Unbounded(
"r",
m_R);
123 serialize.NumberU8_Unbounded(
"g",
m_G);
124 serialize.NumberU8_Unbounded(
"b",
m_B);
131 serialize.NumberFixed_Unbounded(
"x",
m_X);
132 serialize.NumberFixed_Unbounded(
"z",
m_Z);
177 if (msgData.
to == -1)
182 if (!cmpPlayerManager)
187 CColor colour = cmpPlayer->GetColour();
188 m_R = (
u8)(colour.
r*255.0);
189 m_G = (
u8)(colour.
g*255.0);
190 m_B = (
u8)(colour.
b*255.0);
223 virtual bool CheckPing(
double currentTime,
double pingDuration)
An entity initialisation parameter node.
void SubscribeToMessageType(MessageTypeId mtid)
Subscribe the current component type to the given message type.
A simple fixed-point number class.
static void ClassInit(CComponentManager &componentManager)
virtual bool CheckPing(double currentTime, double pingDuration)
Return true if entity is actively pinging based on the current time.
#define REGISTER_COMPONENT_TYPE(cname)
#define UNUSED(param)
mark a function parameter as unused and avoid the corresponding compiler warning. ...
bool IsOk() const
Returns true if this is a valid CParamNode, false if it represents a non-existent node...
Serialization interface; see serialization overview.
int ToInt() const
Parses the content of this node as an integer.
int32_t player_id_t
valid player IDs are non-negative (see ICmpOwnership)
virtual void Init(const CParamNode ¶mNode)
entity_id_t GetEntityId() const
virtual int GetType() const =0
const CParamNode & GetChild(const char *name) const
Returns the (unique) child node with the given name, or a node with IsOk() == false if there is none...
void SerializeCommon(S &serialize)
static std::string GetSchema()
virtual entity_id_t GetPlayerByID(int32_t id)=0
virtual player_id_t GetOwner()=0
#define DEFAULT_COMPONENT_ALLOCATOR(cname)
const CSimContext & GetSimContext() const
virtual void HandleMessage(const CMessage &msg, bool global)
A simplified syntax for accessing entity components.
int GetCurrentDisplayedPlayer() const
Returns the player ID that the current display is being rendered for.
CEntityHandle GetSystemEntity() const
virtual void Deserialize(const CParamNode ¶mNode, IDeserializer &deserialize)
virtual void Serialize(ISerializer &serialize)
virtual bool GetRenderData(u8 &r, u8 &g, u8 &b, entity_pos_t &x, entity_pos_t &z)
Get the data for rendering this entity on the minimap.
Deserialization interface; see serialization overview.