package com.ntlab.irisserver.entities; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class Game { private Map<Member, List<Integer>> assignments = new HashMap<>(); private Map<Integer, Drawing> drawingList = new HashMap<>(); private Map<Integer, String> keywordList = new HashMap<>(); private List<Integer> map = new ArrayList<>(); private List<String> color = new ArrayList<>(); private String turn = "none"; private List<Boolean> opens = new ArrayList<>(); private DrawingController drawingController = null; public Game(Room room) { drawingController = new DrawingController(room, room.getMembers(), this); List<Member> memberList = room.getMembers(); //デバッグ用に値を追加 int cnt = 0; for (int i=0; i<memberList.size(); i++){ List<Integer> dnos = new ArrayList<>(); for(int j=0; j<3; j++){ dnos.add(cnt); cnt++; } assignments.put(memberList.get(i), dnos); } // } public DrawingController getDrawingController() { return drawingController; } public Drawing getDrawing(int dno) { Drawing d = drawingList.get(dno); return d; } public Map<Integer, Drawing> getDrawings(){ return drawingList; } public Drawing putDrawing(int dno, Drawing drawing) { Drawing d = drawingList.put(dno, drawing); drawingController.update(); return d; } public String getKeyword(int dno) { String keyword = keywordList.get(dno); return keyword; } public List<String> getKeywords() { List<String> keywords = new ArrayList<>(keywordList.values()); return keywords; } public Map<Member, List<Integer>> getAssignments(){ return assignments; } public List<Integer> getMap(){ return map; } public List<String> getColor(){ return color; } public String getTurn(){ return turn; } public List<Boolean> getOpens(){ return opens; } }