Debut refactor inclusions + makefile

This commit is contained in:
xdrm-brackets 2016-03-08 21:06:36 +01:00
parent 3709393576
commit e702d54b48
23 changed files with 43 additions and 47 deletions

View File

@ -1,3 +1,5 @@
#include "ChessContext.h"
/* [1] Initialisation de la partie
=========================================================*/
void ChessContext::init(){

View File

@ -33,6 +33,6 @@
/* [n] Inclusion du corps
=========================================================*/
#include "ChessContext.cpp"
// #include "ChessContext.cpp"
#endif

View File

View File

@ -1,37 +0,0 @@
#ifndef DEF_GRID
#define DEF_GRID
/* [1] Libs
=========================================================*/
/* (1) Internes */
#include <iostream>
#include <string>
#include <vector>
/* (2) Externes */
#include "term.h"
#include "Pieces/PieceFactory.h"
/* (3) Namespace */
using namespace std;
/* [2] Definition
=========================================================*/
class Grid{
public:
Grid(const int w=8, const int h=8);
// GETTERS
Piece pieceAt(const int x, const int y) const;
private:
// vector<Cell> _cells;
};
/* [n] Inclusion du corps
=========================================================*/
#include "Grid.cpp"
#endif

View File

@ -1,3 +1,4 @@
#include "Cavalier.h"
Cavalier::Cavalier(int x, int y) : Piece(CAVALIER, x, y) {

View File

@ -26,6 +26,6 @@
/* [n] Inclusion du corps
=========================================================*/
#include "Cavalier.cpp"
// #include "Cavalier.cpp"
#endif

View File

@ -1,3 +1,4 @@
#include "Fou.h"
Fou::Fou(int x, int y) : Piece(FOU, x, y) {

View File

@ -26,6 +26,6 @@
/* [n] Inclusion du corps
=========================================================*/
#include "Fou.cpp"
// #include "Fou.cpp"
#endif

View File

@ -1,3 +1,5 @@
#include "Piece.h"
Piece::Piece(PIECE_TYPE t, int x, int y) : _t(t), _x(x), _y(y){
}

View File

@ -39,7 +39,7 @@
return o << "UNKNOWN";
}
//
/* [2] Definition
=========================================================*/
class Piece{
@ -70,6 +70,6 @@
/* [n] Inclusion du corps
=========================================================*/
#include "Piece.cpp"
// #include "Piece.cpp"
#endif

Binary file not shown.

View File

@ -1,3 +1,5 @@
#include "PieceFactory.h"
Piece& PieceFactory::create(PIECE_TYPE t, int x, int y){
Piece *p;

View File

@ -25,6 +25,6 @@
/* [n] Inclusion du corps
=========================================================*/
#include "PieceFactory.cpp"
// #include "PieceFactory.cpp"
#endif

View File

@ -1,3 +1,4 @@
#include "Reine.h"
Reine::Reine(int x, int y) : Piece(REINE, x, y) {

View File

@ -26,6 +26,6 @@
/* [n] Inclusion du corps
=========================================================*/
#include "Reine.cpp"
// #include "Reine.cpp"
#endif

View File

@ -1,3 +1,4 @@
#include "Roi.h"
Roi::Roi(int x, int y) : Piece(ROI, x, y) {

View File

@ -26,6 +26,6 @@
/* [n] Inclusion du corps
=========================================================*/
#include "Roi.cpp"
// #include "Roi.cpp"
#endif

View File

@ -1,3 +1,4 @@
#include "Tour.h"
Tour::Tour(int x, int y) : Piece(TOUR, x, y) {

View File

@ -26,6 +26,6 @@
/* [n] Inclusion du corps
=========================================================*/
#include "Tour.cpp"
// #include "Tour.cpp"
#endif

View File

@ -1,3 +1,5 @@
#include "Player.h"
// CONSTRUCTEUR
Player::Player(bool first) : _first(first){
setfont(GREEN, BOLD);

View File

@ -40,6 +40,6 @@
/* [n] Inclusion du corps
=========================================================*/
#include "Player.cpp"
// #include "Player.cpp"
#endif

BIN
Chess/dep/term.h.gch Normal file

Binary file not shown.

20
Chess/makefile Normal file
View File

@ -0,0 +1,20 @@
# INIT > STRUCTURE DE FICHIERS POUR LES EXECUTABLES
begin:
mkdir dep.o
mkdir dep.o/Pieces.o
# TERM < OPERATION SUR LE TERMINAL
dep/term.o: dep/term.cpp
g++ -c dep/term.h -o term.o
# RESET > SUPPRESSION DE LA STRUCTURE DE FICHIERS
clean:
rm -r dep.o