パッケージ org.aiwolf.server

クラス GameData


  • public class GameData
    extends java.lang.Object
    Record game information of a day
    作成者:
    tori
    • フィールドの詳細

      • day

        protected int day
        The day of the data
      • agentStatusMap

        protected java.util.Map<Agent,​Status> agentStatusMap
        status of each agents
      • agentRoleMap

        protected java.util.Map<Agent,​Role> agentRoleMap
        roles of each agents
      • talkList

        protected java.util.List<Talk> talkList
      • whisperList

        protected java.util.List<Talk> whisperList
      • voteList

        protected java.util.List<Vote> voteList
      • latestVoteList

        protected java.util.List<Vote> latestVoteList
        直近の投票リスト
        The latest list of votes.
      • attackVoteList

        protected java.util.List<Vote> attackVoteList
      • latestAttackVoteList

        protected java.util.List<Vote> latestAttackVoteList
        直近の襲撃投票リスト
        The latest list of votes for attack.
      • remainTalkMap

        protected java.util.Map<Agent,​java.lang.Integer> remainTalkMap
      • remainWhisperMap

        protected java.util.Map<Agent,​java.lang.Integer> remainWhisperMap
      • divine

        protected Judge divine
        Result of divination
      • guard

        protected Guard guard
        Guard
      • executed

        protected Agent executed
        executed agent
      • attackedDead

        protected Agent attackedDead
        昨夜人狼に襲われ死亡したエージェント
        the agent who died last night because of the attack by werewolf.
      • attacked

        protected Agent attacked
        昨夜人狼が襲ったエージェント(成否は問わない)
        the agent werewolves attacked last night (no matter whether or not the attack succeeded)
      • cursedFox

        protected Agent cursedFox
        呪殺された妖狐
        the fox killed by curse
      • lastDeadAgentList

        protected java.util.List<Agent> lastDeadAgentList
        昨夜死亡したエージェントのリスト
        the list of agents who died last night
      • suddendeathList

        protected java.util.List<Agent> suddendeathList
        agents who sudden death
      • dayBefore

        protected GameData dayBefore
        game data of one day before
      • talkIdx

        protected int talkIdx
      • wisperIdx

        protected int wisperIdx
      • gameSetting

        protected GameSetting gameSetting
        ゲームの設定
    • コンストラクタの詳細

      • GameData

        public GameData​(GameSetting gameSetting)
    • メソッドの詳細

      • getGameInfo

        public GameInfo getGameInfo​(Agent agent)
        get specific game information
        パラメータ:
        agent -
        戻り値:
      • getFinalGameInfo

        public GameInfo getFinalGameInfo​(Agent agent)
        get final game information
        パラメータ:
        agent -
        戻り値:
      • getGameInfo

        public GameInfo getGameInfo()
        get game info with all information
        戻り値:
      • getGameInfoToSend

        public GameInfoToSend getGameInfoToSend​(Agent agent)
        パラメータ:
        agent - - if null, get all information
        戻り値:
      • addAgent

        public void addAgent​(Agent agent,
                             Status status,
                             Role role)
        Add new agent with their role
        パラメータ:
        agent -
        status -
        role -
      • getAgentList

        public java.util.List<Agent> getAgentList()
        get agents
        戻り値:
      • getStatus

        public Status getStatus​(Agent agent)
        get status of agent
        パラメータ:
        agent -
      • getRole

        public Role getRole​(Agent agent)
        パラメータ:
        agent -
        戻り値:
      • addTalk

        public void addTalk​(Agent agent,
                            Talk talk)
        パラメータ:
        agent -
        talk -
      • addWhisper

        public void addWhisper​(Agent agent,
                               Talk whisper)
      • addVote

        public void addVote​(Vote vote)
        Add vote data
        パラメータ:
        vote -
      • addDivine

        public void addDivine​(Judge divine)
        Add divine
        パラメータ:
        divine -
      • addGuard

        public void addGuard​(Guard guard)
      • addAttack

        public void addAttack​(Vote attack)
      • getVoteList

        public java.util.List<Vote> getVoteList()
      • setExecutedTarget

        public void setExecutedTarget​(Agent executed)
        set executed
        パラメータ:
        target -
      • setAttackedTarget

        public void setAttackedTarget​(Agent attacked)
        パラメータ:
        attacked -
      • getAttackVoteList

        public java.util.List<Vote> getAttackVoteList()
        戻り値:
      • getGuard

        public Guard getGuard()
        戻り値:
      • getDay

        public int getDay()
        戻り値:
        day
      • getTalkList

        public java.util.List<Talk> getTalkList()
        戻り値:
        talkList
      • getWhisperList

        public java.util.List<Talk> getWhisperList()
        戻り値:
        wisperList
      • getDivine

        public Judge getDivine()
        戻り値:
        divine
      • getExecuted

        public Agent getExecuted()
        戻り値:
        executed
      • getAttacked

        public Agent getAttacked()
        昨夜人狼が襲ったエージェント(成否は問わない)を返す
        Returns the agent werewolves attacked last night (no matter whether or not the attack succeeded).
        戻り値:
        attackedAgent -
        昨夜人狼が襲ったエージェント
        the agent werewolves attacked last night
      • addLastDeadAgent

        public void addLastDeadAgent​(Agent agent)
        昨夜死亡したエージェントを追加する
        Adds the agent who died last night.
        パラメータ:
        agent -
        追加するエージェント
        the agent to be added
      • getLastDeadAgentList

        public java.util.List<Agent> getLastDeadAgentList()
        戻り値:
        昨夜死亡したエージェントのリスト
        the list of agents who died last night
      • getSuddendeathList

        public java.util.List<Agent> getSuddendeathList()
        戻り値:
        suddendeathList
      • getRemainTalkMap

        public java.util.Map<Agent,​java.lang.Integer> getRemainTalkMap()
        戻り値:
        remainTalkMap
      • getRemainWhisperMap

        public java.util.Map<Agent,​java.lang.Integer> getRemainWhisperMap()
        戻り値:
        remainTalkMap
      • nextDay

        public GameData nextDay()
        Create GameData of next day
        戻り値:
      • getDayBefore

        public GameData getDayBefore()
        get game data of one day before
        戻り値:
      • getFilteredAgentList

        protected java.util.List<Agent> getFilteredAgentList​(java.util.List<Agent> agentList,
                                                             Species species)
      • getFilteredAgentList

        protected java.util.List<Agent> getFilteredAgentList​(java.util.List<Agent> agentList,
                                                             Status status)
      • getFilteredAgentList

        protected java.util.List<Agent> getFilteredAgentList​(java.util.List<Agent> agentList,
                                                             Role role)
      • getFilteredAgentList

        protected java.util.List<Agent> getFilteredAgentList​(java.util.List<Agent> agentList,
                                                             Team team)
      • nextTalkIdx

        public int nextTalkIdx()
      • nextWhisperIdx

        public int nextWhisperIdx()
      • getAttackedDead

        public Agent getAttackedDead()
        昨夜人狼に襲われ死亡したエージェントを返す.
        Returns the agent who died last night because of the attack by werewolf.
        戻り値:
        the attackedDead
      • setAttackedDead

        public void setAttackedDead​(Agent attackedDead)
        昨夜人狼に襲われ死亡したエージェントをセットする.
        Sets the agent who died last night because of the attack by werewolf.
        パラメータ:
        attackedDead - the attackedDead to set
      • getCursedFox

        public Agent getCursedFox()
        呪殺された妖狐を返す.
        Returns the fox killed by curse.
        戻り値:
        呪殺された妖狐
        the fox killed by curse
      • setCursedFox

        public void setCursedFox​(Agent cursedFox)
        呪殺された妖狐をセットする.
        Sets the fox killed by curse.
        パラメータ:
        cursedFox -
        呪殺された妖狐
        the fox killed by curse
      • getLatestVoteList

        public java.util.List<Vote> getLatestVoteList()
        直近の投票リストを返す
        Returns the latest list of votes.
        戻り値:
        投票リストを表すList<Vote>
        List<Vote> representing the list of votes.
      • setLatestVoteList

        public void setLatestVoteList​(java.util.List<Vote> latestVoteList)
        直近の投票リストをセットする
        Sets the latest list of votes.
        パラメータ:
        latestVoteList -
        投票リストを表すList<Vote>
        List<Vote> representing the list of votes.
      • getLatestAttackVoteList

        public java.util.List<Vote> getLatestAttackVoteList()
        直近の襲撃投票リストを返す
        Returns the latest list of votes for attack.
        戻り値:
        投票リストを表すList<Vote>
        List<Vote> representing the list of votes.
      • setLatestAttackVoteList

        public void setLatestAttackVoteList​(java.util.List<Vote> latestAttackVoteList)
        直近の襲撃投票リストをセットする
        Sets the latest list of votes for attack.
        パラメータ:
        latestAttackVoteList -
        投票リストを表すList<Vote>
        List<Vote> representing the list of votes.
      • contains

        public boolean contains​(Agent target)
        指定エージェントがゲームに含まれているかどうかを調べる
        Check whether the agents is joining in game.
        パラメータ:
        latestAttackVoteList -
        含まれているかどうかboolean
        boolean is contains in the game.