Enable placeable sun deck attractions and finish project rebrand

This commit is contained in:
josh
2026-11-28 20:33:30 -05:00
parent 56fafba6d9
commit ce0d38c8de
352 changed files with 1523 additions and 552 deletions

View File

@@ -0,0 +1,42 @@
using System;
namespace BigShipTycoon
{
public sealed partial class OnboardSession
{
private int performanceStarted = -1;
private EntertainmentProgram BookedProgram => Quote.Plan?.Program ?? EntertainmentProgram.Shipboard;
private int PerformanceRounds => PortPlanning.ShowRounds(BookedProgram);
public bool PerformanceActive => performanceStarted >= 0 && tick < performanceStarted + PerformanceRounds;
internal bool CanAdvancePerformance => BookedProgram != EntertainmentProgram.Shipboard && performanceStarted < 0
&& tick + PerformanceRounds < ticks;
internal string PerformanceLabel
{
get
{
if (BookedProgram == EntertainmentProgram.Shipboard)
return "Shipboard sets";
string title = PortPlanning.ProgramLabel(BookedProgram);
if (PerformanceActive)
return $"{title} · now playing ({performanceStarted + PerformanceRounds - tick} rounds)";
return $"{title} · {(performanceStarted < 0 ? "up next" : "finished")}";
}
}
internal bool TryAdvancePerformance()
{
if (!CanAdvancePerformance)
return false;
performanceStarted = tick;
Measure(false);
return true;
}
private void AdvancePerformance()
{
if (BookedProgram != EntertainmentProgram.Shipboard && performanceStarted < 0
&& tick >= Math.Min(ticks - PerformanceRounds, ticks * PortPlanning.ShowTime(BookedProgram)))
performanceStarted = tick;
}
}
}