Ejemplo n.º 1
0
    //gameover时返回-1,胜利时返回1
    public int checkGameOver()
    {
        Debug.Log("check for game over");

        if (boat.boatStatus == 0)
        {
            if (fromCoast.check_over(boat) || toCoast.check_over())
            {
                return(-1);
            }
        }
        else
        {
            Debug.Log("to coast check");
            if (fromCoast.check_over() || toCoast.check_over(boat))
            {
                return(-1);
            }
        }

        if (toCoast.check_win())
        {
            return(1);
        }

        return(0);
    }