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 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 Attack(int player, int from, State.Province to, State.Army army) : base(player, from, to, army) { }
public abstract (IAction[], State.Province) Perform(State.Province province, State.Player active);
public Reinforce(int player, int from, State.Province to, State.Army army) : base(player, from, to, army) { }