hlswmaster-ng/gamelist.h

42 lines
711 B
C++

#ifndef _GAMELIST_H_
#define _GAMELIST_H_
#include "config.h"
#include "netpkt.h"
#include "gameentry.h"
#include "timerservice.h"
#include "list.h"
class GameList {
public:
GameList(Config& conf);
~GameList();
void addGame(int gameid, NetPkt* pkt, int port2 = 0, bool swap = false);
long getLastUpdate();
Iterator<GameEntry>* createIterator();
void cleanup();
protected:
GameList(const GameList& gl);
GameList& operator=(const GameList& gl);
private:
class CleanupEvent : public Event {
public:
CleanupEvent(GameList& gl) : gl(gl) {}
~CleanupEvent() {}
void execute() { gl.cleanup(); }
private:
GameList& gl;
};
List<GameEntry> glist;
long lastUpdate;
};
#endif // _GAMELIST_H_