//used to advance to a new state via a trade route public PlannerState(PlannerState previous, TradeRouteMiner.Route routeToTake, int quantityToHaul) { this.cargoCapacity = previous.cargoCapacity; this.wallet = previous.wallet + routeToTake.profitPerItem * quantityToHaul; this.jumpsElapsed = previous.jumpsElapsed + jumpElapsedCost(routeToTake.jumps); this.sysName = routeToTake.buyer.location.name; this.parent = previous; this.lastRoute = routeToTake; this.lastQuantityHauled = quantityToHaul; }
//used to advance to a new state via an empty jump public PlannerState(PlannerState previous, string destination) { this.cargoCapacity = previous.cargoCapacity; this.wallet = previous.wallet; this.jumpsElapsed = previous.jumpsElapsed + 1.0; this.sysName = destination; this.parent = previous; this.lastRoute = null; this.lastQuantityHauled = 0; }
//used to construct an initial state public PlannerState(double cargoCapacity, double wallet, string sysName) { this.cargoCapacity = cargoCapacity; this.wallet = wallet; this.sysName = sysName; this.parent = null; this.lastRoute = null; this.lastQuantityHauled = 0; }