public void assignParent(InfiniteObject infiniteObject, ObjectType objectType) { switch (objectType) { case ObjectType.Platform: infiniteObject.setParent(platformParent); break; case ObjectType.Scene: infiniteObject.setParent(sceneParent); break; case ObjectType.Obstacle: infiniteObject.setParent(obstacleParent); break; case ObjectType.Coin: infiniteObject.setParent(coinParent); break; case ObjectType.PowerUp: infiniteObject.setParent(powerUpParent); break; } }