}
-const Tile &Area::TileAt(const geometry::Vector<int> &offset) const {
+const Tile *Area::TileAt(const geometry::Vector<int> &offset) const {
int tileIndex(offset.Y() * width + offset.X());
if (tileIndex < numTiles) {
- return tiles[tileIndex];
+ return tiles +tileIndex;
} else {
- throw std::out_of_range("tile index out of range");
+ return 0;
}
}