/// <summary> /// Creates the entity. for runtime /// </summary> /// <returns>The entity.</returns> /// <param name="ID">I.</param> public ZEntity CreateEntity(int ID) { ZEntity template = FindEntityTemplateByID(ID); if (template == null) { return(null); } ZEntity newEntity = Clone(template); if (newEntity != null) { //build the sub entity BuildSubTree(newEntity); entities.Add(newEntity); newEntity.pool = this; //if (newEntity.EType != EntityType.System) newEntity.Start(); } return(newEntity); }
/// <summary> /// Starts the entity. /// </summary> /// <param name="newEntity">New entity.</param> private void StartEntity(ZEntity newEntity) { if (newEntity != null) { newEntity.Start(); } }
/// <summary> /// Creates the sub entity. /// </summary> /// <returns>The sub entity.</returns> /// <param name="ID">I.</param> private ZEntity CreateSubEntity(int ID) { ZEntity template = FindEntityTemplateByID(ID); if (template == null) { return(null); } ZEntity newEntity = Clone(template); if (newEntity != null) { newEntity.pool = this; newEntity.Start(); } return(newEntity); }