move all games into specific directories
This commit is contained in:
parent
62b023792b
commit
f86133527a
18 changed files with 27 additions and 24 deletions
7
Makefile
7
Makefile
|
@ -6,7 +6,7 @@ MKDIR = mkdir -p
|
||||||
|
|
||||||
SRC_DIR = src
|
SRC_DIR = src
|
||||||
INC_DIR = includes
|
INC_DIR = includes
|
||||||
SOURCES = $(wildcard $(SRC_DIR)/*.cpp)
|
SOURCES = $(wildcard $(SRC_DIR)/*.cpp) $(wildcard $(SRC_DIR)/**/*.cpp)
|
||||||
OBJETS = $(patsubst %.cpp,%.cpp.o,$(notdir $(SOURCES)))
|
OBJETS = $(patsubst %.cpp,%.cpp.o,$(notdir $(SOURCES)))
|
||||||
|
|
||||||
CXXFLAGS = --std=c++11
|
CXXFLAGS = --std=c++11
|
||||||
|
@ -22,6 +22,9 @@ PDF_DIR = report
|
||||||
%.cpp.o: $(SRC_DIR)/%.cpp
|
%.cpp.o: $(SRC_DIR)/%.cpp
|
||||||
$(CXX) -c -o $@ $< $(CXXFLAGS)
|
$(CXX) -c -o $@ $< $(CXXFLAGS)
|
||||||
|
|
||||||
|
%.cpp.o: $(SRC_DIR)/**/%.cpp
|
||||||
|
$(CXX) -c -o $@ $< $(CXXFLAGS)
|
||||||
|
|
||||||
main: CXXFLAGS += -O3
|
main: CXXFLAGS += -O3
|
||||||
main: compilation
|
main: compilation
|
||||||
|
|
||||||
|
@ -30,7 +33,7 @@ dev: CXXFLAGS += -Wold-style-cast -Wsign-conversion
|
||||||
dev: compilation
|
dev: compilation
|
||||||
|
|
||||||
compilation: $(OBJETS)
|
compilation: $(OBJETS)
|
||||||
$(CXX) -o $(EXE).$(EXE_EXT) $(OBJETS) $(LIBS)
|
$(CXX) -o $(EXE).$(EXE_EXT) $^ $(LIBS)
|
||||||
|
|
||||||
all:
|
all:
|
||||||
main
|
main
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#include "../includes/Joueur.hpp"
|
#include "../Joueur.hpp"
|
||||||
#include "../includes/PlateauButin.hpp"
|
#include "PlateauButin.hpp"
|
||||||
|
|
||||||
class Butin {
|
class Butin {
|
||||||
friend std::ostream &operator<<(std::ostream &, const Butin &);
|
friend std::ostream &operator<<(std::ostream &, const Butin &);
|
|
@ -1,6 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Piece.hpp"
|
#include "../Piece.hpp"
|
||||||
|
|
||||||
class PieceButin : public Piece {
|
class PieceButin : public Piece {
|
||||||
int points;
|
int points;
|
|
@ -1,6 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Plateau.hpp"
|
#include "../Plateau.hpp"
|
||||||
|
|
||||||
class PlateauButin : public Plateau {
|
class PlateauButin : public Plateau {
|
||||||
public:
|
public:
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#include "../includes/Joueur.hpp"
|
#include "../Joueur.hpp"
|
||||||
#include "../includes/Plateau.hpp"
|
#include "../Plateau.hpp"
|
||||||
|
|
||||||
class Dames {
|
class Dames {
|
||||||
friend std::ostream &operator<<(std::ostream &, const Dames &);
|
friend std::ostream &operator<<(std::ostream &, const Dames &);
|
|
@ -1,6 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Piece.hpp"
|
#include "../Piece.hpp"
|
||||||
|
|
||||||
class PieceDames : public Piece {
|
class PieceDames : public Piece {
|
||||||
// True si la piece est une dame
|
// True si la piece est une dame
|
|
@ -1,6 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Piece.hpp"
|
#include "../Piece.hpp"
|
||||||
|
|
||||||
class PieceSafari : public Piece {
|
class PieceSafari : public Piece {
|
||||||
public:
|
public:
|
|
@ -1,6 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Plateau.hpp"
|
#include "../Plateau.hpp"
|
||||||
|
|
||||||
class PlateauSafari : public Plateau {
|
class PlateauSafari : public Plateau {
|
||||||
public:
|
public:
|
|
@ -2,9 +2,9 @@
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#include "../includes/Joueur.hpp"
|
#include "../Joueur.hpp"
|
||||||
#include "../includes/PieceSafari.hpp"
|
#include "PieceSafari.hpp"
|
||||||
#include "../includes/PlateauSafari.hpp"
|
#include "PlateauSafari.hpp"
|
||||||
|
|
||||||
class Safari {
|
class Safari {
|
||||||
friend std::ostream &operator<<(std::ostream &, const Safari &);
|
friend std::ostream &operator<<(std::ostream &, const Safari &);
|
|
@ -1,4 +1,4 @@
|
||||||
#include "../includes/Butin.hpp"
|
#include "../../includes/Butin/Butin.hpp"
|
||||||
|
|
||||||
Butin::Butin(Joueur &j1, Joueur &j2)
|
Butin::Butin(Joueur &j1, Joueur &j2)
|
||||||
: plateau(PlateauButin()), joueur1{j1}, joueur2{j2}, joueurCourant{j1} {
|
: plateau(PlateauButin()), joueur1{j1}, joueur2{j2}, joueurCourant{j1} {
|
|
@ -1,4 +1,4 @@
|
||||||
#include "../includes/PieceButin.hpp"
|
#include "../../includes/Butin/PieceButin.hpp"
|
||||||
|
|
||||||
PieceButin::PieceButin(const std::string cat) : Piece(cat) {
|
PieceButin::PieceButin(const std::string cat) : Piece(cat) {
|
||||||
std::cout << "pièce - " << cat << "\n";
|
std::cout << "pièce - " << cat << "\n";
|
|
@ -1,5 +1,5 @@
|
||||||
#include "../includes/PlateauButin.hpp"
|
#include "../../includes/Butin/PlateauButin.hpp"
|
||||||
#include "../includes/PieceButin.hpp"
|
#include "../../includes/Butin/PieceButin.hpp"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <random>
|
#include <random>
|
|
@ -1,4 +1,4 @@
|
||||||
#include "../includes/Dames.hpp"
|
#include "../../includes/Dames/Dames.hpp"
|
||||||
|
|
||||||
Dames::Dames(Joueur &j1, Joueur &j2)
|
Dames::Dames(Joueur &j1, Joueur &j2)
|
||||||
: plateau(Plateau(10)), joueur1(j1), joueur2(j2), joueurCourant(j1) {
|
: plateau(Plateau(10)), joueur1(j1), joueur2(j2), joueurCourant(j1) {
|
|
@ -1,4 +1,4 @@
|
||||||
#include "../includes/PieceDames.hpp"
|
#include "../../includes/Dames/PieceDames.hpp"
|
||||||
|
|
||||||
PieceDames::PieceDames(const std::string cat) : Piece(cat) {
|
PieceDames::PieceDames(const std::string cat) : Piece(cat) {
|
||||||
std::cout << "pièce - " << cat << "\n";
|
std::cout << "pièce - " << cat << "\n";
|
|
@ -1,6 +1,6 @@
|
||||||
#include "../includes/Plateau.hpp"
|
#include "../includes/Plateau.hpp"
|
||||||
|
#include "../includes/Dames/PieceDames.hpp"
|
||||||
#include "../includes/Ecran.hpp"
|
#include "../includes/Ecran.hpp"
|
||||||
#include "../includes/PieceDames.hpp"
|
|
||||||
|
|
||||||
Plateau::Plateau(int t) : plateau(new Piece **[t]), taille(t) {
|
Plateau::Plateau(int t) : plateau(new Piece **[t]), taille(t) {
|
||||||
// Création du plateau vide
|
// Création du plateau vide
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#include "../includes/PieceSafari.hpp"
|
#include "../../includes/Safari/PieceSafari.hpp"
|
||||||
|
|
||||||
PieceSafari::PieceSafari(const std::string cat) : Piece(cat) {
|
PieceSafari::PieceSafari(const std::string cat) : Piece(cat) {
|
||||||
std::cout << "pièce - " << cat << "\n";
|
std::cout << "pièce - " << cat << "\n";
|
|
@ -1,4 +1,4 @@
|
||||||
#include "../includes/PlateauSafari.hpp"
|
#include "../../includes/Safari/PlateauSafari.hpp"
|
||||||
|
|
||||||
PlateauSafari::PlateauSafari(int t) : Plateau(t) {}
|
PlateauSafari::PlateauSafari(int t) : Plateau(t) {}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#include "../includes/Safari.hpp"
|
#include "../../includes/Safari/Safari.hpp"
|
||||||
|
|
||||||
Safari::Safari(Joueur &j1, Joueur &j2, Joueur &j3)
|
Safari::Safari(Joueur &j1, Joueur &j2, Joueur &j3)
|
||||||
: plateau(PlateauSafari(8)), joueur1{j1}, joueur2{j2}, joueur3{j3},
|
: plateau(PlateauSafari(8)), joueur1{j1}, joueur2{j2}, joueur3{j3},
|
Reference in a new issue