예제 #1
0
        public override GameAction OnExecute(AgricolaPlayer player, Data.GameActionData data)
        {
            base.OnExecute(player, data);

            player.AddFamilyMember();
            AddUser(player);    // Add the baby to the action display

            ResultingNotices.Add(new GameActionNotice(player.Name, NoticeVerb.GrowFamily.ToString()));

            if (mode == FamilyGrowthActionMode.Improvement && ((FamilyGrowthActionData)data).ImprovementData != null)
            {
                ActionService.BuyImprovement(player, ((FamilyGrowthActionData)data).ImprovementData, ResultingNotices);
            }

            return(this);
        }
예제 #2
0
        public override GameAction OnExecute(AgricolaPlayer player, Data.GameActionData data)
        {
            base.OnExecute(player, data);

            var occupationData = (OccupationActionData)data;

            if (occupationData.FamilyGrowth)
            {
                player.AddFamilyMember();
                AddUser(player);    // Add the baby to the action display

                ResultingNotices.Add(new GameActionNotice(player.Name, NoticeVerb.GrowFamily.ToString()));
            }
            else
            {
                var triggers = new List <GameEventTrigger>();
                triggers.AddRange(eventTriggers);
                triggers.Add(new TakeOccupationActionTrigger());
                ActionService.PlayOccupation(player, ImmutableList.Create <GameEventTrigger>(triggers.ToArray()), ResultingNotices, occupationData);
            }
            return(this);
        }