using Newtonsoft.Json;
|
using System;
|
using System.Collections.Generic;
|
using System.Configuration;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
|
namespace SimuTools.Domain
|
{
|
public class Terrain
|
{
|
public List<int[]> size { set; get; }
|
|
[JsonIgnore]
|
public double minHeight { set; get; }
|
|
[JsonIgnore]
|
public double maxHeight { set; get; }
|
|
public Terrain()
|
{
|
this.size = new List<int[]>();
|
|
string str = ConfigurationManager.AppSettings["sizes"];
|
if (string.IsNullOrEmpty(str)) return;
|
|
string[] strs = str.Split(',');
|
foreach (string s in strs)
|
{
|
int i;
|
if (int.TryParse(s, out i))
|
{
|
this.size.Add(new int[] { i, i });
|
}
|
}
|
}
|
|
public Terrain(List<int[]> size)
|
{
|
this.size = size;
|
}
|
|
public void SetHeight(double minHeight, double maxHeight)
|
{
|
this.minHeight = minHeight;
|
this.maxHeight = maxHeight;
|
}
|
}
|
}
|