Improved walking system.

This commit is contained in:
douwe
2025-08-24 12:08:22 +02:00
parent 98b123ee0d
commit cc0de10471
26 changed files with 858 additions and 154 deletions

View 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