private int doubleTapCountdown = 0; // number of ticks remaining to tap again for a "double-tap". #endregion Fields #region Constructors // default constructor. public ComponentManager(int screenWidth, int screenHeight) { // these are flipped because screen is in landscape. _screenWidth = screenHeight; _screenHeight = screenWidth; // set initial state this.currentState = ComponentManagerState.noMenu; // create component list componentList = new LinkedList<Component>(); Component copperCoin = new Component(new Vector2(XNACS1Base.RandomFloat(0, XNACS1Base.World.WorldDimension.X), XNACS1Base.RandomFloat(0, XNACS1Base.World.WorldDimension.Y))); copperCoin.Texture = "coppercoin"; copperCoin.RotateAngle = XNACS1Base.RandomFloat(0, 360); componentList.AddLast(copperCoin); Component goldCoin = new Component(new Vector2(XNACS1Base.RandomFloat(0, XNACS1Base.World.WorldDimension.X), XNACS1Base.RandomFloat(0, XNACS1Base.World.WorldDimension.Y))); goldCoin.Texture = "goldCoin"; goldCoin.RotateAngle = XNACS1Base.RandomFloat(0, 360); componentList.AddLast(goldCoin); Component piggybank = new Component(new Vector2(XNACS1Base.RandomFloat(0, XNACS1Base.World.WorldDimension.X), XNACS1Base.RandomFloat(0, XNACS1Base.World.WorldDimension.Y))); piggybank.Texture = "piggybank"; piggybank.RotateAngle = XNACS1Base.RandomFloat(0, 360); componentList.AddLast(piggybank); Component silvercoin = new Component(new Vector2(XNACS1Base.RandomFloat(0, XNACS1Base.World.WorldDimension.X), XNACS1Base.RandomFloat(0, XNACS1Base.World.WorldDimension.Y))); silvercoin.Texture = "silvercoin"; silvercoin.RotateAngle = XNACS1Base.RandomFloat(0, 360); componentList.AddLast(silvercoin); // create a RemoveComponentMenu // removeMenu = new RemoveComponentMenu(); }
// default constructor. public ComponentManager(int screenWidth, int screenHeight) { // these are flipped because screen is in landscape. _screenWidth = screenHeight; _screenHeight = screenWidth; // set initial state this.currentState = ComponentManagerState.noMenu; // create component list componentList = new LinkedList<Component>(); // create a RemoveComponentMenu removeMenu = new RemoveComponentMenu(); // create an AddComponentMenu addMenu = new AddComponentMenu(); }
private void showRemoveComponentMenu(Component current) { //this.currentSelected = null; this.doubleTapCountdown = 0; this.currentState = ComponentManagerState.removeComponentMenu; //this.removeMenu.Show(); }
private void hideRemoveComponentMenu() { this.doubleTapCountdown = 0; this.currentState = ComponentManagerState.noMenu; //this.removeMenu.Hide(); }
private void showAddComponentMenu() { this.doubleTapCountdown = 0; this.currentState = ComponentManagerState.addComponentMenu; this.addMenu.Show(); }
private void hideAddComponentMenu() { this.doubleTapCountdown = 0; this.currentState = ComponentManagerState.noMenu; this.addMenu.Hide(); }