You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
OpenTTD-patches/src/depot_base.h

31 lines
688 B
C

/* $Id$ */
/** @file depot_base.h Base for all depots (except hangars) */
#ifndef DEPOT_BASE_H
#define DEPOT_BASE_H
#include "tile_type.h"
#include "depot_type.h"
#include "oldpool.h"
#include "town_type.h"
DECLARE_OLD_POOL(Depot, Depot, 3, 8000)
struct Depot : PoolItem<Depot, DepotID, &_Depot_pool> {
TileIndex xy;
TownID town_index;
Depot(TileIndex xy = INVALID_TILE) : xy(xy) {}
~Depot();
inline bool IsValid() const { return this->xy != INVALID_TILE; }
};
Depot *GetDepotByTile(TileIndex tile);
#define FOR_ALL_DEPOTS_FROM(var, start) FOR_ALL_ITEMS_FROM(Depot, depot_index, var, start)
#define FOR_ALL_DEPOTS(var) FOR_ALL_DEPOTS_FROM(var, 0)
#endif /* DEPOT_BASE_H */