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