mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-08 23:19:40 +00:00
- Fix: One could not level the whole map anymore at once (r19392) - Fix: Only show the 'No AIs available' error message when explicitly changing the number of AI opponents [FS3676] (r19389) - Fix: [NoAI] When reloading a savegame, an AI failing to compile could trigger (trying) to read the not yet loaded information of another AI via the AI Debug window and its "open with the most recently used AI" feature [FS#3666] (r19388) - Fix: Close all orders windows when switching companies [FS#3671] (r19387) - Fix: [IPv6] Netmask calculations were wrong if cidr >= 32 [FS#3684] (r19385) - Fix: Overbuilding bridges, rail stations did not properly update PBS reservation [FS#3680] (r19384, r19383)
55 lines
1.5 KiB
C
55 lines
1.5 KiB
C
/* $Id$ */
|
|
|
|
/*
|
|
* This file is part of OpenTTD.
|
|
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
|
|
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
/** @file tilearea_type.h Type for storing the 'area' of something uses on the map. */
|
|
|
|
#ifndef TILEAREA_TYPE_H
|
|
#define TILEAREA_TYPE_H
|
|
|
|
#include "tile_type.h"
|
|
|
|
/** Represents the covered area of e.g. a rail station */
|
|
struct TileArea {
|
|
TileIndex tile; ///< The base tile of the area
|
|
uint16 w; ///< The width of the area
|
|
uint16 h; ///< The height of the area
|
|
|
|
/** Just construct this tile area */
|
|
TileArea() {}
|
|
|
|
/**
|
|
* Construct this tile area with some set values
|
|
* @param tile the base tile
|
|
* @param w the width
|
|
* @param h the height
|
|
*/
|
|
TileArea(TileIndex tile, uint8 w, uint8 h) : tile(tile), w(w), h(h) {}
|
|
|
|
TileArea(TileIndex start, TileIndex end);
|
|
|
|
|
|
void Add(TileIndex to_add);
|
|
|
|
/**
|
|
* Clears the 'tile area', i.e. make the tile invalid.
|
|
*/
|
|
void Clear()
|
|
{
|
|
this->tile = INVALID_TILE;
|
|
this->w = 0;
|
|
this->h = 0;
|
|
}
|
|
|
|
bool Intersects(const TileArea &ta) const;
|
|
|
|
void ClampToMap();
|
|
};
|
|
|
|
#endif /* TILEAREA_TYPE_H */
|