Newer
Older
IrisServer / src / main / java / com / ntlab / irisserver / entities / Game.java
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 DrawingController drawingController = null;

    public Game(Room room) {
        drawingController = new DrawingController(room, room.getMembers(), this);
    }

    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;
    }
}