Example #1
0
        public void ExecuteMission(INamedTarget target)
        {
            Report($"Mission on elimination of {target.Name} initiated...");
            Agent theAgent = new Agent();

            ILoadableWeapon theGun = _director.PickWeapon();

            _director.LoadWeapon(theGun, new AmmoFactory());

            Report("Preparing agent for mission...");
            theAgent.PrepareForMission(theGun, target);

            Report("Agent is now executing mission...");
            theAgent.Execute();

            _missionStatus = theAgent.Debrief();

            if (_missionStatus == MissionStatus.Success)
            {
                Report("Mission was successful, thanks to our perfect planning!!");
            }
            else
            {
                Report("Mission failed... Agent will be held responsible");
            }
        }
Example #2
0
        public void LoadWeapon(ILoadableWeapon aGun, IAmmoFactory aFactory)
        {
            for (int i = 0; i < 10; i++)
            {
                aGun.LoadAmmo(aFactory.Create());
            }

            Report("Loaded agent's weapon for mission...");
        }