Partial merge of different Coord

merge-requests/1/merge
marouault 4 years ago
parent cbf1adee8e
commit 4c04ac8268

@ -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

@ -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);

@ -5,8 +5,23 @@
* \date 06/12/2021
*/
#ifndef COORD_INCLUDED
#define COORD_INCLUDED
#include <stdbool.h>
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

Loading…
Cancel
Save