public override TaskState Process() { //Model.Entities.IPlayable drawedCard = Generic.Draw(Controller); bool nullFlag = false; var cards = new IPlayable[_count]; for (int i = 0; i < _count; i++) { IPlayable draw = Generic.Draw(Controller); if (draw == null) { nullFlag = true; } cards[i] = draw; } if (cards[0] == null) { return(TaskState.COMPLETE); } if (_toStack) { if (nullFlag) { Playables.AddRange(cards.Where(p => p != null)); } else { Playables.AddRange(cards); } } return(TaskState.COMPLETE); }
public override TaskState Process() { if (AddFlag) { Playables.AddRange(RemoveEntities(GetEntites(IncludeType, Controller, Source, Target, Playables), ExcludeTypeArray)); } else { Playables = RemoveEntities(GetEntites(IncludeType, Controller, Source, Target, Playables), ExcludeTypeArray); } return(TaskState.COMPLETE); }