public static (int[] ids, string[] errors) GetWinners(string input) { var gameStateBuildResult = GameStateFactory.Build(input); if (gameStateBuildResult.Success) { var bestToWorstHands = gameStateBuildResult.GameState.PlayerHands.OrderBy(x => x).ToArray(); var winningHands = bestToWorstHands.Where(x => x.Equals(bestToWorstHands.First())); var winningIds = winningHands.Select(x => x.PlayerId).OrderBy(x => x).ToArray(); return(winningIds, Array.Empty <string>()); } else { return(Array.Empty <int>(), gameStateBuildResult.Errors); } }
/// <summary> /// 初始化游戏状态 /// </summary> private void InitGameState() { GameStateFactory.Build(m_gameStateMgr); m_gameStateMgr.SwitchTo(GameStateID.ST_BOOT, new GameStateParam()); }