-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tile.h
51 lines (40 loc) · 1.25 KB
/
Tile.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#pragma once
class Tile
{
private:
sf::RectangleShape m_kwadrat;
//A* variables
bool m_isObsticle;
bool m_isVisited;
float m_distanceToStart;
float m_globalGoal;
sf::Vector2i m_tilePositionInGrid;
std::vector<Tile*> m_neighbors;
Tile* m_parentTile;
public:
Tile();
~Tile();
void setFillColor(sf::Color color);
void setPosition(const float X, const float Y);
void setOutlineThickness(const float outlineSize);
void setOutlineColor(sf::Color color);
void setSize(sf::Vector2f size);
void setGridPosition(int gridPositionX, int gridPositionY);
void setTileObsticle(bool isObsticle);
void setDistanceToStart(float distance);
void setGlobalGoal(float globalGoal);
void setParent(Tile* parent);
void setVisit(bool visit);
void pushNeighboor(Tile* tileToPush);
const sf::RectangleShape& getRectangle() const;
const sf::FloatRect& getGlobalBounds() const;
Tile* getParentTile() const;
const float& getGlobalGoal() const;
const float& getDistanceToStart() const;
const bool& isVisited() const;
const bool& isObsticle() const;
const std::vector<Tile*> getNeighborVector() const;
const sf::Vector2f& getPosition() const;
const sf::Color& getFillColor() const;
static float distanceBetweenTiles(const Tile& firstTile, const Tile& secoundTile);
};