public void Move(Point2D position) { MahjongPieceDim dim = GetDimensions(position); if (!dim.IsValid()) { return; } m_Position = position; m_Game.Players.SendGeneralPacket(true, true); }
public void Move(Point2D position, MahjongPieceDirection direction, bool flip, int validHandArea) { MahjongPieceDim dim = GetDimensions(position, direction); int curHandArea = Dimensions.GetHandArea(); int newHandArea = dim.GetHandArea(); if (!IsMovable || !dim.IsValid() || (validHandArea >= 0 && ((curHandArea >= 0 && curHandArea != validHandArea) || (newHandArea >= 0 && newHandArea != validHandArea)))) { return; } m_Position = position; m_Direction = direction; m_StackLevel = -1; // Avoid self interference m_StackLevel = m_Game.GetStackLevel(dim) + 1; m_Flipped = flip; m_Game.Players.SendTilePacket(this, true, true); }