示例#1
0
        /// <summary>
        /// 情報を更新する
        /// </summary>
        /// <param name="gameInfo"></param>
        public void Update(GameInfo gameInfo)
        {
            // Talk、Whisperを追加登録する
            ApendTalkList(gameInfo);

            if (NightAliveAgent == null)
            {
                // 追放再投票になった直後の処理
                // 第3回大会では再投票1回なので大丈夫だが、2回以上の場合は要改良
                if (gameInfo.LatestExecutedAgent != null && gameInfo.LatestVoteList.Count > 0)
                {
                    VoteList.Add(gameInfo.LatestVoteList);
                }

                // 襲撃再投票になった直後の処理
                // 第3回大会では再投票1回なので大丈夫だが、2回以上の場合は要改良
                if (gameInfo.LatestAttackVoteList.Count > 0)
                {
                    AttackVoteList.Add(gameInfo.LatestAttackVoteList);
                }

                // 夜になった直後の処理
                if (gameInfo.LatestExecutedAgent != null)
                {
                    ExecuteAgent    = gameInfo.LatestExecutedAgent;
                    NightAliveAgent = gameInfo.AliveAgentList;

                    VoteList.Add(gameInfo.VoteList);
                }
            }
        }
示例#2
0
        /// <summary>
        /// 情報を更新する(翌日のデータから)
        /// </summary>
        public void UpdateFromTomorrow(GameInfo gameInfo)
        {
            AttackDeadAgent = gameInfo.LastDeadAgentList;

            GuardAgent     = gameInfo.GuardedAgent;
            TryAttackAgent = gameInfo.AttackedAgent;

            if (NightAliveAgent == null)
            {
                // 夜のデータが設定されていない場合(夜の行動が無い役職)
                ExecuteAgent = gameInfo.ExecutedAgent;

                NightAliveAgent = new List <Agent>(DayTimeAliveAgent);
                NightAliveAgent.Remove(ExecuteAgent);

                VoteList.Add(gameInfo.VoteList);
            }
            else
            {
                // 夜のデータが設定されている場合(夜の行動が有る役職)
                if (gameInfo.AttackVoteList.Count > 0)
                {
                    AttackVoteList.Add(gameInfo.AttackVoteList);
                }
            }
        }
示例#3
0
        public VoteList Add(VoteListDto addedVoteList)
        {
            var voteList = new VoteList()
            {
                Name   = addedVoteList.Name,
                Count  = addedVoteList.Count ?? 0,
                VoteId = addedVoteList.VoteId.Value,
            };

            _domainContext.VoteLists.Add(voteList);
            return(voteList);
        }
示例#4
0
 /// <summary>
 /// Add vote data.
 /// </summary>
 /// <param name="vote"></param>
 public void AddVote(Vote vote)
 {
     VoteList.Add(vote);
 }
示例#5
0
 public VoteListTests()
 {
     repoMock = new Mock <VoteRepo>(null);
     voteList = new VoteList(repoMock.Object);
 }
 public VoteApiController(VoteList voteList, ProjectList projectList, LocationService locationService)
 {
     this.voteList        = voteList;
     this.locationService = locationService;
     this.projectList     = projectList;
 }
 /// <summary>
 /// insert vote data
 /// </summary>
 /// <param name="Id">login Id</param>
 /// <param name="className">which vote class</param>
 /// <param name="fK_Vote_ItemCatalogId">vote item</param>
 /// <returns></returns>
 public bool Post([FromBody] VoteList voteList)
 {
     return(this._voteService.InsertVote_Mapping(voteList.Id, voteList.ClassName, voteList.FK_Vote_ItemCatalogIdList));
 }