Newer
Older
RxSprout / app / src / main / java / com / example / sprout / rooms / Room.java
package com.example.sprout.rooms;

import net.arnx.jsonic.JSONHint;

import java.util.HashMap;

public class Room {

    public String roomName;             //ルーム名
    public boolean keyCheck;             //鍵の有無
    public String hostName;             //ホスト名
    public int roomId;                  //ルームID
    public HashMap<Integer, Member> memberList = new HashMap<Integer, Member>();
    public boolean readyToFight = false;    //全員準備完了したか判定
    public boolean startFrag;
    public int battleId = -1;

    public Room() {

    }

    //ルーム名を取得
    @JSONHint(ignore = true)
    public String getRoomName() {
        return roomName;
    }

    //ホスト名を取得
    @JSONHint(ignore = true)
    public String getHostName() {
        return hostName;
    }

    //ルームIDを取得
    @JSONHint(ignore = true)
    public int getRoomId() {
        return roomId;
    }

    //メンバー数を取得
    @JSONHint(ignore = true)
    public int getMemberCount() {
        return memberList.size();
    }

    //メンバーの情報を取得
    @JSONHint(ignore = true)
    public Member getMenmber(int index) {
        return memberList.get(index);
    }

    @JSONHint(ignore = true)
    public Member getMemberByIndex(int index) {
        Object room[] = memberList.values().toArray();
        return (Member) room[index];
    }

    //キーチェックを取得
    @JSONHint(ignore = true)
    public boolean getKeyCheck() {
        return keyCheck;
    }

    @JSONHint(ignore = true)
    public boolean isReadyToFight() {
        return readyToFight;
    }

    @JSONHint(ignore = true)
    public boolean getStartFrag() {
        return startFrag;
    }

    //バトルID
    public int getBattleId() {
        return battleId;
    }

    public void setBattleId(int battleId) {
        this.battleId = battleId;
    }
}