public void SetPlayer(System.UInt64 qwPlayerId) { if (m_mapTetrisDatas.ContainsKey(qwPlayerId)) { return; } m_mapTetrisDatas[qwPlayerId] = new TetrisData(); }
public UserOperation(TetrisData data, TetriminoFactory factory, TetrisDifficultySettings difficultySettings, IInput input) : base(data) { Assert.IsNotNull(factory); Assert.IsNotNull(difficultySettings); Assert.IsNotNull(input); this.factory = factory; this.difficultySettings = difficultySettings; this.input = input; fieldAnalyzer = new FieldAnalyzer(data.Field); }
public void OnGameNotifyPlayerGameConfig(byte[] pBuf) { GameProto.GameNotifyPlayerGameConfig oRet = GameProto.GameNotifyPlayerGameConfig.Parser.ParseFrom(pBuf); if (oRet == null) { SampleDebuger.LogYellow("OnGameNotifyPlayerGameConfig error parse"); return; } TetrisData.InitGameConfig(oRet); }
public void SetTetrisData(TetrisData oData, System.UInt64 qwPlayerId) { m_oData = oData; if (qwPlayerId == PlayerData.Instance().proPlayerId) { m_goOperator.SetActive(true); } else { m_goOperator.SetActive(false); } }
public void OnGameNotifyPlayerGameState(byte[] pBuf) { GameProto.GameNotifyPlayerGameState oRet = GameProto.GameNotifyPlayerGameState.Parser.ParseFrom(pBuf); if (oRet == null) { SampleDebuger.LogYellow("OnGameNotifyPlayerGameState error parse"); return; } SampleDebuger.LogBlue("game state : " + oRet.State.ToString()); GameData.Instance().SetGameSceneState(oRet.State); if (UnityEngine.SceneManagement.SceneManager.GetActiveScene().name != SysUtil.GetScesneNameBySceneState(oRet.State)) { AssetBundleLoader.Instance().LoadLevelAsset(SysUtil.GetScesneNameBySceneState(oRet.State), delegate() { SampleDebuger.LogBlue("game state load level : " + SysUtil.GetScesneNameBySceneState(oRet.State)); } ); } switch (oRet.State) { case GameProto.EGameSceneState.EssNone: break; case GameProto.EGameSceneState.EssPrepare: case GameProto.EGameSceneState.EssGameReady: { } break; case GameProto.EGameSceneState.EssGaming: { ReadyTime.SetGameBegin(); } break; case GameProto.EGameSceneState.EssTransact: { } break; default: { SampleDebuger.LogError("error game state : " + ((uint)(oRet.State)).ToString()); } break; } TetrisData.SetGameSceneState(oRet.State); }
public void OnGameNotifyPlayerNextTetris(byte[] pBuf) { GameProto.GameNotifyPlayerNextTetris oRet = GameProto.GameNotifyPlayerNextTetris.Parser.ParseFrom(pBuf); if (oRet == null) { SampleDebuger.LogYellow("GameNotifyPlayerNextTetris 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); }
public void OnGameNotifyPlayeRotation(byte[] pBuf) { GameProto.GameNotifyPlayeRotation oRet = GameProto.GameNotifyPlayeRotation.Parser.ParseFrom(pBuf); if (oRet == null) { SampleDebuger.LogYellow("GameNotifyPlayeRotation 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; } if (!pTetrisData.TetrisOperator(oRet.EDirection)) { SampleDebuger.LogYellow("error rotation : " + oRet.EDirection.ToString()); } SampleDebuger.LogBlue(string.Format("player : {0} rot dir {1}", oRet.DwPlayerId.ToString(), oRet.EDirection.ToString())); }
public Wait(TetrisData data) : base(data) { }
public GameOver(TetrisData data) : base(data) { }
protected Base(TetrisData data) { this.data = data; }
public Ground(TetrisData data, float interval) : base(data) { this.interval = interval; }