76 lines
1.3 KiB
C++
76 lines
1.3 KiB
C++
/*!
|
|
*
|
|
* @file invaderGrid.h
|
|
* @author RUBINI Thomas
|
|
* @date January 2022
|
|
* @version 1.0
|
|
* @brief invader matrix structure
|
|
*
|
|
*/
|
|
|
|
|
|
#ifndef GUARD_INVADERSGRID_H
|
|
#define GUARD_INVADERSGRID_H
|
|
|
|
#include<vector>
|
|
|
|
using namespace std;
|
|
|
|
/*!
|
|
* @brief List of all invader type
|
|
*/
|
|
enum class InvaderType {
|
|
TYPEA,
|
|
TYPEB,
|
|
TYPEC,
|
|
NONE,
|
|
};
|
|
|
|
/*!
|
|
* @class InvadersColumn
|
|
* @brief Column of invader
|
|
*/
|
|
class InvadersColumn : public vector<InvaderType>{
|
|
public:
|
|
// idk why CLion says this is not implemented, but it is
|
|
|
|
/*!
|
|
* @brief tells if the column contains no non type NONE invader
|
|
* @return True if there's only type NONE invader, False elsewise
|
|
* @fn bool hasNoValid() const;
|
|
*/
|
|
bool hasNoValid() const;
|
|
|
|
/*!
|
|
* @brief gives the index of the last valid (type different than NONE) invader
|
|
* @return index of the last valid invader if found, else size of the column
|
|
* @fn unsigned getOutterInvader() const;
|
|
*/
|
|
unsigned getOutterInvader() const;
|
|
|
|
/*!
|
|
* @brief
|
|
* @return
|
|
* @fn
|
|
*/
|
|
unsigned randomValidInv() const;
|
|
}; // class InvadersColumn
|
|
|
|
|
|
/*!
|
|
* @class InvadersColumn
|
|
* @brief Column of invader
|
|
*/
|
|
class InvadersGrid : public vector<InvadersColumn>{
|
|
public:
|
|
|
|
/*!
|
|
* @brief List of all invader type
|
|
* @return
|
|
* @fn
|
|
*/
|
|
unsigned validColsNumber() const;
|
|
unsigned randomValidCol() const;
|
|
};
|
|
|
|
#endif |