minor cleanup to TradeCommandSelector

This commit is contained in:
2025-09-20 07:05:49 -07:00
parent deedc5341e
commit cafd3b80cd
@@ -63,14 +63,19 @@ namespace eagle {
: -(int)Math.Ceiling(NetFood * TradeCommand.FoodSellPrice);
private int GoldAmount => TradeCommand.GoldAvailable + NetGold;
public override SelectedCommand Command => new() {
TradeCommand =
new TradeSelectedCommand {
Amount = Math.Abs(FoodAmount - TradeCommand.FoodAvailable),
TradeType = IsBuy ? TradeSelectedCommand.Types.TradeType.BuyFood
: TradeSelectedCommand.Types.TradeType.SellFood
}
};
public override SelectedCommand Command {
get {
var command = new SelectedCommand {
TradeCommand =
new() {
Amount = Math.Abs(FoodAmount - TradeCommand.FoodAvailable),
TradeType = IsBuy ? TradeSelectedCommand.Types.TradeType.BuyFood
: TradeSelectedCommand.Types.TradeType.SellFood
}
};
return command;
}
}
public void SetTextFields() {
goldText.text = GoldAmount.ToString();