(svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
This commit is contained in:
14
src/ai/ai.h
14
src/ai/ai.h
@@ -7,7 +7,7 @@
|
||||
#include "../command.h"
|
||||
|
||||
/* How DoCommands look like for an AI */
|
||||
typedef struct AICommand {
|
||||
struct AICommand {
|
||||
uint32 tile;
|
||||
uint32 p1;
|
||||
uint32 p2;
|
||||
@@ -17,22 +17,22 @@ typedef struct AICommand {
|
||||
char *text;
|
||||
uint uid;
|
||||
|
||||
struct AICommand *next;
|
||||
} AICommand;
|
||||
AICommand *next;
|
||||
};
|
||||
|
||||
/* The struct for an AIScript Player */
|
||||
typedef struct AIPlayer {
|
||||
struct AIPlayer {
|
||||
bool active; ///< Is this AI active?
|
||||
AICommand *queue; ///< The commands that he has in his queue
|
||||
AICommand *queue_tail; ///< The tail of this queue
|
||||
} AIPlayer;
|
||||
};
|
||||
|
||||
/* The struct to keep some data about the AI in general */
|
||||
typedef struct AIStruct {
|
||||
struct AIStruct {
|
||||
/* General */
|
||||
bool enabled; ///< Is AI enabled?
|
||||
uint tick; ///< The current tick (something like _frame_counter, only for AIs)
|
||||
} AIStruct;
|
||||
};
|
||||
|
||||
VARDEF AIStruct _ai;
|
||||
VARDEF AIPlayer _ai_player[MAX_PLAYERS];
|
||||
|
@@ -446,12 +446,12 @@ static void AiStateDoReplaceVehicle(Player *p)
|
||||
_veh_do_replace_proc[v->type - VEH_Train](p);
|
||||
}
|
||||
|
||||
typedef struct FoundRoute {
|
||||
struct FoundRoute {
|
||||
int distance;
|
||||
CargoID cargo;
|
||||
void *from;
|
||||
void *to;
|
||||
} FoundRoute;
|
||||
};
|
||||
|
||||
static Town *AiFindRandomTown()
|
||||
{
|
||||
@@ -1824,12 +1824,12 @@ static TileIndex AiGetEdgeOfDefaultRailBlock(byte rule, TileIndex tile, byte cmd
|
||||
return tile + ToTileIndexDiff(p->tileoffs) - TileOffsByDiagDir(*dir = p->attr);
|
||||
}
|
||||
|
||||
typedef struct AiRailPathFindData {
|
||||
struct AiRailPathFindData {
|
||||
TileIndex tile;
|
||||
TileIndex tile2;
|
||||
int count;
|
||||
bool flag;
|
||||
} AiRailPathFindData;
|
||||
};
|
||||
|
||||
static bool AiEnumFollowTrack(TileIndex tile, AiRailPathFindData *a, int track, uint length, byte *state)
|
||||
{
|
||||
@@ -1858,7 +1858,7 @@ static bool AiDoFollowTrack(const Player* p)
|
||||
return arpfd.count > 8;
|
||||
}
|
||||
|
||||
typedef struct AiRailFinder {
|
||||
struct AiRailFinder {
|
||||
TileIndex final_tile;
|
||||
byte final_dir;
|
||||
byte depth;
|
||||
@@ -1873,7 +1873,7 @@ typedef struct AiRailFinder {
|
||||
TileIndex cur_best_tile, best_tile;
|
||||
TileIndex bridge_end_tile;
|
||||
Player *player;
|
||||
} AiRailFinder;
|
||||
};
|
||||
|
||||
static const byte _ai_table_15[4][8] = {
|
||||
{0, 0, 4, 3, 3, 1, 128 + 0, 64},
|
||||
@@ -2713,7 +2713,7 @@ static void AiStateBuildDefaultRoadBlocks(Player *p)
|
||||
p->ai.state_mode = 255;
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
struct AiRoadFinder {
|
||||
TileIndex final_tile;
|
||||
byte final_dir;
|
||||
byte depth;
|
||||
@@ -2728,14 +2728,14 @@ typedef struct {
|
||||
TileIndex cur_best_tile, best_tile;
|
||||
TileIndex bridge_end_tile;
|
||||
Player *player;
|
||||
} AiRoadFinder;
|
||||
};
|
||||
|
||||
typedef struct AiRoadEnum {
|
||||
struct AiRoadEnum {
|
||||
TileIndex dest;
|
||||
TileIndex best_tile;
|
||||
int best_track;
|
||||
uint best_dist;
|
||||
} AiRoadEnum;
|
||||
};
|
||||
|
||||
static const byte _dir_by_track[] = {
|
||||
0, 1, 0, 1, 2, 1,
|
||||
|
@@ -372,9 +372,9 @@ static void AyStar_AiPathFinder_GetNeighbours(AyStar *aystar, OpenListNode *curr
|
||||
extern uint GetRailFoundation(Slope tileh, TrackBits bits); // XXX function declaration in .c
|
||||
extern uint GetRoadFoundation(Slope tileh, RoadBits bits); // XXX function declaration in .c
|
||||
extern uint GetBridgeFoundation(Slope tileh, Axis); // XXX function declaration in .c
|
||||
typedef enum BridgeFoundations{
|
||||
enum BridgeFoundation {
|
||||
BRIDGE_NO_FOUNDATION = 1 << 0 | 1 << 3 | 1 << 6 | 1 << 9 | 1 << 12,
|
||||
} BridgeFoundation;
|
||||
};
|
||||
|
||||
// The most important function: it calculates the g-value
|
||||
static int32 AyStar_AiPathFinder_CalculateG(AyStar *aystar, AyStarNode *current, OpenListNode *parent)
|
||||
|
Reference in New Issue
Block a user