summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkrilius <ulrich.lejoyeux@gmail.com>2015-04-29 20:52:18 +0400
committerkrilius <ulrich.lejoyeux@gmail.com>2015-04-29 20:52:18 +0400
commite241abc9df586cce683d6ae89e1d02c13084a10f (patch)
tree2bafd2e87d26347bb487b04187c7b5ad0aab702d
parent9fbd4e0fedea42a206843981dffeb87095797581 (diff)
bug sous osx
-rw-r--r--src/Model/Cell.cpp6
-rw-r--r--src/Model/Cell.hpp2
-rw-r--r--src/Model/Grid.cpp12
-rw-r--r--src/Model/Grid.hpp8
-rw-r--r--src/main.cpp4
5 files changed, 16 insertions, 16 deletions
diff --git a/src/Model/Cell.cpp b/src/Model/Cell.cpp
index a0729f7..22eaafe 100644
--- a/src/Model/Cell.cpp
+++ b/src/Model/Cell.cpp
@@ -19,9 +19,9 @@ Cell::~Cell()
}
// Description
-/*
-void Cell::description()
+
+std::string Cell::description()
{
return m_value;
}
-*/
+
diff --git a/src/Model/Cell.hpp b/src/Model/Cell.hpp
index dd946ab..7775bf5 100644
--- a/src/Model/Cell.hpp
+++ b/src/Model/Cell.hpp
@@ -21,7 +21,7 @@ class Cell
~Cell();
// Describes the cell in a terminal
- //std::string description();
+ std::string description();
};
diff --git a/src/Model/Grid.cpp b/src/Model/Grid.cpp
index d7d3f15..ade3f74 100644
--- a/src/Model/Grid.cpp
+++ b/src/Model/Grid.cpp
@@ -1,9 +1,9 @@
#include "Grid.hpp"
-/*
+
Grid::Grid(int size)
{
- m_table = std::vector<std::vector<Cell*>>(size);
+ m_table = std::vector<std::vector<Cell*> >(size);
for(int i = 0 ; i < size ; i++)
{
m_table[i] = std::vector<Cell*>(size);
@@ -19,20 +19,20 @@ Grid::~Grid()
{
for(int i = 0 ; i < m_table.size() ; i++)
{
- for(int i = 0 ; j < m_table[i].size() ; j++)
+ for(int j = 0 ; j < m_table[i].size() ; j++)
delete m_table[i][j];
}
}
-void Grid::description()
+void Grid::afficher()
{
for(int i = 0 ; i < m_table.size() ; i++)
{
- for(int j = 0 ; j < m_table[i].size() ; i++)
+ for(int j = 0 ; j < m_table[i].size() ; j++)
{
std::cout << m_table[i][j]->description();
}
std::cout << std::endl;
}
}
-*/
+
diff --git a/src/Model/Grid.hpp b/src/Model/Grid.hpp
index 304e436..e3bc888 100644
--- a/src/Model/Grid.hpp
+++ b/src/Model/Grid.hpp
@@ -11,17 +11,17 @@
#include <vector>
#include "Cell.hpp"
-/*
+
class Grid
{
private:
- std::vector<std::vector<Cell*>> m_table;
+ std::vector<std::vector<Cell*> > m_table;
public:
Grid(int size);
~Grid();
- void description();
+ void afficher();
};
-*/
+
#endif
diff --git a/src/main.cpp b/src/main.cpp
index 689767a..12f6c6d 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -5,9 +5,9 @@
int main()
{
-// Grid * grid = new Grid();
+ Grid * grid = new Grid(4);
-// grid->description();
+ grid->afficher();
return 0;
}