/// <summary> /// Executes the bake action for the player /// </summary> /// <param name="player"></param> /// <param name="data"></param> public override GameAction OnExecute(AgricolaPlayer player, Data.GameActionData data) { var bakeData = ImmutableArray.Create(((BakeActionData)data).BakeData); if (bakeData != null && bakeData.Length > 0) { ActionService.Bake(player, eventTriggers, ResultingNotices, bakeData); } return(this); }
public override GameAction OnExecute(AgricolaPlayer player, Data.GameActionData data) { base.OnExecute(player, data); var sowData = ImmutableArray.Create(((SowAndBakeActionData)data).Sow); var bakeData = ImmutableArray.Create(((SowAndBakeActionData)data).BakeData); ActionService.Sow(player, sowData, ResultingNotices); ActionService.Bake(player, eventTriggers, ResultingNotices, bakeData); return(this); }
public override GameAction OnExecute(AgricolaPlayer player, Data.GameActionData data) { base.OnExecute(player, data); var bake = ((BuildStableAndBakeActionData)data).BakeData.ToImmutableArray(); var stables = ((BuildStableAndBakeActionData)data).StableData.ToImmutableArray(); if (bake != null && bake.Length > 0) { ActionService.Bake(player, eventTriggers, ResultingNotices, bake); } if (stables != null && stables.Length > 0) { ActionService.BuildStables(player, stables, Id, ResultingNotices); } return(this); }