using System; using System.Collections.Generic; using System.Linq; using System.Text; using UnityEngine; namespace TransportGame.Model { public class Map { private float[,] grid; /// /// Gets or sets the water level /// public float WaterLevel { get; set; } /// /// Gets or sets the biome /// public Biome Biome { get; set; } /// /// Gets the heights array /// public float[,] Heights { get { return grid; } } /// /// Initializes the map /// /// /// public Map(int width, int height) { grid = new float[width, height]; } /// /// Gets or sets the cell at specified position /// /// X /// Y /// Cell public float this[int x, int y] { get { return grid[x, y]; } set { grid[x, y] = value; } } /// /// Gets width of map /// public int Width { get { return grid.GetLength(0); } } /// /// Gets height of map /// public int Height { get { return grid.GetLength(1); } } /// /// Returns true if specified cell is a water cell /// /// X /// Y /// public bool IsWater(int x, int y) { return grid[x, y] <= WaterLevel; } } }