SuperSpaceInvaderTurboApoca.../headers/utils.h
2022-01-04 09:48:00 +01:00

39 lines
930 B
C++

#ifndef GUARD_UTILS_H
#define GUARD_UTILS_H
#include<vector>
#include<mingl/mingl.h>
// hardcoded values
#define PLAYER_HEIGHT 100
#define PROJ_LENGTH_FACTOR 2
// TODO utiliser ca de partout
// ou alors faire une method dans Game ?
#define INV_POS(i) confData.invadersSize*(i)+confData.invadersDistance*(i)
enum class WinValue{
NOBODY, // should never be used
PLAYERS,
INVADERS,
};
using namespace std;
enum class InvaderType {
TYPEA,
TYPEB,
TYPEC,
NONE,
};
class InvadersColumn : public vector<InvaderType>{
public:
size_t getOutterInvader();
};
typedef vector<InvadersColumn> InvadersGrid;
typedef nsGraphics::Vec2D Position; // in case we need to ad dmore methods, we defined our own type
typedef unsigned playerID; // 0 for player 1, 1 for player 2
// didn't want to use Position because of the semantic with x and y
bool areLinesColliding(unsigned start1, unsigned end1, unsigned start2, unsigned end2);
#endif