src/ai/api/ai_airport.hpp
author rubidium
Sun, 15 Jul 2007 16:39:11 +0000
branchnoai
changeset 9668 6fe3d2cb9655
parent 9654 b836eb5c521f
child 9669 366771e15a2c
permissions -rw-r--r--
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
9654
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
     1
/* $Id$ */
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
     2
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
     3
/** @file ai_airport.hpp Everything to query and build airports */
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
     4
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
     5
#ifndef AI_AIRPORT_HPP
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
     6
#define AI_AIRPORT_HPP
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
     7
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
     8
#include "ai_object.hpp"
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
     9
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    10
/**
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    11
 * Class that handles all airport related functions.
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    12
 */
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    13
class AIAirport : public AIObject {
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    14
public:
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    15
	enum AirportType {
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    16
		AT_SMALL         =   0,
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    17
		AT_LARGE         =   1,
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    18
		AT_HELIPORT      =   2,
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    19
		AT_METROPOLITAN  =   3,
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    20
		AT_INTERNATIONAL =   4,
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    21
		AT_COMMUTER      =   5,
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    22
		AT_HELIDEPOT     =   6,
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    23
		AT_INTERCON      =   7,
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    24
		AT_HELISTATION   =   8,
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    25
	};
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    26
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    27
	/**
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    28
	 * The name of the class, needed by several sub-processes.
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    29
	 */
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    30
	static const char *GetClassName() { return "AIAirport"; }
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    31
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    32
	/**
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    33
	 * Checks whether the given tile is actually a tile with a hangar.
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    34
	 * @param tile the tile to check.
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    35
	 * @pre tile is always positive and smaller than AIMap::GetMapSize().
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    36
	 * @return true if and only if the tile has a hangar.
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    37
	 */
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    38
	bool IsHangarTile(TileIndex tile);
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    39
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    40
	/**
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    41
	 * Checks whether the given tile is actually a tile with a airport.
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    42
	 * @param tile the tile to check.
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    43
	 * @pre tile is always positive and smaller than AIMap::GetMapSize().
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    44
	 * @return true if and only if the tile has a airport.
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    45
	 */
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    46
	bool IsAirportTile(TileIndex tile);
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    47
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    48
	/**
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    49
	 * Check if a certain airport type is already available.
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    50
	 * @param type the type of airport to check.
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    51
	 */
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    52
	bool AiportAvailable(AirportType type);
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    53
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    54
	/**
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    55
	 * Builds a airport with tile at the topleft corner.
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    56
	 * @param tile the topleft corner of the airport.
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    57
	 * @param type the type of airport to build.
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    58
	 * @pre tile is always positive and smaller than AIMap::GetMapSize().
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    59
	 * @return whether the airport has been/can be build or not.
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    60
	 */
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    61
	bool BuildAirport(TileIndex tile, AirportType type);
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    62
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    63
	/**
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    64
	 * Removes a airport.
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    65
	 * @param tile any tile of the airport.
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    66
	 * @pre tile is always positive and smaller than AIMap::GetMapSize().
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    67
	 * @return whether the airport has been/can be removed or not.
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    68
	 */
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    69
	bool RemoveAirport(TileIndex tile);
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    70
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    71
	/**
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    72
	 * Get the first hanger tile of the airport.
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    73
	 * @param tile any tile of the airport.
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    74
	 * @pre tile is always positive and smaller than AIMap::GetMapSize().
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    75
	 * @return the first hanger tile of the airport.
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    76
	 */
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    77
	TileIndex GetHangarOfAirport(TileIndex tile);
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    78
};
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    79
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    80
#endif /* AI_AIRPORT_HPP */