using CommonBase;
|
using Newtonsoft.Json.Serialization;
|
using Newtonsoft.Json;
|
using System;
|
using System.Collections.Generic;
|
using System.ComponentModel;
|
using System.Drawing;
|
using System.Linq;
|
using System.Reflection;
|
using System.Text;
|
using System.Threading.Tasks;
|
|
namespace Hydro.MapView
|
{
|
[Serializable]
|
public class TRegion
|
{
|
public string Name { get; set; } = "新分区";
|
public List<Floor> Floors { get; set; } = new List<Floor>();
|
public bool isDirectionUp { get; set; } = true;
|
public string JoinNode { get; set; } = null;
|
|
public override string ToString()
|
{
|
return Name;
|
}
|
|
}
|
|
[Serializable]
|
public class Floor
|
{
|
public int FloorIndex = 1;
|
public string BackgroundImg = null;
|
public float Elev = 0;
|
public MapDimensions MapView { get; set; } = null;
|
|
public string Name => $"{FloorIndex}楼";
|
public Floor()
|
{
|
|
}
|
public string TemplateID { get; set; } = null;
|
|
[JsonIgnore]
|
public Template template { get { return TemplateList.GetTemplate(TemplateID); } }
|
|
public Floor(Floor other)
|
{
|
// 进行属性的深拷贝赋值
|
this.FloorIndex = other.FloorIndex;
|
this.BackgroundImg = other.BackgroundImg;
|
this.Elev = other.Elev;
|
this.MapView = (other.MapView != null) ? other.MapView.DeepCopyByBin<MapDimensions>() : null;
|
}
|
public Floor(int floorIndex, string tempID, float floorElevation, MapDimensions otherInfo)
|
{
|
FloorIndex = floorIndex;
|
TemplateID = tempID;
|
Elev = floorElevation;
|
MapView = otherInfo;
|
}
|
|
|
}
|
|
|
}
|