refactored

This commit is contained in:
2026-05-24 14:21:35 +03:00
parent b75c9581b8
commit 119b85ea31
5 changed files with 56 additions and 58 deletions
+3 -6
View File
@@ -19,8 +19,8 @@ private:
size_t FieldSize = 4;
std::vector<Line> field;
Line& getRow(size_t rowIndex) const;
Line& getColumn(size_t columnIndex) const;
Line getRow(size_t rowIndex) const;
Line getColumn(size_t columnIndex) const;
void setRow(size_t rowIndex, const Line &line);
void setColumn(size_t columnIndex, const Line &line);
@@ -31,10 +31,7 @@ public:
Field(size_t fieldSize);
bool canMove() const;
bool moveUp();
bool moveDown();
bool moveLeft();
bool moveRight();
bool move(Direction direction);
std::vector<Position> getEmptyTiles() const;
bool spawnTile(const std::vector<Position> &empty);
+8 -1
View File
@@ -1,4 +1,11 @@
#pragma once
using Tile = unsigned long long int;
using Score = unsigned long long int;
using Score = unsigned long long int;
enum class Direction {
up,
down,
left,
right
};