Refactor project structure and update documentation. Replace PixiJS with plain DOM for UI rendering, enhance README with game features, and revise protocol documentation for HTTP API. Remove unused files and streamline client code for better maintainability.
ci / server (push) Failing after 3m31s
ci / client (push) Successful in 17s

This commit is contained in:
Leonid Pershin
2026-08-18 12:27:30 +03:00
parent e6739e7912
commit b9ddc018d3
73 changed files with 4387 additions and 2930 deletions
+54
View File
@@ -0,0 +1,54 @@
using Arch.Core;
namespace HSchool.Simulation;
/// <summary>
/// One save: a name, a calendar and the ECS world that will hold everything the school is made of.
/// The world is empty for now — pupils, rooms and staff land in it as the game grows — but it is
/// created and destroyed with the school so ownership is never in question.
/// </summary>
public sealed class School : IDisposable
{
/// <summary>Longest name a school may carry, in characters.</summary>
public const int MaxNameLength = 40;
private bool _disposed;
internal School(int id, string name, DateTime startDate)
{
Id = id;
Name = name;
Clock = new GameClock(startDate);
World = World.Create();
}
public int Id { get; }
public string Name { get; }
public GameClock Clock { get; }
/// <summary>The Arch world backing this school. Only the loop thread may touch it.</summary>
public World World { get; }
/// <summary>Runs one fixed step of the school. Today that is only the calendar.</summary>
public void Tick(double deltaTime, double gameMinutesPerRealSecond)
{
ObjectDisposedException.ThrowIf(_disposed, this);
Clock.Advance(deltaTime, gameMinutesPerRealSecond);
}
public void Dispose()
{
if (_disposed)
{
return;
}
_disposed = true;
// Fully qualified: the `World` property would otherwise shadow the type.
Arch.Core.World.Destroy(World);
}
}