tilearea_type.h

Go to the documentation of this file.
00001 /* $Id: tilearea_type.h 18726 2010-01-04 21:10:20Z rubidium $ */
00002 
00003 /*
00004  * This file is part of OpenTTD.
00005  * 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.
00006  * 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.
00007  * 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/>.
00008  */
00009 
00012 #ifndef TILEAREA_TYPE_H
00013 #define TILEAREA_TYPE_H
00014 
00015 #include "tile_type.h"
00016 
00018 struct TileArea {
00020   TileArea() {}
00021 
00028   TileArea(TileIndex tile, uint8 w, uint8 h) : tile(tile), w(w), h(h) {}
00029 
00035   TileArea(TileIndex start, TileIndex end);
00036 
00037   TileIndex tile; 
00038   uint8 w;        
00039   uint8 h;        
00040 
00045   void Add(TileIndex to_add);
00046 
00050   void Clear()
00051   {
00052     this->tile = INVALID_TILE;
00053     this->w    = 0;
00054     this->h    = 0;
00055   }
00056 
00062   bool Intersects(const TileArea &ta) const;
00063 };
00064 
00065 #endif /* TILEAREA_TYPE_H */

Generated on Wed Jan 20 23:38:41 2010 for OpenTTD by  doxygen 1.5.6