CardsAgainstIRC3.Game.States.Base.DeckRemoveCommand C# (CSharp) Method

DeckRemoveCommand() private method

private DeckRemoveCommand ( CommandContext context, IEnumerable arguments ) : void
context CommandContext
arguments IEnumerable
return void
        public void DeckRemoveCommand(CommandContext context, IEnumerable<string> arguments)
        {
            if (arguments.Count() == 0)
            {
                SendInContext(context, "Usage: !deck.remove num [num2...]");
                return;
            }

            try
            {
                var toremove = arguments.Select(a => Manager.CardSets[int.Parse(a)]);
                Manager.CardSets.RemoveAll(a => toremove.Contains(a));
                Manager.SendPublic(context.Nick, "Removed card sets!");
            }
            catch (Exception e)
            {
                SendInContext(context, "Failed to remove {0} card sets!", arguments.Count());
                Console.WriteLine(e);
            }
        }