Beispiel #1
0
    void AppendChessToCell(IChessUnit chess, CellUnit cell)
    {
        var to = cell.Layout.Transform;

        chess.Layout.AppendTo(to);
        chess.Index = cell.Index;
    }
Beispiel #2
0
    public void Remove(IChessUnit chess)
    {
        if (!ActiveChesses.Contains(chess))
        {
            return;
        }

        chess.Layout.AppendTo(mIdleRoot);

        ActiveChesses.Remove(chess);
        IdleChesses.Enqueue(chess);
    }
    bool HasAttackChance(IChessUnit chess)
    {
        var startCell = mCells.Get(chess.Index);

        if (GetJumpableCell(startCell, LinkDirection.Up) != null)
        {
            return(true);
        }
        if (GetJumpableCell(startCell, LinkDirection.Bottom) != null)
        {
            return(true);
        }
        if (GetJumpableCell(startCell, LinkDirection.Right) != null)
        {
            return(true);
        }
        if (GetJumpableCell(startCell, LinkDirection.Left) != null)
        {
            return(true);
        }

        return(false);
    }