This commit is contained in:
Leonid Pershin
2026-08-18 23:51:10 +03:00
parent d8f8db6a48
commit 65feda3756
50 changed files with 1485 additions and 224 deletions
+14 -13
View File
@@ -121,23 +121,24 @@ public static class MapView
string locale,
RoomNode room)
{
var items = new List<MapViewItem>(room.Slots.Count);
var pupilSlots = 0L;
foreach (var fill in room.Slots)
if (catalog.Rooms.TryGetValue(room.Def, out var def) && def.Homeroom && !string.IsNullOrWhiteSpace(def.SeatThing))
{
var count = SlotQuantity(fill.Count);
items.Add(new MapViewItem(LabelOf(catalog, locale, DefKind.Thing, fill.Thing), count));
if (catalog.Things.TryGetValue(fill.Thing, out var thing) && thing.PupilSlots > 0)
{
pupilSlots += (long)thing.PupilSlots * count;
}
var seats = RoomOccupancy.Quantity(room.Seats > 0 ? room.Seats : def.DefaultSeats);
return (
[new MapViewItem(LabelOf(catalog, locale, DefKind.Thing, def.SeatThing), seats)],
RoomOccupancy.PupilSlots(catalog, room));
}
return (items, (int)Math.Clamp(pupilSlots, 0, ushort.MaxValue));
}
var items = new List<MapViewItem>(room.Slots.Count);
foreach (var fill in room.Slots)
{
items.Add(new MapViewItem(
LabelOf(catalog, locale, DefKind.Thing, fill.Thing),
RoomOccupancy.Quantity(fill.Count)));
}
private static int SlotQuantity(int count) =>
count < 1 ? 1 : Math.Min(count, byte.MaxValue);
return (items, RoomOccupancy.PupilSlots(catalog, room));
}
/// <summary>
/// A floor's <see cref="FloorNode.Label"/> is its designation, not a replacement name — the