54 lines
1.1 KiB
C++
54 lines
1.1 KiB
C++
#ifndef DEF_CHESSCONTEXT_H
|
|
|
|
#define DEF_CHESSCONTEXT_H
|
|
|
|
/* [1] Libs
|
|
=========================================================*/
|
|
/* (1) Internes */
|
|
#include <iostream>
|
|
#include <string>
|
|
#include <vector>
|
|
#include <stdlib.h>
|
|
|
|
/* (2) Externes */
|
|
#include "term.h"
|
|
#include "Player.h"
|
|
|
|
/* (3) Namespace */
|
|
using namespace std;
|
|
|
|
|
|
/* [2] Definition
|
|
=========================================================*/
|
|
class ChessContext{
|
|
public:
|
|
ChessContext();
|
|
void init();
|
|
Piece* at(const int x, const int y);
|
|
bool checkMove(Piece& p, int x, int y);
|
|
|
|
// GETTERS
|
|
Player* getCurrent();
|
|
Player* getEnemy();
|
|
|
|
// ATTRIBUTS
|
|
char _turn;
|
|
Player *_p1;
|
|
Player *_p2;
|
|
|
|
private:
|
|
// FONCTIONS UTILITAIRES
|
|
bool checkPion(Piece& p, int x, int y);
|
|
bool checkFou(Piece& p, int x, int y);
|
|
bool checkTour(Piece& p, int x, int y);
|
|
bool checkCavalier(Piece& p, int x, int y);
|
|
bool checkRoi(Piece& p, int x, int y);
|
|
bool checkReine(Piece& p, int x, int y);
|
|
|
|
};
|
|
|
|
/* [n] Inclusion du corps
|
|
=========================================================*/
|
|
#include "ChessContext.cpp"
|
|
|
|
#endif |