2026-03-08 16:55:49 +01:00
|
|
|
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 int Id { get; }
|
2026-03-28 09:59:31 +01:00
|
|
|
public abstract string Name{ get; }
|
|
|
|
|
public abstract EnemyType Type{ get; }
|
2026-03-08 16:55:49 +01:00
|
|
|
|
2026-03-28 09:59:31 +01:00
|
|
|
// ReSharper disable once StaticMemberInGenericType
|
2026-03-08 16:55:49 +01:00
|
|
|
private static int nextId = 0;
|
|
|
|
|
|
2026-03-17 20:14:29 +01:00
|
|
|
public GlobalEnemy() {
|
2026-03-08 16:55:49 +01:00
|
|
|
Id = nextId++;
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-17 20:14:29 +01:00
|
|
|
public GlobalEnemy(int id) {
|
2026-03-08 16:55:49 +01:00
|
|
|
Id = id;
|
|
|
|
|
}
|
2026-03-28 09:59:31 +01:00
|
|
|
public virtual void Spawn(TTile location) {
|
2026-03-08 16:55:49 +01:00
|
|
|
Location = location;
|
|
|
|
|
Visible = true;
|
2026-03-28 09:59:31 +01:00
|
|
|
Console.WriteLine($"Enemy {Id} ({Name}) spawned at {location.Id} {location.GridPosition}");
|
2026-03-08 16:55:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public virtual void Update() { }
|
|
|
|
|
|
|
|
|
|
}
|