Verified Commit 70978084 authored by Romain De Laage De Bellefaye's avatar Romain De Laage De Bellefaye 🌳
Browse files

Reorganize project

parent da605f89
*.o
projetLO21
cellulut
.qmake.stash
moc_*.cpp
Makefile
moc_*.h
#ifndef _FONCTION_H
#define _FONTION_H
class Regle {
int* seuil[8]; //seuil : valeurs minimales pour chacun des états dans le voisinage pour valider la règle en question
Etat destination;
public:
bool verify(Voisinage& voisins) const;
const Etat& getDestination() const { return destination; }
};
class RegleAvecEtatCourant : public Regle {
Etat etatCourant;
public:
bool verify(Voisinage& voisins, Cellule& cellule) const;
};
class Fonction {
Etat defaut;
Regle** regle;
public:
Fonction();
~Fonction();
const Etat& getEtatDefaut() const { return defaut; }
void setEtatDefaut(const Etat& nouv) { defaut = nouv; }
void ajouterRegle(const Etat& destination, const int* seuil[8]);
void ajouterRegle(Etat& destination, int* seuil, Etat& etatCourant);
const Etat& getEtatSuivant(Cellule& cellule, Voisinage& voisins) const;
};
#endif
QT += core
QT += sql
QT += widgets
INCLUDEPATH += "includes"
SOURCES += src/autocell.cpp
SOURCES += src/voisinage.cpp
SOURCES += src/reseau_cellule_etats.cpp
SOURCES += src/main.cpp
SOURCES += src/autosql.cpp
SOURCES += src/Fonction.cpp
SOURCES += src/Automate.cpp
HEADERS += includes/autocell.h
HEADERS += includes/fonction.h
HEADERS += includes/autosql.h
HEADERS += includes/voisinage.h
HEADERS += includes/reseau_cellule_etats.h
HEADERS += includes/Fonction.h
HEADERS += includes/Automate.h
QT += core
QT += sql
HEADERS += autosql.h
SOURCES += autosql.cpp
......@@ -2,8 +2,8 @@
#define _AUTOMATE_H
#include <memory>
#include "../Fonction_Regle/Fonction.h"
#include "../Voisinage/voisinage.hpp"
#include <Fonction.h>
#include <voisinage.h>
class Automate {
private:
......
......@@ -2,8 +2,8 @@
#define _FONCTION_H
#include <memory>
#include "../Reseau_Cellule_Etat/reseau_cellule_etats.h"
#include "../Voisinage/voisinage.hpp"
#include <reseau_cellule_etats.h>
#include <voisinage.h>
class Regle {
protected:
......
#ifndef AUTOCELL_H
#define AUTOCELL_H
#include "../Reseau_Cellule_Etat/reseau_cellule_etats.h"
#include <reseau_cellule_etats.h>
#include <QObject>
#include <QApplication>
......
......@@ -10,10 +10,10 @@
#include <stdio.h>
#include <iostream>
#include "../Reseau_Cellule_Etat/reseau_cellule_etats.h"
#include <reseau_cellule_etats.h>
#include <string.h>
#include "Reseau_Cellule_Etat/reseau_cellule_etats.h"
#include <reseau_cellule_etats.h>
using namespace std;
......
#include <iostream>
int main(void) {
std::cout << "Hello world !" << std::endl;
return 0;
}
QT += widgets
SOURCES += GUI/autocell.cpp
SOURCES += Voisinage/voisinage.cpp
SOURCES += Reseau_Cellule_Etat/reseau_cellule_etats.cpp
SOURCES += Reseau_Cellule_Etat/main.cpp
SOURCES += Fonction_Regle/Fonction.cpp
SOURCES += Automate/Automate.cpp
HEADERS += ./GUI/autocell.h
HEADERS += ./Cellulut/Cellulut/fonction.h
HEADERS += ./Voisinage/voisinage.hpp
HEADERS += ./Reseau_Cellule_Etat/reseau_cellule_etats.h
HEADERS += ./Fonction_Regle/Fonction.h
HEADERS += ./Automate/Automate.h
#include "Automate.h"
#include <Automate.h>
std::unique_ptr<Automate> Automate::instance = nullptr;
#include "Fonction.h"
#include <Fonction.h>
bool RegleAvecEtatCourant::verify(const Voisinage& voisins, const Cellule& cellule) const {
if(cellule.getIndEtat() != etatCourant)
......
#include "autocell.h"
#include "../Reseau_Cellule_Etat/reseau_cellule_etats.h"
#include <autocell.h>
#include <reseau_cellule_etats.h>
#include <QApplication>
#include <QPushButton>
......
#include <iostream>
#include "autosql.h"
#include <autosql.h>
Database::Database(std::string path): db(QSqlDatabase::addDatabase("QSQLITE")) {
db.setDatabaseName(path.c_str());
......@@ -22,14 +22,3 @@ std::vector<QString> Database::getAutomates() const {
return names;
}
int main() {
Database db("test.sqlite");
auto automates = db.getAutomates();
for(auto& automate: automates) {
std::cout << automate.toStdString() << std::endl;
}
return 0;
}
#include "./Reseau_Cellule_Etat/reseau_cellule_etats.h"
#include "./GUI/autocell.h"
#include <reseau_cellule_etats.h>
#include <autocell.h>
#include <QApplication>
#include <QPushButton>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment