/// <summary> /// Updates the current formation to the newly recognized system gesture. /// </summary> public void UpdateFormation() { //If the player is triggering a fusion if (Defines.playerFusionTriggered[this.currentPlayerIndex]) { //If there is a second player and that player is also in fusion mode if (Defines.playersGestures.Count > 1) { //Get the index of the other player PlayerIndex _otherPlayer = (this.currentPlayerIndex == PlayerIndex.One) ? PlayerIndex.Two : PlayerIndex.One; //If the other player is in fusion mode and their formation isn't a Normal formation if (Defines.playerFusionTriggered[_otherPlayer]) { //Check the ID of the gesture switch (currentFormationID) { case Defines.GESTURES.LINE: currentFormationID = Defines.GESTURES.LINE_FUSION; break; case Defines.GESTURES.SQUARE: currentFormationID = Defines.GESTURES.SQUARE_FUSION; break; case Defines.GESTURES.TRIANGLE: currentFormationID = Defines.GESTURES.TRIANGLE_FUSION; break; case Defines.GESTURES.V: currentFormationID = Defines.GESTURES.V_FUSION; break; } currentFusionFormation = fusionFormationList[currentFormationID]; //Set the current formation to the fusion formation for this player currentFormation = currentFusionFormation.playerFormationList[currentPlayerIndex]; //Set up the formation manager for a fusion formation. this.StartFusionMode(); } } //Otherwise we need a single-player fusion mode. else if (Defines.playersGestures.Count == 1) { //TODO: Implement single-player fusion triggering. } } //Otherwise, we're not triggering a fusion, // so just find the regular formation else { currentFormation = formationList[currentFormationID]; } //Set ID to remember gesture previousFormationID = currentFormationID; }
/// <summary> /// Updates the current formation to the newly recognized system gesture. /// </summary> public void UpdateFormation() { //If the player is triggering a fusion if (Defines.playerFusionTriggered[this.currentPlayerIndex]) { //If there is a second player and that player is also in fusion mode if (Defines.playersGestures.Count > 1) { //Get the index of the other player PlayerIndex _otherPlayer = (this.currentPlayerIndex == PlayerIndex.One) ? PlayerIndex.Two : PlayerIndex.One; //If the other player is in fusion mode and their formation isn't a Normal formation if (Defines.playerFusionTriggered[_otherPlayer]) { //Check the ID of the gesture switch (currentFormationID) { case Defines.GESTURES.LINE: currentFormationID = Defines.GESTURES.LINE_FUSION; break; case Defines.GESTURES.SQUARE: currentFormationID = Defines.GESTURES.SQUARE_FUSION; break; case Defines.GESTURES.TRIANGLE: currentFormationID = Defines.GESTURES.TRIANGLE_FUSION; break; case Defines.GESTURES.V: currentFormationID = Defines.GESTURES.V_FUSION; break; } currentFusionFormation = fusionFormationList[currentFormationID]; //Set the current formation to the fusion formation for this player currentFormation = currentFusionFormation.playerFormationList[currentPlayerIndex]; //Set up the formation manager for a fusion formation. this.StartFusionMode(); } } //Otherwise we need a single-player fusion mode. else if (Defines.playersGestures.Count == 1) { //TODO: Implement single-player fusion triggering. } } //Otherwise, we're not triggering a fusion, // so just find the regular formation else currentFormation = formationList[currentFormationID]; //Set ID to remember gesture previousFormationID = currentFormationID; }