예제 #1
0
 public StandardSelectStrategy(Option option, OnSelect onSelect, AfterSelect afterSelect = null)
 {
     _option = option;
     _onSelect = onSelect;
     if (afterSelect == null)
         afterSelect = () => { };
     _afterSelect = afterSelect;
 }
예제 #2
0
파일: Game.cs 프로젝트: afkpost/HotCit
        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);
        }
예제 #3
0
파일: Abilities.cs 프로젝트: afkpost/HotCit
 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);
     }
 }
예제 #4
0
파일: Game.cs 프로젝트: afkpost/HotCit
        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);
        }