public virtual EntityType GetEntityByFileName(string FileName) { foreach (EntityType CurrentEntity in Entities) { if (CurrentEntity.GetFilename() == FileName) { return(CurrentEntity); } } return(null); }
public virtual void AddEntity(EntityType NewEntity) { bool bHasFilenameAlready = false; foreach (EntityType CurrentEntity in Entities) { if (CurrentEntity.GetFilename() == NewEntity.GetFilename()) { bHasFilenameAlready = true; } } if (bHasFilenameAlready) { NewEntity.EditorSetFilename(EditorGetUniqueEntityFilename(NewEntity.GetFilename())); AddEntity(NewEntity); } else { Entities.Add(NewEntity); } }