Ejemplo n.º 1
0
 public Building(InventoryItem.Factory inventoryFactory)
 {
     _inventoryFactory = inventoryFactory;
     CurrentFloor      = 0;
     Floors            = ImmutableList.CreateRange(new List <Floor>(4)
     {
         new Floor(1),
         new Floor(2),
         new Floor(3),
         new Floor(4)
     });
 }
Ejemplo n.º 2
0
        public LightBuilding(InventoryItem.Factory inventoryFactory, int currentFloor, List <Floor> floors)
        {
            _inventoryFactory = inventoryFactory;
            _state            = new int[inventoryFactory.Count() + 1];
            SetFloor(currentFloor);

            foreach (var floor in floors)
            {
                foreach (var item in floor.Inventory)
                {
                    _state[inventoryFactory.PositionOf(item)] = floor.Number - 1;
                }
            }
        }
Ejemplo n.º 3
0
 public LightCommand(InventoryItem.Factory inventoryFactory, Direction direction, int[] indexedInventory)
 {
     _inventoryFactory = inventoryFactory;
     Direction         = direction;
     IndexedInventory  = indexedInventory;
 }
Ejemplo n.º 4
0
 public Building(InventoryItem.Factory inventoryFactory, int currentFloor, List <Floor> floors)
 {
     _inventoryFactory = inventoryFactory;
     CurrentFloor      = currentFloor;
     Floors            = ImmutableList.CreateRange(floors);
 }
Ejemplo n.º 5
0
 public LightBuilding(InventoryItem.Factory inventoryFactory, int[] state)
 {
     _inventoryFactory = inventoryFactory;
     _state            = state;
 }
Ejemplo n.º 6
0
 public Command(InventoryItem.Factory inventoryFactory, Direction direction, IEnumerable <InventoryItem> inventory)
 {
     _inventoryFactory = inventoryFactory;
     Direction         = direction;
     Inventory         = inventory;
 }