aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdrian Kummerlaender2017-03-26 15:38:58 +0200
committerAdrian Kummerlaender2017-03-26 15:38:58 +0200
commit7e3ea6b0080b2c9127964a096a27369d8cc59c67 (patch)
tree5f69a365fb9d5ebd9f1646ceadc7da75364b083c /src
parent1266502d8f0e72c135198278fcccf75b519cee44 (diff)
downloadtermlife-7e3ea6b0080b2c9127964a096a27369d8cc59c67.tar
termlife-7e3ea6b0080b2c9127964a096a27369d8cc59c67.tar.gz
termlife-7e3ea6b0080b2c9127964a096a27369d8cc59c67.tar.bz2
termlife-7e3ea6b0080b2c9127964a096a27369d8cc59c67.tar.lz
termlife-7e3ea6b0080b2c9127964a096a27369d8cc59c67.tar.xz
termlife-7e3ea6b0080b2c9127964a096a27369d8cc59c67.tar.zst
termlife-7e3ea6b0080b2c9127964a096a27369d8cc59c67.zip
Rename `TorusArray` to `TorusMatrix` to better fit the represented structure
Diffstat (limited to 'src')
-rw-r--r--src/util/torus_matrix.h (renamed from src/util/torus_array.h)8
-rw-r--r--src/world.h4
2 files changed, 6 insertions, 6 deletions
diff --git a/src/util/torus_array.h b/src/util/torus_matrix.h
index bef0c9f..d09b99e 100644
--- a/src/util/torus_array.h
+++ b/src/util/torus_matrix.h
@@ -1,5 +1,5 @@
-#ifndef LIFE_SRC_UTIL_TORUS_ARRAY_
-#define LIFE_SRC_UTIL_TORUS_ARRAY_
+#ifndef LIFE_SRC_UTIL_TORUS_MATRIX_
+#define LIFE_SRC_UTIL_TORUS_MATRIX_
#include <array>
#include <cstdint>
@@ -12,7 +12,7 @@ template<
std::size_t WIDTH,
std::size_t HEIGHT
>
-class TorusArray {
+class TorusMatrix {
static std::size_t toMatrixColumn(const std::ptrdiff_t x) {
if ( x >= 0 ) {
return x % WIDTH;
@@ -49,4 +49,4 @@ class TorusArray {
}
}
-#endif // LIFE_SRC_UTIL_TORUS_ARRAY_
+#endif // LIFE_SRC_UTIL_TORUS_MATRIX_
diff --git a/src/world.h b/src/world.h
index a09eb5a..a7a68a0 100644
--- a/src/world.h
+++ b/src/world.h
@@ -6,7 +6,7 @@
#include <cstdint>
#include "util/box_traverser.h"
-#include "util/torus_array.h"
+#include "util/torus_matrix.h"
namespace life {
@@ -117,9 +117,9 @@ class World {
private:
const util::BoxTraverser area_;
+ util::TorusMatrix<bool, WIDTH, HEIGHT> matrix_;
std::size_t age_{};
std::size_t population_{};
- util::TorusArray<bool, WIDTH, HEIGHT> matrix_;
};