Improved walking system.
This commit is contained in:
19
douwco_hivemind/include/Tools/MeasureTool.hpp
Normal file
19
douwco_hivemind/include/Tools/MeasureTool.hpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#ifndef DOUWCO_HIVEMIND_MEASURE_TOOL_HPP
|
||||
#define DOUWCO_HIVEMIND_MEASURE_TOOL_HPP
|
||||
|
||||
#include <Screeps/RoomPosition.hpp>
|
||||
|
||||
namespace DouwcoHivemind
|
||||
{
|
||||
static bool isNearTo(const Screeps::RoomPosition &pos1, const Screeps::RoomPosition &pos2, int dist)
|
||||
{
|
||||
int dx = pos1.x() - pos2.x();
|
||||
int dy = pos1.y() - pos2.y();
|
||||
int dist2 = dist * dist;
|
||||
return dx * dx <= dist2 &&
|
||||
dy * dy <= dist2 &&
|
||||
pos1.roomName() == pos2.roomName();
|
||||
}
|
||||
} // namespace Screeps
|
||||
|
||||
#endif // DOUWCO_HIVEMIND_MEASURE_TOOL_HPP
|
||||
@@ -6,7 +6,6 @@
|
||||
|
||||
namespace DouwcoHivemind
|
||||
{
|
||||
|
||||
static std::vector<int> flattenPathSteps(const std::vector<Screeps::PathStep> &pathSteps)
|
||||
{
|
||||
std::vector<int> flattened;
|
||||
|
||||
Reference in New Issue
Block a user