CustomGame.SwapAll();
Syntax
public void SwapAll()

Swaps players in both teams. Only works when the max player count is the same for both teams.

using System;
using CustomGameOW;

static void Main(string[] args)
{
    // Swap players on both teams at end of game to prevent defend/attack rotation.

    CustomGame cg = new CustomGame();

    while(true)
    {
        if (cg.GetGameState() == GameState.Ending_Commend)
        {
            cg.SwapAll();
            cg.ClickOption(GameOption.Restart);
        }
    }
}