Пример #1
0
 public void ShowRemoveComponentMenu(MachineComponent current)
 {
     if (current != null)
     {
         this.currentState = InGameMenuState.removeComponentMenu;
         this.removeMenu.Show();
     }
 }
Пример #2
0
        public ComponentType RemoveCurrentComponent()
        {
            ComponentType currentComponent = ComponentType.none;

            // user clicked remove button
            if ( this.currentSelected != null )
            {
                // remove component from draw-set and list.
                //this.addMenu.ComponentRemovedFromStage(this.currentSelected.myComponentType());
                currentComponent = currentSelected.myComponentType();
                this.currentSelected.RemoveFromAutoDrawSet();
                machineComponentList.Remove(this.currentSelected);
            }

            this.currentSelected = null;

            return currentComponent;
        }
Пример #3
0
 public void AddComponent(MachineComponent newComponent)
 {
     machineComponentList.AddLast(newComponent);
 }
Пример #4
0
        public void HandleSingleTap(Vector2 touchLocation)
        {
            this.currentSelected = null;
            touchLocation = HudBar.screenToWorld(touchLocation);

            // see if user touched a component.
            foreach (MachineComponent current in machineComponentList)
            {
                if (current != null)
                {
                    if (current.selected(touchLocation))
                    {
                        this.currentSelected = current;
                    }
                }
            }
        }