1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-04-21 12:06:49 +02:00

Use optimized container without dynamic memory allocations

This commit is contained in:
Ivan Savenko 2024-07-03 21:15:40 +00:00
parent 1468abb8a0
commit 73fdd12581

View File

@ -23,6 +23,8 @@ constexpr int NKAI_GRAPH_TRACE_LEVEL = 0;
#include "Actions/SpecialAction.h" #include "Actions/SpecialAction.h"
#include "Actors.h" #include "Actors.h"
#include <boost/container/small_vector.hpp>
namespace NKAI namespace NKAI
{ {
namespace AIPathfinding namespace AIPathfinding
@ -85,7 +87,9 @@ struct AIPathNodeInfo
struct AIPath struct AIPath
{ {
std::vector<AIPathNodeInfo> nodes; using NodesVector = boost::container::small_vector<AIPathNodeInfo, 16>;
NodesVector nodes;
uint64_t targetObjectDanger; uint64_t targetObjectDanger;
uint64_t armyLoss; uint64_t armyLoss;
uint64_t targetObjectArmyLoss; uint64_t targetObjectArmyLoss;