private void PerformAdd() { if (obj is EnemyInstance) { if (insertIndex == -1) { insertIndex = Screen.Enemies.Count; } Screen.AddEnemy((EnemyInstance)obj, insertIndex); } else if (obj is StructInstance) { if (insertIndex == -1) { insertIndex = Screen.Structs.Count; } Screen.AddObject((StructInstance)obj, insertIndex); } }