Release 0.65

master
Kasi 2018-07-13 22:41:07 +01:00
parent f99afa00c8
commit 71dce61c09
13 changed files with 117 additions and 1 deletions

View File

@ -17,6 +17,7 @@ namespace Internal
Region(const Region& R);
static Class GetClass();
std::int32_t GetEntityCount() const;
std::vector<GameObject> GetGameObjects() const;
GameObject GetGameObjects(std::int32_t I) const;
std::vector<std::vector<std::vector<SceneTile>>> GetSceneTiles() const;

View File

@ -14,7 +14,6 @@ std::int32_t UniformRandom(std::int32_t Min, std::int32_t Max);
double UniformRandom();
std::int32_t NormalRandom(std::int32_t Mean, double StandardDeviation);
std::int32_t NormalRandom(std::int32_t Low, std::int32_t High, double PercentageDeviation);
std::vector<Point> Spiral(Point Start, Box Area);
std::vector<Point> ConvexHull(std::vector<Point> Points);
/** @} */

View File

@ -11,6 +11,7 @@
#include "Tools/Worlds.hpp"
#include "Tools/RandomHandler.hpp"
#include "Tools/Camera.hpp"
#include "Tools/Pathfinding.hpp"
#include "Interfaces/Bank.hpp"
#include "Interfaces/Chat.hpp"

View File

@ -31,6 +31,8 @@ namespace Interactable
double GetVisibility() const;
Tile GetTile() const;
Tile GetReachableTile() const;
bool IsReachable() const;
bool RotateTo(std::int32_t Angle = 0) const;
bool RotateTo(Camera::COMPASS_DIRECTION Direction) const;

View File

@ -31,6 +31,10 @@ namespace Interactable
double GetVisibility() const;
Tile GetTile() const;
Tile GetReachableTile() const;
Tile GetMin() const;
Tile GetMax() const;
bool IsReachable() const;
bool RotateTo(std::int32_t Angle = 0) const;
bool RotateTo(Camera::COMPASS_DIRECTION Direction) const;

View File

@ -34,6 +34,8 @@ namespace Interactable
double GetVisibility() const;
Tile GetTile() const;
Tile GetLocalTile() const;
Tile GetReachableTile() const;
bool IsReachable() const;
bool RotateTo(std::int32_t Angle = 0) const;
bool RotateTo(Camera::COMPASS_DIRECTION Direction) const;

View File

@ -31,6 +31,8 @@ namespace Interactable
double GetVisibility() const;
Tile GetTile() const;
Tile GetReachableTile() const;
bool IsReachable() const;
bool RotateTo(std::int32_t Angle = 0) const;
bool RotateTo(Camera::COMPASS_DIRECTION Direction) const;

View File

@ -31,6 +31,8 @@ namespace Interactable
double GetVisibility() const;
Tile GetTile() const;
Tile GetReachableTile() const;
bool IsReachable() const;
bool RotateTo(std::int32_t Angle = 0) const;
bool RotateTo(Camera::COMPASS_DIRECTION Direction) const;

View File

@ -30,6 +30,8 @@ namespace Interactable
double GetVisibility() const;
Tile GetTile() const;
Tile GetReachableTile() const;
bool IsReachable() const;
bool RotateTo(std::int32_t Angle = 0) const;
bool RotateTo(Camera::COMPASS_DIRECTION Direction) const;

View File

@ -31,6 +31,8 @@ namespace Interactable
double GetVisibility() const;
Tile GetTile() const;
Tile GetReachableTile() const;
bool IsReachable() const;
bool RotateTo(std::int32_t Angle = 0) const;
bool RotateTo(Camera::COMPASS_DIRECTION Direction) const;

View File

@ -65,6 +65,13 @@ class Minimap
* @return true if the function succesfully clicked the orb
*/
static bool ClickQuickPrayer();
/**
* @brief Clicks the toggle-run orb
*
* @return true if the function succesfully clicked the orb
*/
static bool ClickToggleRun();
};
/** @} */

View File

@ -0,0 +1,92 @@
#ifndef PATHFINDING_HPP_INCLUDED
#define PATHFINDING_HPP_INCLUDED
#include "../../Core/Types/Tile.hpp"
#include <vector>
#include <functional>
class Pathfinding
{
public:
enum COLLISION_FLAG
{
OPEN = 0,
CLOSED = 0xFFFFFF,
UNINITIALIZED = 0x1000000,
OCCUPIED = 0x100,
SOLID = 0x20000,
BLOCKED = 0x200000,
NORTH = 0x2,
EAST = 0x8,
SOUTH = 0x20,
WEST = 0x80,
NORTHEAST = 0x4,
SOUTHEAST = 0x10,
SOUTHWEST = 0x40,
NORTHWEST = 0x1,
BLOCKED_NORTH = 0x400,
BLOCKED_EAST = 0x1000,
BLOCKED_SOUTH = 0x4000,
BLOCKED_WEST = 0x10000,
BLOCKED_NORTHEAST = 0x800,
BLOCKED_SOUTHEAST = 0x2000,
BLOCKED_NORTHWEST = 0x200,
BLOCKED_SOUTHWEST = 0x8000,
};
typedef enum PATHFINDER
{
BREADTH_FIRST_SEARCH
} PATHFINDER;
class TileNode
{
public:
std::int32_t X;
std::int32_t Y;
std::int32_t Flag;
bool Inspected;
std::int32_t Parent[2];
TileNode();
TileNode(std::int32_t X, std::int32_t Y, std::int32_t Flag);
bool IsBlocked(bool AllowOccupied = true) const;
Tile ToWorldTile() const;
bool operator==(const TileNode& N) const;
operator bool() const;
};
static void RegenerateNodes();
static std::vector<std::vector<TileNode>> GetNodes();
static Tile FindWalkableTile(const Tile& T);
static Tile FindWalkableTile(const Tile& T, const Tile& Min, const Tile& Max);
static std::vector<Tile> FindWalkableTiles(const Tile& T);
static std::vector<Tile> FindWalkableTiles(const Tile& T, const Tile& Min, const Tile& Max);
static std::vector<Tile> FindPathTo(const Tile& Goal, bool AllowOccupied = false, PATHFINDER Finder = BREADTH_FIRST_SEARCH);
static std::vector<Tile> FindPathTo(const std::vector<Tile>& Goals, bool AllowOccupied = false, PATHFINDER Finder = BREADTH_FIRST_SEARCH);
// Ignores collision
static std::vector<Tile> FindDirectPathTo(const Tile& Goal, PATHFINDER Finder = BREADTH_FIRST_SEARCH);
static std::vector<Tile> FindDirectPathTo(const std::vector<Tile>& Goals, PATHFINDER Finder = BREADTH_FIRST_SEARCH);
static bool IsInside(std::uint32_t X, std::uint32_t Y);
static std::vector<Pathfinding::TileNode*> GetNeighborsTo(std::uint32_t X, std::uint32_t Y, bool AllowOccupied = false, bool CheckCollision = true);
static std::vector<Pathfinding::TileNode> Finder_BFS( std::uint32_t StartX, std::uint32_t StartY,
std::uint32_t EndX, std::uint32_t EndY,
bool AllowOccupied = false, bool CheckCollision = true );
static std::vector<Pathfinding::TileNode> Finder_BFS( std::uint32_t StartX, std::uint32_t StartY,
const std::vector<std::pair<std::uint32_t, std::uint32_t>>& Ends,
bool AllowOccupied = false, bool CheckCollision = true );
private:
static std::vector<std::vector<TileNode>> Nodes;
};
#endif // PATHFINDING_HPP_INCLUDED

Binary file not shown.