From ee3a17fd13b0fb12f013b950550612e70db4f437 Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Tue, 24 Oct 2017 10:45:40 +0100 Subject: [PATCH] Make method const --- src/gamelib/worldgrid.cpp | 2 +- src/gamelib/worldgrid.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gamelib/worldgrid.cpp b/src/gamelib/worldgrid.cpp index 9a57b92..72cce67 100644 --- a/src/gamelib/worldgrid.cpp +++ b/src/gamelib/worldgrid.cpp @@ -123,7 +123,7 @@ namespace curry { std::copy(parProperties.begin(), parProperties.end(), m_tile_properties.begin()); } - const TileProperty& WorldGrid::tile_property (const TileIndex* parIndex) { + const TileProperty& WorldGrid::tile_property (const TileIndex* parIndex) const { assert(parIndex); assert(static_cast(*parIndex) < m_tile_properties.size()); return m_tile_properties[static_cast(*parIndex)]; diff --git a/src/gamelib/worldgrid.hpp b/src/gamelib/worldgrid.hpp index ae5d371..7f2b5f4 100644 --- a/src/gamelib/worldgrid.hpp +++ b/src/gamelib/worldgrid.hpp @@ -42,7 +42,7 @@ namespace curry { void add_layer (vec2us parWorldSize, const std::vector& parLayer); void set_layers (vec2us parWorldSize, const std::vector>& parLayers); void set_tile_properties (const std::vector& parProperties); - const TileProperty& tile_property (const TileIndex* parIndex); + const TileProperty& tile_property (const TileIndex* parIndex) const; void unload_layers(); WorldSizeWatcherTicket register_observer (WorldSizeNotifiable* parWatcher); void unregister_observer (WorldSizeWatcherTicket parTicket);