Go to the documentation of this file.
25 bool setDanger(
int xpos,
int ypos,
int dangerLevel);
37 static int getMap(lua_State *L);
43 static int getPath(lua_State *L);
76 std::vector<std::vector<int>>
_map;
94 std::vector<Vector2f>
fillPath(std::vector<Vector2f> &path,
95 std::unordered_map<Vector2f, Vector2f> &cameFrom,
Vector2f node)
const;
120 hasher.vector[0] = in.
x;
121 hasher.vector[1] = in.
y;
122 return hasher.hashed;
static int getClosestSafeSpace(lua_State *L)
get closest safe space of player
Definition: LuaMap.cpp:282
Vector2f _player
player position
Definition: LuaMap.hpp:82
std::size_t result_type
Definition: LuaMap.hpp:113
static int getDangerLevelPlayer(lua_State *L)
get danger level of player
Definition: LuaMap.cpp:297
A Vector2 data type. (templated to allow any kind of vector2)
Definition: Vector2.hpp:18
Vector2f findSafeSpace(const std::vector< std::vector< int >> &dangerMap) const
find a safe space for current player
Definition: LuaMap.cpp:141
void setPlayer(Vector3f pos)
set player position
Definition: LuaMap.cpp:43
result_type operator()(argument_type const &in) const
Definition: LuaMap.hpp:114
void clearDanger(void)
Clear danger map.
Definition: LuaMap.cpp:22
T x
The x value of the vector.
Definition: Vector2.hpp:22
std::vector< std::vector< int > > _danger
dangers in 2D grid
Definition: LuaMap.hpp:79
Definition: AnimationsComponent.cpp:9
std::vector< Vector2f > getNeighbors(Vector2f node, bool throughBreakable) const
get neighbors of node for a_star
Definition: LuaMap.cpp:59
static int getPlayer(lua_State *L)
get player pos
Definition: LuaMap.cpp:254
~LuaMap()
dtor
Definition: LuaMap.cpp:19
Vector2f _roundedPlayer
rounded player position
Definition: LuaMap.hpp:88
static int getPlayerRound(lua_State *L)
get rounded player pos
Definition: LuaMap.cpp:268
static int getEnemiesRound(lua_State *L)
Get enemies position rounded.
Definition: LuaMap.cpp:353
static int canPutBomb(lua_State *L)
Check if current player can put a bomb with an escape.
Definition: LuaMap.cpp:373
std::vector< Vector2f > _dirs
Definition: LuaMap.hpp:100
static int getDanger(lua_State *L)
push table of table of the danger map
Definition: LuaMap.cpp:205
std::vector< Vector2f > fillPath(std::vector< Vector2f > &path, std::unordered_map< Vector2f, Vector2f > &cameFrom, Vector2f node) const
unwind path for a_star
Definition: LuaMap.cpp:49
std::vector< std::vector< int > > _map
map blocks in 2D grid
Definition: LuaMap.hpp:76
static int getRadius(lua_State *L)
Get current explosion radius of the player.
Definition: LuaMap.cpp:325
static int getDangerLevel(lua_State *L)
is xpos ypos in danger
Definition: LuaMap.cpp:305
LuaMap()
ctor
Definition: LuaMap.cpp:13
bool setDanger(int xpos, int ypos, int dangerLevel)
set dangerlevel at xpos ypos
Definition: LuaMap.cpp:31
std::vector< Vector2f > pathfind(Vector2f root, Vector2f target, bool throughBreakable) const
A star pathfinding between two points.
Definition: LuaMap.cpp:87
T y
The y value of the vector.
Definition: Vector2.hpp:24
static int getBlockType(lua_State *L)
get block type at x y
Definition: LuaMap.cpp:315
Definition: LuaMap.hpp:13
static int getMap(lua_State *L)
push table of table of the map
Definition: LuaMap.cpp:185
BBM::Vector2f argument_type
Definition: LuaMap.hpp:112
Vector2< float > Vector2f
Definition: Vector2.hpp:178
int currRadius
Explosion radius of current player.
Definition: LuaMap.hpp:91
static int getEnemies(lua_State *L)
Get enemies position.
Definition: LuaMap.cpp:333
std::vector< Vector2f > _enemies
other players position
Definition: LuaMap.hpp:85
static int getPath(lua_State *L)
get array of nodes, path from a to b
Definition: LuaMap.cpp:225