NextTurn() public method

public NextTurn ( byte nextPlayer, bool force ) : void
nextPlayer byte
force bool
return void
コード例 #1
0
ファイル: Handler.cs プロジェクト: drilus/OCTGN
        //public void CreateAlias(int[] id, ulong[] type)
        //{
        //    short s = _clients[_sender].Id;
        //    for (int i = 0; i < id.Length; i++)
        //        id[i] = s << 16 | (id[i] & 0xffff);
        //    _broadcaster.CreateAlias(id, type);
        //}

        public void NextTurn(byte nextPlayer, bool setActive, bool force)
        {
            if (!force)
            {
                // find the first phase that a player has stopped
                var firstStop = _phaseStops.Where(x => x.Item1 > _phaseNumber).OrderBy(x => x.Item1).FirstOrDefault();
                if (firstStop != null) //if there's a phase stop set
                {
                    var stopPlayers = _phaseStops.Where(x => x.Item1 == firstStop.Item1).Select(x => x.Item2);
                    _phaseNumber = firstStop.Item1;
                    _broadcaster.SetPhase(_phaseNumber, stopPlayers.ToArray(), force);
                    return;
                }
                // check if a player has the end of turn stopped
                if (_turnStopPlayers.Count > 0)
                {
                    byte stopPlayerId = _turnStopPlayers.First();
                    _turnStopPlayers.Remove(stopPlayerId);
                    _broadcaster.StopTurn(stopPlayerId);
                    return;
                }
            }
            _turnNumber++;
            _phaseNumber = 0;
            _broadcaster.NextTurn(nextPlayer, setActive, force);
        }
コード例 #2
0
ファイル: Handler.cs プロジェクト: totalgit/OCTGN
 public void NextTurn(byte nextPlayer)
 {
     if (_turnStopPlayers.Count > 0)
     {
         byte stopPlayerId = _turnStopPlayers.First();
         _turnStopPlayers.Remove(stopPlayerId);
         _broadcaster.StopTurn(stopPlayerId);
         return;
     }
     _turnNumber++;
     _broadcaster.NextTurn(nextPlayer);
 }
コード例 #3
0
ファイル: Handler.cs プロジェクト: nickgroenke/OCTGN
        //public void CreateAlias(int[] id, ulong[] type)
        //{
        //    short s = _clients[_sender].Id;
        //    for (int i = 0; i < id.Length; i++)
        //        id[i] = s << 16 | (id[i] & 0xffff);
        //    _broadcaster.CreateAlias(id, type);
        //}

        public void NextTurn(byte nextPlayer, bool force)
        {
            if (_turnStopPlayers.Count > 0 && force == false)
            {
                byte stopPlayerId = _turnStopPlayers.First();
                _turnStopPlayers.Remove(stopPlayerId);
                _broadcaster.StopTurn(stopPlayerId);
                return;
            }
            _turnNumber++;
            _phaseStopPlayers.Clear();
            _broadcaster.NextTurn(nextPlayer, force);
        }