Example #1
0
        public string PickUpItem(string[] args)
        {
            string characterName = args[0];
            var    character     = party.FirstOrDefault(x => x.Name == characterName);

            Validate.ValidateCharacter(character, characterName);

            if (itemPool.Count == 0)
            {
                throw new InvalidOperationException(OutputMessages.EmptyPool());
            }

            character.ReceiveItem(itemPool.Peek());
            return(string.Format(OutputMessages.PickedUpItem(), characterName, itemPool.Pop()));
        }