public void DEVTOOLprevPlayer(PlayerMovement currentPlayer) { print("prev player request"); bool switchedPlayer = false; int prevPlayerNum = currentPlayer.GetPlayerNum() - 1; do { if (prevPlayerNum < 1) prevPlayerNum = playerMovers.Count; if (!playerMovers[prevPlayerNum - 1].isControllerConnected()) { int temp = playerMovers[prevPlayerNum - 1].GetPlayerNum(); playerMovers[prevPlayerNum - 1].SetPlayer(currentPlayer.GetPlayerNum(), developerModeOn); currentPlayer.SetPlayer(temp, developerModeOn); switchedPlayer = true; break; } prevPlayerNum--; } while (!switchedPlayer); }
public void DEVTOOLnextPlayer(PlayerMovement currentPlayer) { print("next player request"); bool switchedPlayer = false; int nextPlayerNum = currentPlayer.GetPlayerNum() + 1; do { if (nextPlayerNum > playerMovers.Count) nextPlayerNum = 1; if (!playerMovers[nextPlayerNum - 1].isControllerConnected()) { int temp = playerMovers[nextPlayerNum - 1].GetPlayerNum(); playerMovers[nextPlayerNum - 1].SetPlayer(currentPlayer.GetPlayerNum(), developerModeOn); currentPlayer.SetPlayer(temp, developerModeOn); switchedPlayer = true; break; } nextPlayerNum++; } while (!switchedPlayer); }