add shel
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user