Пример #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)
     });
 }
Пример #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;
                }
            }
        }
Пример #3
0
 public LightCommand(InventoryItem.Factory inventoryFactory, Direction direction, int[] indexedInventory)
 {
     _inventoryFactory = inventoryFactory;
     Direction         = direction;
     IndexedInventory  = indexedInventory;
 }
Пример #4
0
 public Building(InventoryItem.Factory inventoryFactory, int currentFloor, List <Floor> floors)
 {
     _inventoryFactory = inventoryFactory;
     CurrentFloor      = currentFloor;
     Floors            = ImmutableList.CreateRange(floors);
 }
Пример #5
0
 public LightBuilding(InventoryItem.Factory inventoryFactory, int[] state)
 {
     _inventoryFactory = inventoryFactory;
     _state            = state;
 }
Пример #6
0
 public Command(InventoryItem.Factory inventoryFactory, Direction direction, IEnumerable <InventoryItem> inventory)
 {
     _inventoryFactory = inventoryFactory;
     Direction         = direction;
     Inventory         = inventory;
 }