internal Car(double startingFloor, Shaft shaft, char designation) { CurrentFloor = startingFloor; CurrentDirection = Direction.Null; Shaft = shaft; Designation = designation; Door = new Door(this); }
/// <summary> /// Constructs a bank of elevators /// </summary> /// <remarks>Assumes that each elevator can stop on each floor</remarks> public void Initialize(int shaftCount, int floorsPerShaft) { Cars = new List <Car>(shaftCount); Shafts = new List <Shaft>(shaftCount); var allFloors = new int[floorsPerShaft]; for (int i = 0; i < floorsPerShaft; i++) { allFloors[i] = i; } for (int i = 0; i < shaftCount; i++) { var shaft = new Shaft(allFloors, (char)(i + 65), Controller); Shafts.Add(shaft); Cars.Add(shaft.Car); } }
internal Motor(Shaft shaft) { Shaft = shaft; }