diff --git a/src/main/java/com/ntlab/irisserver/entities/Room.java b/src/main/java/com/ntlab/irisserver/entities/Room.java index b0c6d02..a603c2d 100644 --- a/src/main/java/com/ntlab/irisserver/entities/Room.java +++ b/src/main/java/com/ntlab/irisserver/entities/Room.java @@ -54,6 +54,45 @@ } public void changeTeamAndMaster(String nick, String belongs, boolean isMaster) { + //上に追加するもの + /*private Member RedMaster; + private Member BlueMaster;*/ + + //この関数のコメント + //メンバーの情報を変更する + + //変更するメンバーを取得 + Member m = members.get(nick); + + //変更先のチームが満員の場合、変更はなし + if(m.getBelongs() != belongs){ + + //変更先のチームの人数を数える + int memberscount = 0; + List membersList = new ArrayList(members.values()) ; + + for(Member mem :membersList){ + if(mem.getBelongs() == belongs){ + memberscount++; + } + } + + //変更先のチームが満員であれば変更せずに返す + if(memberscount >= 8) { + return; + }else{ + m.setBelongs(belongs); + } + + } + + //マスターを変更 + if(belongs == "r"){ + + + + } + }