private void HandleGameModeChanged(GameModeChangedEvent e) { ClearMask(); if (e.Current.Equals(GameMode.PlayerOneSetup)) { GameManager.PlayerOne.Holder.SetActive(true); GameManager.PlayerTwo.Holder.SetActive(false); } else if (e.Current.Equals(GameMode.PlayerTwoSetup)) { GameManager.PlayerOne.Holder.SetActive(false); GameManager.PlayerTwo.Holder.SetActive(true); } else if (e.Current.Equals(GameMode.PlayerOne)) { MaskPlayer(GameManager.PlayerTwo); } else if (e.Current.Equals(GameMode.PlayerTwo)) { MaskPlayer(GameManager.PlayerOne); } else if (e.Current.Equals(GameMode.PlayerTransition)) { GameManager.PlayerOne.Holder.SetActive(true); GameManager.PlayerTwo.Holder.SetActive(true); ClearMask(); MaskPlayer(GameManager.PlayerOne); MaskPlayer(GameManager.PlayerTwo); } }
private void HandleGameModeChanged(GameModeChangedEvent e) { if (e.Current.Equals(GameMode.PlayerTransition)) { highlightCube.SetActive(false); previous = BoardPosition.OFF_BOARD; action = false; ClearValid(); } }
private void HandleGameModeChanged(GameModeChangedEvent e) { if (e.Current.Equals(GameMode.PlayerOneSetup) || e.Current.Equals(GameMode.PlayerTwoSetup)) { UI.SetActive(true); } else if (e.Current.Equals(GameMode.PlayerTransition)) { UI.SetActive(false); } }
public void HandleGameModeChange(GameModeChangedEvent e) { if (!flagAtEnd.ContainsKey(GameManager.PlayerOne)) { flagAtEnd.Add(GameManager.PlayerOne, 0); } if (!flagAtEnd.ContainsKey(GameManager.PlayerTwo)) { flagAtEnd.Add(GameManager.PlayerTwo, 0); } if (e.Current.Equals(GameMode.PlayerTransition)) { moveWithoutChallengeCount++; moveCount++; } else if (e.Current.Equals(GameMode.PlayerOne) || e.Current.Equals(GameMode.PlayerTwo)) { bool draw = false; //Check no challenge rule if (NoChallengeRule && moveWithoutChallengeCount >= MoveWithoutChallengeLimit) { draw = true; win = true; } if (!draw) { //Check for flag for (int i = 0; i < 9; i++) { UnitPiece piece = UnitManager.GetUnitPieceForPosition(new BoardPosition(0, i)); if (piece.Rank.Equals(UnitRank.Flag) && piece.Owner.Equals(GameManager.PlayerTwo)) { flagAtEnd[piece.Owner]++; } piece = UnitManager.GetUnitPieceForPosition(new BoardPosition(7, i)); if (piece.Rank.Equals(UnitRank.Flag) && piece.Owner.Equals(GameManager.PlayerOne)) { flagAtEnd[piece.Owner]++; } } foreach (KeyValuePair <PlayerInfo, int> pair in flagAtEnd) { if (pair.Value >= 1) { //Meets win condition win = true; winner = pair.Key; } } } } }
public void HandleGameModeChange(GameModeChangedEvent e) { if (!flagAtEnd.ContainsKey(GameManager.PlayerOne)) { flagAtEnd.Add(GameManager.PlayerOne, 0); } if (!flagAtEnd.ContainsKey(GameManager.PlayerTwo)) { flagAtEnd.Add(GameManager.PlayerTwo, 0); } if (e.Current.Equals(GameMode.PlayerTransition)) { moveWithoutChallengeCount++; moveCount++; } else if (e.Current.Equals(GameMode.PlayerOne) || e.Current.Equals(GameMode.PlayerTwo)) { bool draw = false; //Check no challenge rule if (NoChallengeRule && moveWithoutChallengeCount >= MoveWithoutChallengeLimit) { draw = true; win = true; } if (!draw) { //Check for flag for (int i = 0; i < 9; i++) { UnitPiece piece = UnitManager.GetUnitPieceForPosition(new BoardPosition(0, i)); if (piece.Rank.Equals(UnitRank.Flag) && piece.Owner.Equals(GameManager.PlayerTwo)) { flagAtEnd[piece.Owner]++; } piece = UnitManager.GetUnitPieceForPosition(new BoardPosition(7, i)); if (piece.Rank.Equals(UnitRank.Flag) && piece.Owner.Equals(GameManager.PlayerOne)) { flagAtEnd[piece.Owner]++; } } foreach (KeyValuePair<PlayerInfo, int> pair in flagAtEnd) { if (pair.Value >= 1) { //Meets win condition win = true; winner = pair.Key; } } } } }
private void HandleGameModeChanged(GameModeChangedEvent e) { //Refresh if (e.Current.Equals(GameMode.PlayerOneSetup) || e.Current.Equals(GameMode.PlayerTwoSetup)) { int amount = UnitManager.GetPlacementAmountForUnit(rank); selected = false; if (amount > 0) { remaining.text = amount.ToString(); image.color = Color.white; } else { image.color = DISABLED_COLOR; } } }