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); }
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); }