private static T New <T>() where T : Entity, new() { var entity = new T(); entity.InstanceId = IdFactory.NewInstanceId(); if (!Master.Entities.ContainsKey(typeof(T))) { Master.Entities.Add(typeof(T), new List <Entity>()); } Master.Entities[typeof(T)].Add(entity); return(entity); }
private static Entity NewEntity(Type entityType) { var entity = Activator.CreateInstance(entityType) as Entity; entity.InstanceId = IdFactory.NewInstanceId(); if (!Master.Entities.ContainsKey(entityType)) { Master.Entities.Add(entityType, new List <Entity>()); } Master.Entities[entityType].Add(entity); return(entity); }