Beispiel #1
0
        /// <summary>
        /// Füge dem Szenario eine Stoßzeit hinzu.
        /// </summary>
        /// <param name="rushhour">Die hinzuzufügende Stoßzeit.</param>
        /// <returns>Wahrheitswert entsprechend ob das Hinzufügen erfolgreich war oder nicht.</returns>
        public bool addRushhour(Rushhour rushhour)
        {
            if (rushhours.Contains(rushhour))
            {
                return(false);
            }

            rushhours.Add(rushhour);
            return(rushhours.Contains(rushhour));
        }
Beispiel #2
0
        /// <summary>
        /// Entferne eine Stoßzeit aus dem Szenario.
        /// </summary>
        /// <param name="rushhour">Die zu entfernende Stoßzeit.</param>
        /// <returns>Wahrheitswert entsprechend ob das Entfernen erfolgreich war oder nicht.</returns>
        public bool deleteRushhour(Rushhour rushhour)
        {
            if (!rushhours.Contains(rushhour))
            {
                return(false);
            }

            rushhours.Remove(rushhour);
            return(!rushhours.Contains(rushhour));
        }