2004-05-22 02:57:54 +02:00
|
|
|
// EntityMessage.h
|
|
|
|
//
|
2004-07-20 21:30:35 +02:00
|
|
|
// Mark Thompson mot20@cam.ac.uk / mark@wildfiregames.com
|
2004-05-22 02:57:54 +02:00
|
|
|
//
|
|
|
|
// Entity message structure.
|
|
|
|
//
|
2004-11-11 08:09:32 +01:00
|
|
|
// Usage: Message types are currently: EMSG_TICK: Sent once per sim frame.
|
2004-05-22 02:57:54 +02:00
|
|
|
// EMSG_INIT: When a new entity is instantiated.
|
|
|
|
// At map loading, do not issue this message immediately
|
|
|
|
// for each entity as it is loaded; instead, wait for all
|
|
|
|
// entities to be created, then issue this message to all
|
|
|
|
// of them simultaneously.
|
2004-07-20 21:30:35 +02:00
|
|
|
// EMSG_ORDER:To push a message into the entity's order queue
|
2004-05-22 01:46:16 +02:00
|
|
|
|
2004-11-11 08:09:32 +01:00
|
|
|
/*
|
2004-05-22 01:46:16 +02:00
|
|
|
#ifndef MESSAGING_INCLUDED
|
|
|
|
#define MESSAGING_INCLUDED
|
|
|
|
|
2004-07-20 21:30:35 +02:00
|
|
|
#include "EntityOrders.h"
|
2004-11-11 08:09:32 +01:00
|
|
|
#include "EntitySupport.h"
|
2004-07-20 21:30:35 +02:00
|
|
|
|
2004-05-22 01:46:16 +02:00
|
|
|
struct CMessage
|
|
|
|
{
|
|
|
|
enum EMessageType
|
|
|
|
{
|
|
|
|
EMSG_TICK,
|
2004-07-20 21:30:35 +02:00
|
|
|
EMSG_INIT,
|
|
|
|
EMSG_ORDER,
|
2004-11-11 08:09:32 +01:00
|
|
|
EMSG_DAMAGE
|
2004-05-22 01:46:16 +02:00
|
|
|
} type;
|
|
|
|
CMessage( EMessageType _type )
|
|
|
|
{
|
|
|
|
type = _type;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2004-07-20 21:30:35 +02:00
|
|
|
struct CMessageOrder : public CMessage
|
|
|
|
{
|
|
|
|
CMessageOrder( CEntityOrder& _order, bool _queue = false ) : CMessage( EMSG_ORDER ), order( _order ), queue( _queue ) {}
|
|
|
|
CEntityOrder order;
|
|
|
|
bool queue;
|
|
|
|
};
|
|
|
|
|
2004-11-11 08:09:32 +01:00
|
|
|
struct CMessageDamage : public CMessage
|
|
|
|
{
|
|
|
|
CMessageDamage( HEntity _inflictor, CDamageType _damage ) : CMessage( EMSG_DAMAGE ), inflictor( inflictor ), damage( damage ) {}
|
|
|
|
HEntity inflictor;
|
|
|
|
CDamageType damage;
|
|
|
|
}
|
|
|
|
|
2004-06-02 18:11:32 +02:00
|
|
|
#endif
|
2004-11-11 08:09:32 +01:00
|
|
|
*/
|