Merge pull request #277 from nitta-lab-2022/drawingCard_endlogic
endStateの呼び出し
commit 27cc7e7a76fb8562bbb3896bfaed8a07525bce3b
2 parents b8f417f + 1cafe00
前田 航汰 authored on 8 Nov 2022
Showing 1 changed file
View
15
app/src/main/java/org/ntlab/irisclient/DrawingCardFragment.java
setOpen(openListObserver);
}
);
 
gameViewModel.getEndStateLiveData().observe (
getViewLifecycleOwner(),
endStateObserver -> {
System.out.println("kota: " + endStateObserver);
if(endStateObserver == 0) {
System.out.println("kota: ゲームが終了!!:" + endStateObserver);
finishGameAlertMake(myTeam, nowTurn);
}
}
);
 
gameViewModel.getTurnsLiveData().observe (
getViewLifecycleOwner(),
turnsObserver -> {
System.out.println("kota: ターンが変更。今のターン:" + turnsObserver);
} else if (colorList.get(i).contains("d")) {
backColors[i].setBackground(resources.getDrawable(R.drawable.black_image));
imageButtons[i].setVisibility(View.INVISIBLE);
gameViewModel.sendEndState();
finishGameAlertMake(i, myTeam, nowTurn);
//finishGameAlertMake(myTeam, nowTurn);
}
setAnime(i);
nowOpenList.set(i, true);
}
 
/**
* 黒いカードがひかれて、ゲームが終わったときに呼ばれるアラート
*/
private void finishGameAlertMake(int cno, String myTeam, String nowTurn) {
private void finishGameAlertMake(String myTeam, String nowTurn) {
String strTitle;
String strMessage;
System.out.println("ゲームが終わった時のmyTeam:" + myTeam);
System.out.println("ゲームが終わった時のmyTurn:" + nowTurn);