Esempio n. 1
0
        public void Store(PlayerOnegaiModel playerOnegaiModel)
        {
            var entry = this.GetEntry(playerOnegaiModel.Id);

            if (entry != null)
            {
                var index = this.entrys.IndexOf(entry);
                this.entrys[index] = new PlayerOnegaiEntry()
                {
                    Id              = playerOnegaiModel.Id,
                    OnegaiId        = playerOnegaiModel.OnegaiModel.Id,
                    OnegaiState     = playerOnegaiModel.OnegaiState.ToString(),
                    StartOnegaiTime = playerOnegaiModel.StartOnegaiTime
                };
            }
            else
            {
                this.entrys.Add(new PlayerOnegaiEntry()
                {
                    Id              = playerOnegaiModel.Id,
                    OnegaiId        = playerOnegaiModel.OnegaiModel.Id,
                    OnegaiState     = playerOnegaiModel.OnegaiState.ToString(),
                    StartOnegaiTime = playerOnegaiModel.StartOnegaiTime
                });
            }
            PlayerContextMap.WriteEntry(this.entrys);
        }
Esempio n. 2
0
        public override void SetRewardAmount(IRewardAmount rewardAmount)
        {
            var onegaiRewardAmount = rewardAmount as OnegaiRewardAmount;

            Debug.Assert(onegaiRewardAmount != null, "onegaiRewardAmountがnullです");
            this.playerOnegaiModel = this.playerOegaiRepository.GetById(onegaiRewardAmount.OnegaiId);
            this.rewardOnegaiView.UpdateView(this.playerOnegaiModel.OnegaiModel.Title);
        }
Esempio n. 3
0
 public void SetOnegaiDetail(PlayerOnegaiModel playerOnegaiModel)
 {
     this.onegaiDetailView.UpdateCell(
         playerOnegaiModel.OnegaiModel.Title,
         playerOnegaiModel.OnegaiModel.Detail,
         "依頼人 : " + playerOnegaiModel.OnegaiModel.Author,
         playerOnegaiModel.HasSchedule(),
         playerOnegaiModel.CloseTime(),
         playerOnegaiModel.OnegaiModel.Satisfaction.ToString());
 }
Esempio n. 4
0
        public PlayerOnegaiModel GetById(uint id)
        {
            var foundEntry = this.GetEntry(id);

            if (foundEntry == null)
            {
                var onegaiModel = this.onegaiRepository.Get(id);
                Debug.Assert(onegaiModel != null, "OnegaiModel がありません : " + id.ToString());

                var playerOnegaiModel = new PlayerOnegaiModel(
                    id,
                    onegaiModel,
                    OnegaiState.Lock.ToString(),
                    GameManager.Instance.TimeManager.ElapsedTime // なんか微妙な気もするが
                    );
                return(playerOnegaiModel);
            }
            return(GeneratePlayerOnegaiModel(foundEntry));
        }
Esempio n. 5
0
 private void ShowDetail(PlayerOnegaiModel playerOnegaiModel)
 {
     GameManager.Instance.GameUIManager.OnegaiDetailPresenter.SetOnegaiDetail(playerOnegaiModel);
     GameManager.Instance.GameUIManager.OnegaiDetailPresenter.Show();
 }