public virtual Decision CanExecute() { var decision = Decision.True(); if (!this.Player.CanAfford(this.ActionCost.Resources)) { decision = Decision.False(Exceptions.CannotAfford); } return(decision); }
public Decision CanExecute() { var decision = Decision.True(); if (this.Used) { decision = Decision.False("Already Used"); } return(decision); }
public override Decision CanExecute() { var decision = Decision.True(); if (Cost.Comparer.Equals(this.Player.Race.SpadeCost, this.Player.Race.MinSpadeCost)) { decision = Decision.False(Exceptions.CannotUpgradeSpadePastMin); } else { decision = base.CanExecute(); } return(decision); }
public override Decision CanExecute() { var decision = Decision.True(); if (this.Player.Race.ShippingDistance == this.Player.Race.MaxShippingDistance) { decision = Decision.False(Exceptions.CannotUpgradeShippingPastMax); } else { decision = base.CanExecute(); } return(decision); }
public override Decision CanExecute() { Decision decision; if (this.Slot.Used) { decision = Decision.False(Exceptions.CannotCommitPriestUsedSlot); } else if (!this.CultTrack.UsableSlots.Contains(this.Slot, PriestSlot.Comparer)) { decision = Decision.False(Exceptions.CannotCommitPriestSlotNotFound); } else { decision = base.CanExecute(); } return(decision); }
public override Decision CanExecute() { Decision decision; var tile = this.Board.TileForLocation(this.Building.Location); if (tile?.Building == null) { decision = Decision.False(Exceptions.CannotUpgradeBuildingNotFound); } else if (tile.Owner != this.Player) { decision = Decision.False(Exceptions.OwnedByOtherPlayer); } else { decision = base.CanExecute(); } return(decision); }
public override Decision CanExecute() { Decision decision; var tile = this.Board.TileForLocation(this.Location); if (!tile.Type.HasFlag(this.Player?.Race?.HomeTerrain)) { decision = Decision.False(Exceptions.CannotBuildNotHomeTerrain); } else if (tile.Owner != null) { decision = Decision.False(Exceptions.CannotBuildOwned); } else if (tile.Building != null) { decision = Decision.False(Exceptions.CannotBuildExistingBuilding); } else { decision = base.CanExecute(); } return(decision); }
public override Decision CanExecute() { Decision decision; var tile = this.Board.TileForLocation(this.Location); if (tile.Owner != null) { decision = Decision.False(Exceptions.CannotTerraformOwned); } else if (tile.Type.HasFlag(this.Target)) { decision = Decision.False(Exceptions.CannotTerraformSameType); } else if (!this.Player.CanAfford(this.ActionCost.Resources)) { decision = Decision.False(Exceptions.CannotAfford); } else { decision = base.CanExecute(); } return(decision); }
public override Decision CanExecute() { return(this.Player.HasPassed ? Decision.False(Exceptions.CannotTurnInScrollIfPassed) : Decision.True()); }