public void Sync(GameProto.GameNotifyPlayerGameTetrisData oTetris) { m_dwTetrisPool = new uint[s_dwRow, s_dwColumn]; for (int i = 0; i < s_dwRow; i++) { for (int j = 0; j < s_dwColumn; j++) { m_dwTetrisPool[i, j] = oTetris.DwData[i * (int)s_dwColumn + j]; } } m_oCurrentTetris.Init(oTetris.CurrTetris); m_oNextTetris.Init(oTetris.NextTetris); m_bNeedRefresh = true; }
public void OnGameNotifyPlayerGameTetrisData(byte[] pBuf) { GameProto.GameNotifyPlayerGameTetrisData oRet = GameProto.GameNotifyPlayerGameTetrisData.Parser.ParseFrom(pBuf); if (oRet == null) { SampleDebuger.LogYellow("GameNotifyPlayerGameInitTetris error parse"); return; } TetrisData pTetrisData = TetrisDataManager.Instance().GetTetrisData(oRet.DwPlayerId); if (pTetrisData == null) { SampleDebuger.LogYellow("can't find tetris data player id : " + oRet.DwPlayerId.ToString()); return; } pTetrisData.Sync(oRet); }