protected UnrealMap(UnrealMap map) : base(map) { FilePath = map.FilePath; title = map.title; author = map.author; song = map.song; Type = map.Type; // Duplicate actors sequentially; brushes and ownership will be handled correctly this way foreach (var actor in map.Actors) { AddActor(UnrealActorFactory.Duplicate(actor)); } }
/// <summary> /// Collects all actors from a T3D representation. /// </summary> public static IEnumerable <UnrealActor> LoadActors(string text) { int start = text.IndexOf("Begin Actor ");; while (start != -1) { // Get length of this block int end = text.IndexOf("End Actor", start) + "End Actor".Length; int length = end - start; // Extract and yield actor string actorText = text.Substring(start, length); var actor = UnrealActorFactory.FromText(actorText); yield return(actor); // increments actorCount and brushCount as necessary // Next iteration start = text.IndexOf("Begin Actor ", end); } }