40 int Find(
int nPlayer)
const;
58 void Add(
int nPlayer);
94 mPlayers[nSlot] = nPlayer;
98 std::vector<int> mPlayers;
230 std::vector<int> mPlayerTracks;
231 std::vector<TrackInfo> mTrackInfos;
const std::vector< int > & GetPlayers() const
Definition trackselector.h:78
TrackInfo()
Construct a track with every slot empty.
void Remove(int nPlayer)
Take a player out of its slot and move the later players one slot down.
std::vector< int > & GetPlayers()
Definition trackselector.h:83
static constexpr int kNumSlots
The number of slots of a track.
Definition trackselector.h:22
void Add(int nPlayer)
Put a player in the slot after the occupied ones.
void Compact()
Move each player into the first slot of the run of empty slots before it.
int Find(int nPlayer) const
Report the slot of a player.
void SetPlayer(int nSlot, int nPlayer)
Put a player in a slot.
Definition trackselector.h:93
int Count() const
Report the number of occupied slots.
const int * GetPlayersOnTrack(int nTrack) const
Report the players on a track.
int GetNumPlayers() const
Report the number of players.
void SetPlayerTrack(int nPlayer, int nTrack)
Move a player to the first empty slot of a track, or off every track.
int GetNumPlayersOnTrack(int nTrack) const
Report the number of players on a track.
void AddPlayer(int nTrack, int nSlot)
Add the next player to a slot of a track.
int GetFirstPlayer(int nTrack) const
Report the player in the first slot of a track.
int GetPlayerTrack(int nPlayer) const
Report the track of a player.
void SwapPlayer(int nPlayer, int nTrack, int nSlot)
Swap a player with the player in a slot of a track.
int GetPlayerSlot(int nPlayer) const
Report the slot of a player on its track.
void AddPlayer(int nTrack)
Add the next player to the first empty slot of a track.
void Compact()
Compact every track after a swap.
TrackSelector(int nTracks)
Construct an assignment of no players to a number of tracks.
int GetNumTracks() const
Report the number of tracks.