public override (IAction[], State.Province) Perform(State.Province province, State.Player active) { if (Province == province.Id) { var(attacked, actions) = province.AttackedBy(Army); return(actions, attacked); } return(new[] { this }, province); }
public (IAction[], State.Province) Perform(State.Province province, State.Player active) { if (province.Occupied && province is State.Land Land && Land.IsControlledBy(active.Id) && rand.NextDouble() < Land.Instability) { var(land, actions) = Land.Revolt(); return(actions.Concat(this), land); } return(new[] { this }, province); }
public (IAction[], State.Province) Perform(State.Province province, State.Player active) { if (active.Id == Debtor && province is State.Land land && land.IsControlledBy(Debtor) && Debt > settings.DebtLimit + active.Money) { var(new_province, actions) = land.Revolt(); return(land.Price > Debt ? actions : actions.Concat(new Loan(Debtor, Debt - land.Price, settings)), new_province); } return(new[] { this }, province); }
public (IAction[], State.Province) Perform(State.Province province, State.Player active) { if (province is State.Land land && land.IsControlledBy(Player) && Amount > 0) { var(new_province, actions) = land.Revolt(); return(Amount <= land.Price ? actions : actions.Concat(new Seizure(Player, Amount - land.Price)), new_province); } return(new[] { this }, province); }
public (IAction[], State.Player) Perform(State.Player player, State.Player active, State.IProvinces provinces) { if (player == active && player.Id == Debtor) { if (Debt > settings.DebtLimit) { return(Array.Empty <IAction>(), player.Pay(player.Money)); } return(new[] { new Loan(Debtor, (int)Math.Ceiling(Debt * (1 + settings.Interest)), settings) }, player); } return(new[] { this }, player); }
public override (IAction[], State.Province) Perform(State.Province province, State.Player active) { return(Province == province.Id ? (System.Array.Empty <IAction>(), province.ReinforcedBy(Army)) : (new[] { this }, province)); }
public (IAction[], State.Player) Perform(State.Player player, State.Player active, State.IProvinces provinces) { return(player.Id == Player ? (System.Array.Empty <IAction>(), player.ChangeIncome(Change)) : (new[] { this }, player)); }
public (IAction[], State.Player) Perform(State.Player player, State.IProvinces provinces) { return(player.Id == Player ? (new[] { new Actions.Loan(Player, Amount, settings) }, player.GainMoney(Amount)) : (System.Array.Empty <IAction>(), player)); }
public (IAction[], State.Player) Perform(State.Player player, State.IProvinces provinces) { return(System.Array.Empty <IAction>(), player.Id == Player ? player.Pay(Amount) : player.Id == Recipient ? player.GainMoney(Amount) : player); }
public abstract (IAction[], State.Province) Perform(State.Province province, State.Player active);
public (IAction[], State.Player) Perform(State.Player player, State.IProvinces provinces) { return(player.Id == Player ? (new[] { new Actions.Reinforcement(Land, Army) }, player.Pay(Army.Soldiers.Price)) : (System.Array.Empty <IAction>(), player)); }
public (IAction[], State.Player) Perform(State.Player player, State.Player active, State.IProvinces provinces) { return(new[] { this }, player == active ? player.Earn() : player); }
public (IAction[], State.Player) Perform(State.Player player, State.IProvinces provinces) { return(System.Array.Empty <IAction>(), player.Id == Debtor ? player.Pay(Amount) : player); }