public static void Add(Interactable entity) { if (Entites is null) { Entites = new List <Interactable>(); } if (entity.Position is null) { entity.Position = RandomPosition; } Entites.Add(entity); if (entity is Enemy) { ((Enemy)entity).Died += RemoveEntity; } else if (entity is Collectible) { ((Collectible)entity).Remove += CollectibleRemove; } }
public void Insert(T t) { Entites.Add(t); _dbContext.SaveChanges(); //throw new NotImplementedException(); }