示例#1
0
    internal void SetFocusPiece(GamePiece piece)
    {
        if (m_CurrentFocusPiece == piece)
        {
            m_CurrentFocusPiece = null;
            m_GameBoardRelative.ClearCurrentSelections();

            piece.DeactivateRotationCanvas();
        }

        if (m_CurrentFocusPiece != null && m_CurrentFocusPiece != piece &&
            (m_GameBoardRelative.SelectionType == SelectionType.Target || m_GameBoardRelative.SelectionType == SelectionType.Attack))
        {
            GameBoardTile tile = m_GameBoardRelative.GetTileByVector(piece.BoardVector);

            if (m_GameBoardRelative.CurrentlySelectedTiles.Contains(tile))
            {
                m_CurrentFocusPiece.HandleAttackSelection(tile);
                return;
            }
        }

        if (m_CurrentFocusPiece == null || (m_CurrentFocusPiece != null && !m_CurrentFocusPiece.IsActivelyEngaged))
        {
            if (m_CurrentFocusPiece != null)
            {
                m_CurrentFocusPiece.DeactivateRotationCanvas();
                m_GameBoardRelative.ClearCurrentSelections();
            }

            m_CurrentFocusPiece = piece;
        }

        if (!m_CurrentFocusPiece.IsActivelyEngaged &&
            (AccountManager.AccountInstance == null || m_CurrentFocusPiece.UnderLocalControl))
        {
            if (m_GameBoardRelative.GetHorizontalTiles
                    (m_GameBoardRelative.GetTileByVector(piece.BoardVector), 1, true).Length > 0)
            {
                m_GameBoardRelative.SelectTilesInRange
                    (piece.BoardVector, piece.MovementRange, SelectionType.Movement, true, false);
            }
        }
    }
示例#2
0
 void PrepareAttack_SingleTarget()
 {
     m_ParentBoard.SelectTilesInRange
         (BoardVector, m_AttackState.TargetRange, SelectionType.Target, false, false);
 }
示例#3
0
 internal void SelectTilesInRange(int range, bool queryPassable, SelectionType selectionType)
 {
     m_ParentBoard.SelectTilesInRange(this, range, selectionType, queryPassable);
 }