hlswmaster-ng/gamelist.h

41 lines
691 B
C
Raw Normal View History

2006-02-02 16:55:44 +01:00
#ifndef _GAMELIST_H_
#define _GAMELIST_H_
2006-02-19 18:45:56 +01:00
#include "config.h"
2006-02-20 12:31:34 +01:00
#include "netpkt.h"
2006-03-05 02:28:19 +01:00
#include "gameentry.h"
2006-02-19 18:45:56 +01:00
#include "timerservice.h"
2006-03-05 02:28:19 +01:00
#include "list.h"
2006-02-02 16:55:44 +01:00
class GameList {
public:
2006-02-19 18:45:56 +01:00
GameList(Config& conf);
~GameList();
void cleanup();
2006-03-05 02:28:19 +01:00
void addGame(int gameid, NetPkt* pkt, int port2 = 0);
2006-02-02 16:55:44 +01:00
2006-02-20 21:58:59 +01:00
long getLastUpdate();
2006-02-19 18:45:56 +01:00
Iterator<GameEntry>* createIterator();
2006-02-02 16:55:44 +01:00
protected:
2006-02-19 18:45:56 +01:00
GameList(const GameList& gl);
GameList& operator=(const GameList& gl);
private:
2006-02-20 21:58:59 +01:00
class CleanupEvent : public Event {
2006-02-19 18:45:56 +01:00
public:
2006-02-20 21:58:59 +01:00
CleanupEvent(GameList& gl) : gl(gl) {}
2006-02-19 18:45:56 +01:00
~CleanupEvent() {}
2006-02-20 21:58:59 +01:00
void execute() { gl.cleanup(); }
2006-03-05 02:28:19 +01:00
2006-02-19 18:45:56 +01:00
private:
2006-02-20 21:58:59 +01:00
GameList& gl;
2006-03-05 02:28:19 +01:00
};
2006-02-19 18:45:56 +01:00
List<GameEntry> glist;
2006-02-20 21:58:59 +01:00
long lastUpdate;
2006-02-02 16:55:44 +01:00
};
#endif // _GAMELIST_H_