Oprava spawnování monster, optimalizace v CommandProcessor a EventProcessor. Přesunutí některých tříd do vlastních namespaců, pročištění kódu, úpravy formátování, odstranění nepoužívaných souborů a zakomentovaného kódu

This commit is contained in:
Perry 2026-03-28 09:59:31 +01:00
parent e5d746d597
commit 243f071a43
62 changed files with 873 additions and 1217 deletions

View file

@ -1,9 +1,15 @@
namespace GlobalClassLib;
public abstract class GlobalTileConnector<TTile, TCon> where TTile : GlobalMapTile<TCon,TTile> where TCon : GlobalTileConnector<TTile, TCon> {
// private readonly TTile _tile1;
// private readonly TTile _tile2;
public abstract class GlobalTileConnector<TTile, TCon>
where TTile : GlobalMapTile<TCon,TTile>
where TCon : GlobalTileConnector<TTile, TCon> {
public (TTile tile1, TTile tile2) Tiles;
public bool Blocked { get; set; }
public (int, int) Id => (Tiles.tile1.Id, Tiles.tile2.Id);
public ConnectorType Type { get; set; }
public TTile OtherTile(TTile tile) => Tiles.tile1 == tile ? Tiles.tile2 : Tiles.tile1;
public GlobalTileConnector(TTile tile1, TTile tile2, ConnectorType type) {
Tiles.tile1 = tile1;
Tiles.tile2 = tile2;
@ -14,16 +20,7 @@ public abstract class GlobalTileConnector<TTile, TCon> where TTile : GlobalMapTi
Tiles.tile2 = tile2;
Type = type;
}
public (TTile tile1, TTile tile2) Tiles;
public bool Blocked { get; set; }
public (int, int) Id => (Tiles.tile1.Id, Tiles.tile2.Id);
public ConnectorType Type { get; set; }
public TTile OtherTile(TTile tile) => Tiles.Item1 == tile ? Tiles.Item2 : Tiles.Item1;
public Direction GetDirection(TTile tile) {
if (tile != Tiles.tile1 && tile != Tiles.tile2) return Direction.NONE;
@ -39,7 +36,7 @@ public abstract class GlobalTileConnector<TTile, TCon> where TTile : GlobalMapTi
}
}
public override string ToString() => $"Con ({Tiles.Item1.PositionAsString} -> {Tiles.Item2.PositionAsString})";
public override string ToString() => $"Con ({Tiles.Item1.IdAsString} -> {Tiles.Item2.IdAsString})";
public abstract TCon Clone();
}