package com.ntlab.irisserver.entities; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.ArrayList; import java.util.List; public class TurnJson { @JsonProperty("hint") private String hint; @JsonProperty("team") private String team; @JsonProperty("max") private int max; @JsonProperty("turnstate") private int turnstate; private List<Integer> openlist = new ArrayList<>(); //コンストラクタ public TurnJson(Turn t){ hint = t.getHint(); team = t.getTeam(); max = t.getMax(); openlist = t.getOpenListAll(); turnstate = t.getTurnstate(); } //--------------------------------------------------------- //ゲッター public String getHint() {return hint;} public String getTeam() {return team;} public int getMax() {return max;} public List<Integer> getOpenListAll() {return openlist;} //リストそのものを返す。 public int getTurnstate() {return turnstate;} //--------------------------------------------------------- //セッター public void setHint(String hint) {this.hint = hint;} public void setTeam(String team) {this.team = team;} public void setMax(int max) {this.max = max;} public void setTurnstate(int turnstate) {this.turnstate = turnstate;} //--------------------------------------------------------- //openlist操作 public Integer getOpenListSolo(int num){return openlist.get(num);} public void addOpenList(Integer cno){openlist.add(cno);} public void delieteOpenList(int num){openlist.remove(num);} public int sizeOpenList(){return openlist.size();} }