diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 3e14d4c..a8c7b14 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,10 +4,7 @@
-
-
-
@@ -34,11 +31,11 @@
-
+
-
-
+
+
@@ -87,8 +84,8 @@
-
-
+
+
@@ -97,7 +94,7 @@
-
+
@@ -114,11 +111,21 @@
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -165,15 +172,15 @@
-
-
+
+
@@ -658,38 +665,44 @@
1458243697414
-
+
+ 1458244258939
+
+
+ 1458244258939
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -699,12 +712,12 @@
-
+
-
+
@@ -762,7 +775,7 @@
-
+
@@ -1038,14 +1051,6 @@
-
-
-
-
-
-
-
-
@@ -1117,42 +1122,50 @@
-
+
-
-
+
+
-
+
-
-
+
+
-
+
-
-
+
+
-
+
-
-
+
+
-
+
+
+
+
+
+
+
+
+
-
-
+
+
diff --git a/index.php b/index.php
index 014bba8..cddf7c4 100644
--- a/index.php
+++ b/index.php
@@ -15,8 +15,10 @@ try {
// $table = new Table();
//
// foreach ($map->getUnVisitedTiles() as $unVisitedTile) {
+//// $map->vi
// foreach ($unVisitedTile->getNeighbouringPositions() as $neighbouringPosition) {
-// ;
+// $tile = $map->getTileByPosition($neighbouringPosition);
+//// if
// }
// }
}
diff --git a/src/Coffee/Tile.php b/src/Coffee/Tile.php
index 48fd249..e4fd406 100644
--- a/src/Coffee/Tile.php
+++ b/src/Coffee/Tile.php
@@ -2,6 +2,11 @@
namespace Coffee;
+/**
+ * Class Tile
+ *
+ * @package Coffee
+ */
/**
* Class Tile
*
@@ -47,4 +52,11 @@ class Tile extends Position {
return $this->containsElement == self::REPRESENTS_ELEMENT;
}
+ /**
+ * @return Position
+ */
+ public function getPosition() {
+ return new Position($this->getRow(), $this->getColumn());
+ }
+
}
\ No newline at end of file
diff --git a/tests/Coffee/TileTest.php b/tests/Coffee/TileTest.php
index e4c0c3e..a86eb3a 100644
--- a/tests/Coffee/TileTest.php
+++ b/tests/Coffee/TileTest.php
@@ -7,9 +7,20 @@ require __DIR__ . '/../../vendor/autoload.php';
class TileTest extends \PHPUnit_Framework_TestCase {
- public function testContainsElement() {
- $tile = new Tile(2, 2, true);
+ public function testRepresentsElement() {
+ $tile = new Tile(2, 2, Tile::REPRESENTS_ELEMENT);
$this->assertTrue($tile->representsElement());
}
+
+ public function testGetPosition() {
+ $row = 2;
+ $column = 2;
+
+ $tile = new Tile($row, $column, Tile::REPRESENTS_VOID);
+ $position = new Position($row, $column);
+
+ $this->assertEquals($position, $tile->getPosition());
+
+ }
}