qinjie
2023-12-19 15d15d24fbccb9b70a305b46b71453b2ab1a720e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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;
        }
 
 
    }
    
 
}