public void LayerAssembler_AssembleSimpleLayerWithRoomOffset_LayerCorrect() { var instructions = LayerInstruction.FromStrings(CreateLines("Layer:Size=(5,5)", "Room:(2,2)", "Floor:(1,1)")); var layer = LayerBuilder.Assemble(instructions); Assert.AreEqual("Floor", layer[3, 3].Ground.Type); }
public void LayerAssembler_AssembleSimpleLayerWithObjectLink_LayerCorrect() { var instructions = LayerInstruction.FromStrings(CreateLines("Layer:Size=(3,3)", "Room: (0,0)", "Table:(1,1)", "Table:(1,2)", "Link:(Table,1,1)-(Table,1,2)")); var layer = LayerBuilder.Assemble(instructions); Assert.AreEqual(1, layer[1, 1].LowerObject.LinkedObjs.Count); Assert.AreEqual(1, layer[1, 2].LowerObject.LinkedObjs.Count); }
public FacilityMap(IWorld world, MapInstruction inst) { _world = world; inst.Layers.ForEach(x => Add(LayerBuilder.Assemble(x))); inst.Portals.ForEach(x => this[x.Location].Put(PortalFactory.Create(x))); }