SUPER Space invader : Turbo edition DX - VS GOD 1.0.0
A simple space invader ripoff
invadersGrid.h
Go to the documentation of this file.
1
12#ifndef GUARD_INVADERSGRID_H
13#define GUARD_INVADERSGRID_H
14
15#include<vector>
16
17using namespace std;
18
22enum class InvaderType {
23 TYPEA,
24 TYPEB,
25 TYPEC,
26 NONE,
27};
28
33class InvadersColumn : public vector<InvaderType>{
34public:
40 bool hasNoValid() const;
41
47 unsigned getOutterInvader() const;
48
54 unsigned randomValidInv() const;
55};
56
57
62class InvadersGrid : public vector<InvadersColumn>{
63public:
64
73 unsigned validColsNumber() const;
74
80 unsigned randomValidCol() const;
81};
82
83#endif
Column of invader.
Definition: invadersGrid.h:33
unsigned randomValidInv() const
Returns a random valid invader in the column (reminder, the column can contains NONE invaders)
unsigned getOutterInvader() const
gives the index of the last valid (type different than NONE) invader
bool hasNoValid() const
tells if the column contains no non type NONE invader
unsigned randomValidCol() const
Returns a random valid column in the grid.
unsigned validColsNumber() const
Helper function for randomValidCol() that returns the number of valid column (at least one invader in...
InvaderType
List of all invader type.
Definition: invadersGrid.h:22