mirror of
https://github.com/MSWS/TTT.git
synced 2025-12-05 22:20:25 -08:00
* Overhaul locale structure * Reformat & Cleanup * refactor: Refactor roles to use dependency injection. ``` Introduce dependency injection and refactor role architecture - Refactor `RoleAssignerTest` to use `IServiceProvider` for dependency injection, update role initialization, and align test cases accordingly. - Update `IOnlinePlayer` and `IGame` interfaces to use the fully qualified namespace for roles and modify method signatures to reflect new role architecture. - Add `BaseRole` abstract class and refactor role classes (e.g., `InnocentRole`, `DetectiveRole`, `TraitorRole`, `RatioBasedRole`) to inherit from it, implementing dependency injection and overriding key properties and methods. - Introduce new storage interfaces (`IStorage<T>`, `IWriteable<T>`, `IKeyedStorage<T>`) for improved configuration management and add related test implementations (e.g., `FakeConfig`, `MemoryStorage`). - Add `GameConfig` class for configurable game and round settings, implement `CS2GameConfig` class to manage configuration storage and plugin module lifecycle, and refactor `RoundBasedGame` to leverage the new configuration structure. ``` * Fix lang copying * Rename step * Add debug * Fix path
9 lines
223 B
C#
9 lines
223 B
C#
namespace TTT.Locale;
|
|
|
|
public static class MsgFactory {
|
|
public static IMsg Create(string key, params object[] args) {
|
|
return new Msg(key, args);
|
|
}
|
|
|
|
private sealed record Msg(string Key, object[] Args) : IMsg;
|
|
} |