diff --git a/src/main/java/com/ntlab/irisserver/entities/Game.java b/src/main/java/com/ntlab/irisserver/entities/Game.java index 1e53d0a..4f732bd 100644 --- a/src/main/java/com/ntlab/irisserver/entities/Game.java +++ b/src/main/java/com/ntlab/irisserver/entities/Game.java @@ -9,16 +9,18 @@ private Map keywordList = new HashMap<>(); private List map = new ArrayList<>(); private List color = new ArrayList<>(); - private String turn = "none"; + //private String turn = "none"; private List opens = new ArrayList<>(); private DrawingController drawingController = null; - private Settings settings; + private Settings settings = null; + private List turnList = new ArrayList<>(); + private Turn nowTurn = null; public Game(Room room) { this.settings = room.getSettings(); for(int i=0; i<16; i++) map.add(i); - Collections.shuffle(map);//0~16のdnoをランダムにマップに割り振る + Collections.shuffle(map);//0~15のdnoをランダムにマップに割り振る //r:6 b:5 g:4, d:1 for(int i=0; i<6; i++) color.add("r"); @@ -82,8 +84,10 @@ public List getColor(){ return color; } - public String getTurn(){ - return turn; + + public String getTeam(){ + String team = nowTurn.getTeam(); + return team; } public List getOpens(){ @@ -92,4 +96,14 @@ public Settings getSettings(){ return this.settings; } + + public void createTurn(){ + nowTurn = new Turn(); + if(turnList.size()%2==0){//偶数ターンなら青い色,奇数ターンは赤色 + nowTurn.setTeam("b"); + }else{ + nowTurn.setTeam("r"); + } + this.turnList.add(nowTurn); + } }