Example #1
0
 public StandardSelectStrategy(Option option, OnSelect onSelect, AfterSelect afterSelect = null)
 {
     _option = option;
     _onSelect = onSelect;
     if (afterSelect == null)
         afterSelect = () => { };
     _afterSelect = afterSelect;
 }
Example #2
0
        private void SetSelectCharacterStrategy()
        {
            var option = new Option
            {
                Type = OptionType.Select,
                Message = "Please select a character",
                Choices = _characterPile.Select(c => c.Name),
                Amount = 1
            };
            OnSelect = new StandardSelectStrategy(option, SelectCharacter, PossibleNextStep);

            PropertyChanged(PropertyChange.PlayerInTurn);
        }
Example #3
0
 protected override void UseUnusedAbility(Player owner, AbilityInfo info, Game game)
 {
     if (info.Target != null) //swap with player
     {
         owner.SwapHand(game.GetPlayerByUsername(info.Target));
     }
     else
     {
         var option = new Option
         {
             Message = "Discard any number of cards and draw an equal number of cards.",
             Choices = owner.Hand.Select(c => c.Title)
         };
         game.OnSelect = new StandardSelectStrategy(option, game.SwapWithPile);
     }
 }
Example #4
0
        public void DrawDistricts(string pid)
        {
            CheckOption(pid, OptionType.TakeAction);

            var choices = new List<District>();
            for (var i = 0; i < 2; i++)
                choices.Add(_pile.Pop());

            var option = new Option
            {
                Message = "Select a district and discard the other",
                Choices = choices.Select(c => c.Title),
                Amount = 1
            };

            Turn = Data.Turn.BuildADistrict;
            OnSelect = new StandardSelectStrategy(option, SelectDistrict);
        }