예제 #1
0
    public int HowManyWillIKill(bool isPlayer1, Square.SquareColour colour)
    {
        int res = 0;

        for (int x = 0; x < 5; x++)
        {
            for (int y = 0; y < 5; y++)
            {
                if (Squares[x, y].Occupant != null && Squares[x, y].SQColour == colour && Squares[x, y].Occupant.GetComponent <Pawn>().Player1Owned != isPlayer1)
                {
                    res++;
                    //    GameManager.GmInst.Moves--;
                }
            }
        }
        return(res);
    }
예제 #2
0
    public void KillColour(bool isPlayer1, Square.SquareColour colour)
    {
        for (int x = 0; x < 5; x++)
        {
            for (int y = 0; y < 5; y++)
            {
                if (Squares[x, y].Occupant != null && Squares[x, y].SQColour == colour && Squares[x, y].Occupant.GetComponent <Pawn>().Player1Owned != isPlayer1)
                {
                    Squares[x, y].Occupant.GetComponent <Pawn>().BeatHome();
                    Squares[x, y].Occupant = null;

                    GameManager.GmInst.GetPointAndMove(isPlayer1);
                    //    GameManager.GmInst.Moves--;
                }
            }
        }
    }
예제 #3
0
    public bool IsNextToColour(Square.SquareColour colour, int x, int y)
    {
        try
        {
            if (Squares[x + 1, y].SQColour == colour)
            {
                return(true);
            }
        }
        catch (System.Exception)
        {
        }

        try
        {
            if (Squares[x - 1, y].SQColour == colour)
            {
                return(true);
            }
        }
        catch (System.Exception)
        {
        }
        try
        {
            if (Squares[x, y + 1].SQColour == colour)
            {
                return(true);
            }
        }
        catch (System.Exception)
        {
        }
        try
        {
            if (Squares[x, y - 1].SQColour == colour)
            {
                return(true);
            }
        }
        catch (System.Exception)
        {
        }
        return(false);
    }