public void ShowRemoveComponentMenu(MachineComponent current) { if (current != null) { this.currentState = InGameMenuState.removeComponentMenu; this.removeMenu.Show(); } }
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; }
public void AddComponent(MachineComponent newComponent) { machineComponentList.AddLast(newComponent); }
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; } } } }