Add fleet save slots and rotatable onboard venues
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Soundings
|
||||
{
|
||||
@@ -8,25 +9,52 @@ namespace Soundings
|
||||
public enum Facility
|
||||
{
|
||||
Empty, Cabin, Dining, Entertainment, Tank, Bar, Amenity, Galley, Stores, Water, Waste, Workshop,
|
||||
Suite, GrandSuite, Restaurant, GrandTheater, ResortPool, CocktailLounge, Extension
|
||||
Suite, GrandSuite, Restaurant, GrandTheater, ResortPool, CocktailLounge, Extension,
|
||||
Shop, ShoppingArcade, Spa, WaterPark
|
||||
}
|
||||
|
||||
public sealed class FacilitySpec
|
||||
{
|
||||
public readonly string Name, Mark, Details;
|
||||
public readonly int Price, Capacity, Length, MinimumHull, FarePremiumPercent;
|
||||
public readonly int Price, Capacity, MinimumHull, FarePremiumPercent;
|
||||
private readonly Vector2Int[][] footprints = new Vector2Int[4][];
|
||||
|
||||
public FacilitySpec(string name, string mark, string details, int price, int capacity,
|
||||
int length = 1, int minimumHull = Market.Coastal, int farePremiumPercent = 0)
|
||||
int length = 1, int minimumHull = Market.Coastal, int farePremiumPercent = 0,
|
||||
int depth = 1, bool corner = false)
|
||||
{
|
||||
Name = name;
|
||||
Mark = mark;
|
||||
Details = details;
|
||||
Price = price;
|
||||
Capacity = capacity;
|
||||
Length = length;
|
||||
MinimumHull = minimumHull;
|
||||
FarePremiumPercent = farePremiumPercent;
|
||||
|
||||
var bays = new List<Vector2Int>(length * depth);
|
||||
for (int row = 0; row < depth; row++)
|
||||
for (int column = 0; column < length; column++)
|
||||
if (!corner || row == 0 || column == 0)
|
||||
bays.Add(new Vector2Int(column, row));
|
||||
footprints[0] = bays.ToArray();
|
||||
for (int rotation = 1; rotation < footprints.Length; rotation++)
|
||||
footprints[rotation] = Turn(footprints[rotation - 1]);
|
||||
}
|
||||
|
||||
public int BayCount => footprints[0].Length;
|
||||
public IReadOnlyList<Vector2Int> Footprint(int rotation) => footprints[rotation & 3];
|
||||
|
||||
private static Vector2Int[] Turn(Vector2Int[] bays)
|
||||
{
|
||||
var rotated = new Vector2Int[bays.Length];
|
||||
for (int i = 0; i < bays.Length; i++)
|
||||
rotated[i] = new Vector2Int(-bays[i].y, bays[i].x);
|
||||
Array.Sort(rotated, (left, right) => left.y != right.y ? left.y.CompareTo(right.y) : left.x.CompareTo(right.x));
|
||||
// Keep the first occupied bay as the anchor, even when a lower row reaches farther left.
|
||||
Vector2Int anchor = rotated[0];
|
||||
for (int i = 0; i < rotated.Length; i++)
|
||||
rotated[i] -= anchor;
|
||||
return rotated;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,7 +160,11 @@ namespace Soundings
|
||||
new FacilitySpec("Grand theater", "GT", "256 show seats", 52300, 256, 3, Ocean),
|
||||
new FacilitySpec("Resort pool", "RP", "216 amenity admissions per service", 57200, 216, 3, Regional),
|
||||
new FacilitySpec("Cocktail lounge", "CL", "156 drink orders per service", 32100, 156, 2, Regional),
|
||||
new FacilitySpec("Continued berth", "", "", 0, 0)
|
||||
new FacilitySpec("Continued berth", "", "", 0, 0),
|
||||
new FacilitySpec("Gift shop", "SH", "64 retail orders per service", 12600, 64),
|
||||
new FacilitySpec("Shopping arcade", "SA", "190 retail orders per service", 41500, 190, 2, Regional, depth: 2, corner: true),
|
||||
new FacilitySpec("Spa retreat", "SP", "144 amenity admissions per service", 48300, 144, 2, Regional, depth: 2),
|
||||
new FacilitySpec("Water park", "WP", "460 amenity admissions per service", 107000, 460, 3, Ocean, depth: 2)
|
||||
};
|
||||
|
||||
public static readonly IReadOnlyList<HullSpec> Hulls = new[]
|
||||
|
||||
Reference in New Issue
Block a user