0ad/source/simulation/EntitySupport.h
Ykkrosh ee3243ff92 # Fixes for simulation speed in scenario edtior. Various code cleanups.
Game, Simulation, etc: Separated 'update' and 'interpolate', and made
'update' return whether it's going fast enough (so callers can decide to
do more updates per render). Changed some time variables to 'double' so
they have enough precision in long games.
Atlas: Added "Fast" playback button. Made simulation sometimes go at
real-time speed, if it's just slightly too slow at rendering.
VertexBuffer: Removed some non-useful glGetError calls.
Entity: Commented out redundant Tick code. Fixed syntax error in
disabled code that confused the IDE.
Aura: Changed string code again, to simply use ASCII instead of UTF-16.
(SpiderMonkey seems to handle it just as efficiently, for small
strings.)
Misc: Some more minor header-file cleanup.
SVN log: Added feed link.

This was SVN commit r4807.
2007-01-24 20:17:28 +00:00

44 lines
1.0 KiB
C++

// Supporting data types for CEntity and related
#ifndef ENTITY_SUPPORT_INCLUDED
#define ENTITY_SUPPORT_INCLUDED
#include "ps/CStr.h"
struct SEntityAction
{
int m_Id;
float m_MaxRange;
float m_MinRange;
size_t m_Speed;
CStr8 m_Animation;
SEntityAction()
: m_Id(0), m_MinRange(0), m_MaxRange(0), m_Speed(1000), m_Animation("walk") {}
SEntityAction(int id, float minRange, float maxRange, size_t speed, CStr8& animation)
: m_Id(id), m_MinRange(minRange), m_MaxRange(maxRange), m_Speed(speed), m_Animation(animation) {}
};
class CClassSet
{
CClassSet* m_Parent;
typedef std::vector<CStrW> Set;
Set m_Members;
Set m_AddedMembers; // Members that this set adds to on top of those in its parent
Set m_RemovedMembers; // Members that this set removes even if its parent has them
public:
CClassSet() : m_Parent(NULL) {}
bool IsMember(const CStrW& Test);
void Rebuild();
inline void SetParent(CClassSet* Parent)
{ m_Parent = Parent; Rebuild(); }
CStrW getMemberList();
void setFromMemberList(const CStrW& list);
};
#endif