Example #1
0
        private Station CreateStation(char type, string name)
        {
            Station station;

            switch (type)
            {
            case 'P':
                station = new ContainerLoader();
                break;

            case 'C':
                station = new PalletisationStation();
                break;

            case 'D':
                station = new ParticulateDispenser();
                foreach (IngredientType ingredient in Enum.GetValues(typeof(IngredientType)))
                {
                    (station as ParticulateDispenser).SetStoredAmount(ingredient, Model.InitialIngredientAmount);
                }
                break;

            default:
                throw new InvalidDataException($"invalid type: {type}");
            }

            _stations.Add(station);
            if (name != null)
            {
                _namedStations.Add(name, station);
            }

            return(station);
        }
Example #2
0
		private Station CreateStation(char type, string name)
		{
			Station station;
			switch (type)
			{
				case 'P':
					station = new ContainerLoader();
					break;
				case 'C':
					station = new PalletisationStation();
					break;
				case 'D':
					station = new ParticulateDispenser();
					foreach (IngredientType ingredient in Enum.GetValues(typeof(IngredientType)))
					{
						(station as ParticulateDispenser).SetStoredAmount(ingredient, Model.InitialIngredientAmount);
					}
					break;
				default:
					throw new InvalidDataException($"invalid type: {type}");
			}

			_stations.Add(station);
			if (name != null)
				_namedStations.Add(name, station);

			return station;
		}