mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
CGPathNode: apply suggested optimizations
Also make EPathfindingLayers ui8 too
This commit is contained in:
parent
def0f0ef0a
commit
adeefe903a
@ -26,18 +26,18 @@ struct DLL_LINKAGE CGPathNode
|
||||
{
|
||||
typedef EPathfindingLayer ELayer;
|
||||
|
||||
enum ENodeAction
|
||||
enum ENodeAction : ui8
|
||||
{
|
||||
UNKNOWN = -1,
|
||||
NORMAL = 0,
|
||||
UNKNOWN = 0,
|
||||
EMBARK = 1,
|
||||
DISEMBARK, //2
|
||||
BATTLE,//3
|
||||
VISIT,//4
|
||||
BLOCKING_VISIT//5
|
||||
DISEMBARK,
|
||||
NORMAL,
|
||||
BATTLE,
|
||||
VISIT,
|
||||
BLOCKING_VISIT
|
||||
};
|
||||
|
||||
enum EAccessibility
|
||||
enum EAccessibility : ui8
|
||||
{
|
||||
NOT_SET = 0,
|
||||
ACCESSIBLE = 1, //tile can be entered and passed
|
||||
@ -47,14 +47,14 @@ struct DLL_LINKAGE CGPathNode
|
||||
BLOCKED //tile can't be entered nor visited
|
||||
};
|
||||
|
||||
bool locked;
|
||||
EAccessibility accessible;
|
||||
ui8 turns; //how many turns we have to wait before reachng the tile - 0 means current turn
|
||||
ui32 moveRemains; //remaining tiles after hero reaches the tile
|
||||
CGPathNode * theNodeBefore;
|
||||
int3 coord; //coordinates
|
||||
ui32 moveRemains; //remaining tiles after hero reaches the tile
|
||||
ui8 turns; //how many turns we have to wait before reachng the tile - 0 means current turn
|
||||
ELayer layer;
|
||||
EAccessibility accessible;
|
||||
ENodeAction action;
|
||||
bool locked;
|
||||
|
||||
CGPathNode();
|
||||
void reset();
|
||||
|
@ -748,9 +748,9 @@ ID_LIKE_OPERATORS_DECLS(ETerrainType, ETerrainType::EETerrainType)
|
||||
class DLL_LINKAGE EPathfindingLayer
|
||||
{
|
||||
public:
|
||||
enum EEPathfindingLayer
|
||||
enum EEPathfindingLayer : ui8
|
||||
{
|
||||
WRONG = -2, AUTO = -1, LAND = 0, SAIL = 1, WATER, AIR, NUM_LAYERS
|
||||
WRONG = 0, AUTO = 1, LAND = 2, SAIL = 3, WATER, AIR, NUM_LAYERS
|
||||
};
|
||||
|
||||
EPathfindingLayer(EEPathfindingLayer _num = WRONG) : num(_num)
|
||||
|
Loading…
Reference in New Issue
Block a user