示例#1
0
        /// <summary>
        /// Finishes the game.
        /// </summary>
        void Finish()
        {
            if (GameLogger != null)
            {
                foreach (var agent in OrderedAgentList)
                {
                    GameLogger.Log($"{Day},status,{agent.AgentIdx},{RoleOf(agent)},{StatusOf(agent)},{agentNameMap[agent]}");
                }
                GameLogger.Log($"{Day},result,{AliveHumanList.Count},{AliveWolfList.Count},{GetWinner()}");
                GameLogger.Close();
            }

            foreach (var agent in AgentList)
            {
                gameServer.Finish(agent);
            }
        }
示例#2
0
        public void Finish()
        {
            if (GameLogger != null)
            {
                foreach (Agent agent in gameData.AgentList.OrderBy(x => x.AgentIdx))
                {
                    GameLogger.Log(string.Format("{0},status,{1},{2},{3},{4}", gameData.Day, agent.AgentIdx, gameData.GetRole(agent), gameData.GetStatus(agent), agentNameMap[agent]));
                }
                GameLogger.Log(string.Format("{0},result,{1},{2},{3}", gameData.Day, AliveHumanList.Count, AliveWolfList.Count, GetWinner()));
                GameLogger.Close();
            }

            foreach (Agent agent in gameData.AgentList)
            {
                gameServer.Finish(agent);
            }
        }