void NewBlockTeam() { EnqueueBlockTeam(); BlockTeam bt = m_BlockTeamQueue.Dequeue(); InitBlockTeamPos(bt); m_CurBlockTeam = bt; m_DropDownBT = m_CurBlockTeam.Clone(); m_CurBlockTeam.OnBlockMove += OnCurBlockTeamUpdate; m_CurBlockTeam.OnBlockRot += OnCurBlockTeamUpdate; OnCurBlockTeamUpdate(); }
public void OnRot() { if (m_CurBlockTeam == null) { return; } BlockTeam bt = m_CurBlockTeam.Clone(); bt.Rot(); if (!IsCollide(bt, BT_Move_Type.BTM_None)) { m_CurBlockTeam.Rot(); } else { BlockTeam btLeft = bt; BlockTeam btRight = bt.Clone(); for (int i = 0; i < bt.GetBlockWidth(); i++) { btLeft.MoveLeft(); if (!IsCollide(btLeft, BT_Move_Type.BTM_None)) { m_CurBlockTeam.Rot(); for (int j = i; j >= 0; j--) { m_CurBlockTeam.MoveLeft(); } break; } btRight.MoveRight(); if (!IsCollide(btRight, BT_Move_Type.BTM_None)) { m_CurBlockTeam.Rot(); for (int j = i; j >= 0; j--) { m_CurBlockTeam.MoveRight(); } break; } } } }