/// Adds a specified Marker to the tile. /// </summary> /// <param name="type">The type of Marker to add.</param> public void AddMarker(IMarker marker) { if ((!markers.Any() && defaultTerrainType.Equals(TerrainType.Blocking)) || markers.Any() && markers.Peek().GetTerrainType.Equals(TerrainType.Blocking)) { if (!marker.GetType().Equals(typeof(ClearMarker)) && !marker.GetType().Equals(typeof(DebrisMarker))) { throw new InvalidOperationException("A " + marker.GetName() + " marker cannot be placed on Blocking terrain."); } } markers.Push(marker); }