/// <summary> /// Processes the list and creates the group from it. The movable object has a bigger priority, /// so when the list contains both types (IMovableGameObject and IStaticGameObject) the movable /// group is created. /// </summary> /// <param Name="selectedObjects">Objects in clicked area</param> public void OnLeftClick(List <Mogre.MovableObject> selectedObjects) { bool isMovableSelected = false; List <IMovableGameObject> imgoList = new List <IMovableGameObject>(); List <IStaticGameObject> isgoList = new List <IStaticGameObject>(); foreach (var gameObject in selectedObjects) { if (!hitTest.IsObjectControllable(gameObject.Name)) { continue; } if (hitTest.IsObjectMovable(gameObject.Name)) { isMovableSelected = true; imgoList.Add(hitTest.GetIMGO(gameObject.Name)); } else { if (isMovableSelected == false) { isgoList.Add(hitTest.GetISGO(gameObject.Name)); } } } // Movables has bigger priority. if (isMovableSelected) { groupMgr.CreateInfoGroup(imgoList); } else { groupMgr.CreateInfoGroup(isgoList); } }