Beispiel #1
0
        public void Test()
        {
            Map <RectCoord> map = CreateMap();
            MapChangeRecorder <RectCoord> mapChangeRecorder = new MapChangeRecorder <RectCoord>();

            map.Subscribe(mapChangeRecorder);

            map.Add(new RectCoord(1, 1), new MapNode()
            {
                Landform = new NodeLandformInfo()
                {
                    TypeID = "111",
                    Angle  = 111,
                },
            });

            map.Remove(new RectCoord(0, 0));

            map[new RectCoord(1, 1)] = new MapNode()
            {
                Landform = new NodeLandformInfo()
                {
                    TypeID = "11",
                    Angle  = 11,
                },
            };

            var archiveMap = mapChangeRecorder.GetArchiveMap(map);

            Map <RectCoord> map2 = CreateMap();

            MapChangeRecorder <RectCoord> .AddArchived(map2, archiveMap);

            Contrast.AreSame <RectCoord, MapNode>(map, map2);
        }
Beispiel #2
0
 private void AreEqual(IReadOnlyList <Texture2D> t1, IReadOnlyList <Texture2D> t2)
 {
     Contrast.AreSame(t1, t2, (v1, v2) => v1.width == v2.width && v1.height == v2.height);
 }