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

@ -3,29 +3,24 @@ namespace GlobalClassLib;
public abstract class GlobalEnemy<TTile, TCon> where TTile : GlobalMapTile<TCon, TTile> where TCon : GlobalTileConnector<TTile, TCon> {
public TTile? Location { get; set; }
public bool Visible { get; set; }
public abstract string Name{ get; }
public abstract int TypeId{ get; }
public int Id { get; }
public abstract string Name{ get; }
public abstract EnemyType Type{ get; }
// ReSharper disable once StaticMemberInGenericType
private static int nextId = 0;
// public static Dictionary<TTile, GlobalEnemy<TTile, TCon>> PresentEnemies = new();
public GlobalEnemy() {
Id = nextId++;
}
public GlobalEnemy(int id) {
Id = id;
}
public virtual void Spawn(TTile? location) {
// PresentEnemies.Add(location, this);
public virtual void Spawn(TTile location) {
Location = location;
Visible = true;
Console.WriteLine($"Enemy {Id} ({Name}) spawned at {(location == null ? "" : location.Id)} {(location == null ? "" : location.GridPosition)}");
Console.WriteLine($"Enemy {Id} ({Name}) spawned at {location.Id} {location.GridPosition}");
}
public virtual void Update() { }