public void AddActor(UnrealActor actor) { if (isReadOnly) { throw new InvalidOperationException("This map cannot be modified because it is read-only"); } else { if (actor is UnrealBrush) // if (actor.Class == "Brush" || actor.Class == "Mover") // TODO: test { if ((actor as UnrealBrush).Polygons.Count() == 0) { // This brush is invalid, so ignore it return; } brushes.Add(actor as UnrealBrush); } actors.Add(actor); actor.AddOwner(this); } }