Add multi-stop voyages, a live chart, and named port announcements
This commit is contained in:
@@ -14,7 +14,8 @@ namespace Soundings.Editor
|
||||
VerifyLiveCrossingSettlement();
|
||||
VerifyStormAndShipSystems();
|
||||
VerifyPortOrders();
|
||||
Debug.Log("Soundings economy verification passed: both starts, pricing, fuel, accounting, saves, flagship progression, live settlement, weather, ship systems and port orders.");
|
||||
VerifyMultiStopItinerary();
|
||||
Debug.Log("Soundings economy verification passed: both starts, pricing, fuel, accounting, saves, flagship progression, live settlement, weather, ship systems, port orders and multi-stop itineraries.");
|
||||
}
|
||||
|
||||
private static void VerifyUsedStartAndProfit()
|
||||
@@ -258,6 +259,37 @@ namespace Soundings.Editor
|
||||
&& loaded.History[0].Plan.Program == EntertainmentProgram.LiveMusic, "dockside orders survive a saved arrival");
|
||||
}
|
||||
|
||||
private static void VerifyMultiStopItinerary()
|
||||
{
|
||||
Company company = Company.Start(false);
|
||||
Ship ship = company.ActiveShip;
|
||||
Require(company.AppendItineraryStop(ship, 0) != null, "an itinerary cannot repeat the current berth in consecutive calls");
|
||||
Require(company.AppendItineraryStop(ship, 1) == null, "add Nassau to a Miami itinerary");
|
||||
Require(company.AppendItineraryStop(ship, 2) != null, "a later call also needs its permit");
|
||||
Require(company.Permit(2) == null && company.AppendItineraryStop(ship, 2) == null, "add Key West after licensing it");
|
||||
Require(company.AppendItineraryStop(ship, Market.Lisbon) != null, "reject a disconnected leg");
|
||||
Require(company.Sail(ship, 2) != null && ship.Port == 0, "an active itinerary enforces its next call");
|
||||
|
||||
Voyage first = company.Forecast(ship, 1);
|
||||
var session = new OnboardSession(ship, first);
|
||||
Require(company.Sail(ship, 1, session) == null && ship.Itinerary.NextPort == 2 && ship.Port == 1,
|
||||
"settling one leg leaves the ship at its intermediate port");
|
||||
int start = company.History[0].ItineraryStartDay;
|
||||
Require(company.History[0].ItineraryLeg == 1 && company.History[0].ItineraryLegs == 2, "record first leg in the voyage ledger");
|
||||
|
||||
Company resumed = JsonUtility.FromJson<Company>(JsonUtility.ToJson(company));
|
||||
Require(resumed.CanLoad() && resumed.ActiveShip.Itinerary.NextPort == 2, "persist the next leg at an intermediate call");
|
||||
ship = resumed.ActiveShip;
|
||||
Voyage second = resumed.Forecast(ship, 2);
|
||||
int needed = Math.Max(0, second.RequiredFuel - ship.Fuel);
|
||||
if (needed > 0)
|
||||
Require(resumed.Refuel(ship, needed) == null, "bunker from the intermediate port");
|
||||
Require(resumed.Sail(ship, 2) == null && ship.Itinerary.CompletedStops == 2 && !ship.Itinerary.HasNext,
|
||||
"arriving at the last call completes the itinerary");
|
||||
Require(resumed.History[0].ItineraryStartDay == start && resumed.History[0].ItineraryLeg == 2
|
||||
&& resumed.History[1].Destination == 1 && resumed.History[0].Destination == 2, "group settled legs in order");
|
||||
}
|
||||
|
||||
private static void Require(bool condition, string description)
|
||||
{
|
||||
if (!condition)
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Soundings.Editor
|
||||
EditorBuildSettings.scenes = new[] { new EditorBuildSettingsScene(ScenePath, true) };
|
||||
PlayerSettings.companyName = "Soundings";
|
||||
PlayerSettings.productName = "Soundings";
|
||||
PlayerSettings.bundleVersion = "0.5.0";
|
||||
PlayerSettings.bundleVersion = "0.6.0";
|
||||
PlayerSettings.defaultScreenWidth = 1920;
|
||||
PlayerSettings.defaultScreenHeight = 1080;
|
||||
PlayerSettings.fullScreenMode = FullScreenMode.FullScreenWindow;
|
||||
|
||||
Reference in New Issue
Block a user