blob: f2b39816507a241bdcc8316135fd60784b0526ac (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#ifndef _TEAM_H
#define _TEAM_H
#include <tqptrlist.h>
#include "player.h"
class KueTeam {
public:
KueTeam() {}
~KueTeam() {}
// Moves currentPlayer forward to the next player, and returns its new value
KuePlayer *nextPlayer() { if (!_players.next()) return _players.first(); else return _players.current();}
// Returns the current player
KuePlayer *currentPlayer() { return _players.current(); }
// Adds a new player
void addPlayer(KuePlayer *p) { _players.append(p); }
// Removes an existing player
void removePlayer(KuePlayer *p) { _players.remove(p); }
private:
TQPtrList<KuePlayer> _players;
};
#endif
|