22 #ifndef NEVERHOOD_ENTITY_H 23 #define NEVERHOOD_ENTITY_H 25 #include "common/str.h" 26 #include "neverhood/neverhood.h" 27 #include "neverhood/gamevars.h" 28 #include "neverhood/graphics.h" 29 #include "neverhood/sound.h" 36 enum MessageParamType {
44 MessageParam(uint32 value) : _type(mptInteger), _integer(value) {}
47 uint32 asInteger()
const;
56 MessageParamType _type;
61 #define SetUpdateHandler(handler) \ 63 _updateHandlerCb = static_cast <void (Entity::*)(void)> (handler); \ 64 debug(5, "SetUpdateHandler(" #handler ")"); \ 65 _updateHandlerCbName = #handler; \ 68 #define SetMessageHandler(handler) \ 70 _messageHandlerCb = static_cast <uint32 (Entity::*)(int messageNum, const MessageParam ¶m, Entity *sender)> (handler); \ 71 debug(5, "SetMessageHandler(" #handler ")"); \ 72 _messageHandlerCbName = #handler; \ 75 const uint kMaxSoundResources = 16;
89 uint32 sendMessage(
Entity *receiver,
int messageNum, uint32 param);
90 uint32 sendPointMessage(
Entity *receiver,
int messageNum,
const NPoint ¶m);
91 uint32 sendEntityMessage(
Entity *receiver,
int messageNum,
Entity *param);
93 uint32 getGlobalVar(uint32 nameHash);
94 void setGlobalVar(uint32 nameHash, uint32 value);
95 uint32 getSubVar(uint32 nameHash, uint32 subNameHash);
96 void setSubVar(uint32 nameHash, uint32 subNameHash, uint32 value);
97 void incGlobalVar(uint32 nameHash,
int incrValue);
98 void incSubVar(uint32 nameHash, uint32 subNameHash,
int incrValue);
99 int getPriority()
const {
return _priority; }
100 bool hasMessageHandler()
const {
return _messageHandlerCb !=
nullptr; }
102 void (
Entity::*_updateHandlerCb)();
108 void loadSound(uint index, uint32 fileHash);
109 void playSound(uint index, uint32 fileHash = 0);
110 void stopSound(uint index);
111 bool isSoundPlaying(uint index);
112 void setSoundVolume(uint index,
int volume);
113 void setSoundPan(uint index,
int pan);
114 void deleteSoundResources();
Definition: background.h:30
Definition: neverhood.h:60
Definition: graphics.h:32