Enhance map layout and room definitions by adding optional labels for rooms and updating the API to support new room naming conventions. Introduce additional room types and localization strings for improved user experience in both English and Russian. Refactor map view logic to accommodate new room attributes and ensure accurate rendering in the UI. Update tests to validate changes in room structure and localization.
ci / server (push) Failing after 3m35s
ci / client (push) Successful in 13s

This commit is contained in:
Leonid Pershin
2026-08-18 16:47:37 +03:00
parent 7658443cd5
commit 6ca9ff9d03
18 changed files with 379 additions and 18 deletions
+157 -8
View File
@@ -1,19 +1,20 @@
{
// Walkable yard is the tree root and a graph node. Rooms reach it through the porch/corridor.
// A small two-storey school: main building on the yard, gym across the yard.
// Walkable graph is yard + rooms; floors are grouping only. Stairs link the two corridors.
"territory": { "id": "yard", "def": "SchoolYard" },
"buildings": [
{ "id": "main", "def": "MainBuilding" },
{ "id": "gym", "def": "GymBuilding" },
],
"floors": [
{ "id": "floor-1", "def": "StandardFloor", "building": "main", "label": "1" },
{ "id": "floor-2", "def": "StandardFloor", "building": "main", "label": "2" },
{ "id": "gym-floor", "def": "StandardFloor", "building": "gym" },
],
"rooms": [
{
"id": "corridor-1",
"def": "Corridor",
"building": "main",
"floor": "floor-1",
},
{ "id": "porch", "def": "EntranceHall", "building": "main", "floor": "floor-1" },
{ "id": "corridor-1", "def": "Corridor", "building": "main", "floor": "floor-1", "label": "1" },
{ "id": "stairs-1", "def": "Stairwell", "building": "main", "floor": "floor-1", "label": "1" },
{
"id": "principals-office",
"def": "PrincipalsOffice",
@@ -25,9 +26,157 @@
{ "key": "guestChair", "thing": "Chair" },
],
},
{
"id": "secretary-office",
"def": "SecretaryOffice",
"building": "main",
"floor": "floor-1",
"slots": [
{ "key": "desk", "thing": "Desk" },
{ "key": "chair", "thing": "Chair" },
],
},
{
"id": "teachers-room",
"def": "TeachersRoom",
"building": "main",
"floor": "floor-1",
"slots": [
{ "key": "table", "thing": "DiningTable" },
{ "key": "chairs", "thing": "Chair" },
],
},
{
"id": "classroom-1a",
"def": "Classroom",
"building": "main",
"floor": "floor-1",
"label": "1A",
"slots": [
{ "key": "board", "thing": "Blackboard" },
{ "key": "teacherDesk", "thing": "Desk" },
{ "key": "studentDesks", "thing": "StudentDesk" },
],
},
{
"id": "classroom-1b",
"def": "Classroom",
"building": "main",
"floor": "floor-1",
"label": "1B",
"slots": [
{ "key": "board", "thing": "Blackboard" },
{ "key": "teacherDesk", "thing": "Desk" },
{ "key": "studentDesks", "thing": "StudentDesk" },
],
},
{
"id": "cafeteria",
"def": "Cafeteria",
"building": "main",
"floor": "floor-1",
"slots": [
{ "key": "counter", "thing": "DiningTable" },
{ "key": "seats", "thing": "Chair" },
],
},
{ "id": "restroom-1", "def": "Restroom", "building": "main", "floor": "floor-1", "label": "1" },
{
"id": "medical-office",
"def": "MedicalOffice",
"building": "main",
"floor": "floor-1",
"slots": [
{ "key": "couch", "thing": "MedicalCouch" },
{ "key": "desk", "thing": "Desk" },
],
},
{ "id": "corridor-2", "def": "Corridor", "building": "main", "floor": "floor-2", "label": "2" },
{ "id": "stairs-2", "def": "Stairwell", "building": "main", "floor": "floor-2", "label": "2" },
{
"id": "classroom-2a",
"def": "Classroom",
"building": "main",
"floor": "floor-2",
"label": "2A",
"slots": [
{ "key": "board", "thing": "Blackboard" },
{ "key": "teacherDesk", "thing": "Desk" },
{ "key": "studentDesks", "thing": "StudentDesk" },
],
},
{
"id": "classroom-2b",
"def": "Classroom",
"building": "main",
"floor": "floor-2",
"label": "2B",
"slots": [
{ "key": "board", "thing": "Blackboard" },
{ "key": "teacherDesk", "thing": "Desk" },
{ "key": "studentDesks", "thing": "StudentDesk" },
],
},
{
"id": "library",
"def": "Library",
"building": "main",
"floor": "floor-2",
"slots": [
{ "key": "desk", "thing": "Desk" },
{ "key": "shelves", "thing": "Bookshelf" },
],
},
{
"id": "computer-lab",
"def": "ComputerLab",
"building": "main",
"floor": "floor-2",
"slots": [
{ "key": "teacherDesk", "thing": "Desk" },
{ "key": "computers", "thing": "Computer" },
],
},
{ "id": "restroom-2", "def": "Restroom", "building": "main", "floor": "floor-2", "label": "2" },
{
"id": "gym-hall",
"def": "GymHall",
"building": "gym",
"floor": "gym-floor",
"slots": [
{ "key": "benches", "thing": "Bench" },
],
},
{
"id": "changing-room",
"def": "ChangingRoom",
"building": "gym",
"floor": "gym-floor",
"slots": [
{ "key": "lockers", "thing": "Locker" },
],
},
],
"links": [
{ "a": "yard", "b": "corridor-1" },
{ "a": "yard", "b": "porch" },
{ "a": "porch", "b": "corridor-1" },
{ "a": "corridor-1", "b": "stairs-1" },
{ "a": "corridor-1", "b": "principals-office" },
{ "a": "corridor-1", "b": "secretary-office" },
{ "a": "corridor-1", "b": "teachers-room" },
{ "a": "corridor-1", "b": "classroom-1a" },
{ "a": "corridor-1", "b": "classroom-1b" },
{ "a": "corridor-1", "b": "cafeteria" },
{ "a": "corridor-1", "b": "restroom-1" },
{ "a": "corridor-1", "b": "medical-office" },
{ "a": "stairs-1", "b": "stairs-2" },
{ "a": "stairs-2", "b": "corridor-2" },
{ "a": "corridor-2", "b": "classroom-2a" },
{ "a": "corridor-2", "b": "classroom-2b" },
{ "a": "corridor-2", "b": "library" },
{ "a": "corridor-2", "b": "computer-lab" },
{ "a": "corridor-2", "b": "restroom-2" },
{ "a": "yard", "b": "gym-hall" },
{ "a": "gym-hall", "b": "changing-room" },
],
}