diff --git a/Pontu/include/engine/Coord.h b/Pontu/include/engine/Coord.h deleted file mode 100644 index e9cd137..0000000 --- a/Pontu/include/engine/Coord.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef COORD_INPUT -#define COORD_INPUT - -struct p_coord -{ - int x; - int y; -}; - -bool coordValide(struct p_coord coord) { - return coord.x>=0 && coord.y>=0; -} - -bool coordEqual(struct p_coord a, struct p_coord b) { - return a.x == b.x && a.y == b.y; -} - -#endif //COORD_INPUT \ No newline at end of file diff --git a/Pontu/include/engine/InputProcessor.h b/Pontu/include/engine/InputProcessor.h index 2861fab..b831dab 100644 --- a/Pontu/include/engine/InputProcessor.h +++ b/Pontu/include/engine/InputProcessor.h @@ -2,16 +2,16 @@ #define INPUT_PROCESSOR_INCLUDED #include "Button.h" -#include "Coord.h" +#include "model/Coord.h" #include "InputElement.h" typedef struct { ArrayButton tabButton; - struct p_coord selectedCase; ///< Board , (-1;-1) si inexistant + struct Coord selectedCase; ///< Board , (-1;-1) si inexistant } InputProcessor; -struct p_coord screenCoordToGameCoord(const SDL_Point* point, const SDL_Rect* boardRect); +struct Coord screenCoordToGameCoord(const SDL_Point* point, const SDL_Rect* boardRect); InputElement proccessInput(InputProcessor *inputProcessor, const SDL_Rect* boardRect); diff --git a/Pontu/include/model/Coord.h b/Pontu/include/model/Coord.h index c261716..3b9d8d8 100644 --- a/Pontu/include/model/Coord.h +++ b/Pontu/include/model/Coord.h @@ -5,8 +5,23 @@ * \date 06/12/2021 */ +#ifndef COORD_INCLUDED +#define COORD_INCLUDED + +#include + typedef struct { int x; ///< Coordinate on the X-axis int y; ///< Coordinate on the Y-axis -} Coord +} Coord; + + +bool coordValide(const Coord coord) { + return coord.x>=0 && coord.y>=0; +} + +bool coordEqual(const Coord a, const Coord b) { + return a.x == b.x && a.y == b.y; +} +#endif //COORD_INCLUDED