Esempio n. 1
0
 internal void PlaceBeeper(Beeper beeper)
 {
     if (!_beepers.Contains(beeper))
     {
         _beepers.Add(beeper);
     }
 }
Esempio n. 2
0
        /// <Summary>
        ///  Take a beeper from the robot's bag and place it in the world at the robot's current location.
        ///  If there is no beeper in the robot's bag, the robot will be destroyed.
        /// </Summary>
        public void PutBeeper()
        {
            ConfirmOnThen(() =>
            {
                if (beeperCount < 1)
                {
                    throw new RobotDestructionException("Bag is empty");
                }
                var beeper = new Beeper(Street, Avenue);

                _world.PlaceBeeper(beeper);
            });
        }