openmohaa/code/qcommon/con_timer.h

51 lines
916 B
C
Raw Normal View History

2023-01-29 20:59:31 +01:00
#include "class.h"
class con_timer : public Class
{
public:
2023-08-19 03:02:30 +02:00
class Element
{
public:
Class *obj;
int inttime;
};
2023-01-29 20:59:31 +01:00
private:
2023-08-19 03:02:30 +02:00
Container<con_timer::Element> m_Elements;
bool m_bDirty;
int m_inttime;
2023-01-29 20:59:31 +01:00
public:
2023-08-19 03:02:30 +02:00
con_timer();
2023-01-29 20:59:31 +01:00
2023-08-19 03:02:30 +02:00
void AddElement(Class *e, int inttime);
void RemoveElement(Class *e);
2023-01-29 20:59:31 +01:00
2023-08-19 03:02:30 +02:00
Class *GetNextElement(int& foundTime);
2023-01-29 20:59:31 +01:00
2023-10-30 22:59:04 +01:00
void SetDirty(void);
bool IsDirty(void);
void SetTime(int inttime);
2023-08-19 03:02:30 +02:00
#if defined(ARCHIVE_SUPPORTED)
static void ArchiveElement(class Archiver& arc, Element *e);
void Archive(class Archiver &arc) override;
2023-01-29 20:59:31 +01:00
#endif
2023-10-30 22:59:04 +01:00
};
inline void con_timer::SetDirty(void)
{
m_bDirty = true;
};
inline bool con_timer::IsDirty(void)
{
return m_bDirty;
};
inline void con_timer::SetTime(int inttime)
{
m_inttime = inttime;
m_bDirty = true;
}