private void AddPortals(LayerBuilder builder)
 {
     for (var row = 0; row < 3; row++)
     {
         for (var column = 0; column < 3; column++)
         {
             builder.Put(column, row, new FacilityPortal {
                 ObjectLayer = ObjectLayer.LowerObject, Endpoint1 = SpecialLocation.OffOfMap, Endpoint2 = new XYZ(column, row, 0)
             });
         }
     }
 }
예제 #2
0
        public void LayerAssembler_PutObjectFromInstruction_LayerCorrect()
        {
            var inst    = ObjectInstruction.FromString("Floor:(1,1,R)");
            var builder = new LayerBuilder(3, 3);

            builder.Put(inst[0]);

            var layer = builder.Build();

            Assert.AreEqual("Floor", layer[1, 1].Ground.Type);
            Assert.AreEqual(Orientation.Right, layer[1, 1].Ground.Orientation);
        }
예제 #3
0
        public void LayerBuilder_PutUpperObject_ObjectPutCorrectly()
        {
            var builder  = new LayerBuilder(3, 3);
            var painting = new FacilityObject {
                Type = "Painting", Orientation = Orientation.Right, ObjectLayer = ObjectLayer.UpperObject
            };

            builder.PutFloor(1, 1);
            builder.Put(0, 1, painting);
            var layer = builder.Build();

            Assert.IsTrue(layer[0, 1].Contains(painting));
            Assert.AreEqual(painting, layer[0, 1].UpperObject);
        }
예제 #4
0
        public void LayerBuilder_PutLowerObject_ObjectPutCorrectly()
        {
            var builder = new LayerBuilder(3, 3);
            var cash    = new FacilityObject {
                Type = "Cash", Orientation = Orientation.Up, ObjectLayer = ObjectLayer.LowerObject
            };

            builder.PutFloor(1, 1);
            builder.Put(1, 1, cash);
            var layer = builder.Build();

            Assert.IsTrue(layer[1, 1].Contains(cash));
            Assert.AreEqual(cash, layer[1, 1].LowerObject);
        }