コード例 #1
0
ファイル: CoreLogic.cs プロジェクト: Pharylon/Poker
        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);
            }
        }
コード例 #2
0
ファイル: Game.cs プロジェクト: ljdong-fy/dong_kiwi
 /// <summary>
 /// 初始化游戏状态
 /// </summary>
 private void InitGameState()
 {
     GameStateFactory.Build(m_gameStateMgr);
     m_gameStateMgr.SwitchTo(GameStateID.ST_BOOT, new GameStateParam());
 }