public int GameOver() { int[] srcnum = src.getRolesNum(); int[] dstnum = dst.getRolesNum(); int[] boatnum = boat.getRolesNum(); if (dst.getEmptyIndex() == -1) { return(2); } if (boat.getPos() == 1) { if ((srcnum[0] == 0 || srcnum[0] >= srcnum[1]) && (dstnum[0] == 0 || dstnum[0] >= dstnum[1])) { return(0); } } else if (boat.getPos() == 0) { if (srcnum[0] + boatnum[0] == 0 || srcnum[0] + boatnum[0] >= srcnum[1] + boatnum[1]) { return(0); } } else { if (dstnum[0] + boatnum[0] == 0 || dstnum[0] + boatnum[0] >= dstnum[1] + boatnum[1]) { return(0); } } return(1); }
public int GameOver() { return(judge.judgment(boat.getPos(), src.getRolesNum(), dst.getRolesNum(), boat.getRolesNum())); }