Example #1
0
        public PlayerAppearCharacterViewModel Create(
            Vector3 position,
            Vector3 rotation,
            PlayerAppearCharacterReserveModel playerAppearCharacterReserveModel
            )
        {
            var id = this.MaximuId() + 1;

            var entry = new PlayerAppearCharacterViewEntry()
            {
                Id       = id,
                Position = new Position3Entry()
                {
                    X = position.x,
                    Y = position.y,
                    Z = position.z,
                },
                Rotation = new Position3Entry()
                {
                    X = rotation.x,
                    Y = rotation.y,
                    Z = rotation.z,
                },
                PlayerAppearCharacterReserveId = playerAppearCharacterReserveModel.Id,
                IsReceiveReward = false /*はじめはまだ受け取っていない*/
            };

            this.entrys.Add(entry);
            PlayerContextMap.WriteEntry(this.entrys);
            return(CreateByEntry(entry));
        }
 public AppearCharacterGenerator(PlayerAppearCharacterReserveModel playerAppearCharacterReserveModel)
 {
     this.appearCharacterModel = playerAppearCharacterReserveModel.AppearCharacterModel;
     this.conversationModel    = playerAppearCharacterReserveModel.ConversationModel;
     this.rewardModel          = playerAppearCharacterReserveModel.RewardModel;
     this.playerAppearCharacterReserveModel = playerAppearCharacterReserveModel;
 }
Example #3
0
 public PlayerAppearCharacterViewModel Create(Transform view, PlayerAppearCharacterReserveModel playerAppearCharacterReserveModel)
 {
     return(this.appearCharacterCreateService.Execute(
                view.position,
                view.rotation.eulerAngles,
                playerAppearCharacterReserveModel
                ));
 }
Example #4
0
        public void RemoveReserve(PlayerAppearCharacterReserveModel playerAppearCharacterReserveModel)
        {
            var dailyAppearCharacterGeneratorResistReserve = this.dailyAppearCharacterGeneratorResistReserves.Find(reserve => reserve.PlayerAppearCharacterReserveModel.Id == playerAppearCharacterReserveModel.Id);

            Debug.Assert(dailyAppearCharacterGeneratorResistReserve != null, "DailyAppearCharacterRegistManagerに見つかりませんでした。");

            // 消去予約
            this.dailyAppearCharacterRegistReserveNextRemoveService.Execute(dailyAppearCharacterGeneratorResistReserve.PlayerAppearCharacterReserveModel);
        }
Example #5
0
        public bool IsRemoveReserve(PlayerAppearCharacterReserveModel playerAppearCharacterReserveModel)
        {
            var dailyAppearCharacterGeneratorResistReserve = this.dailyAppearCharacterGeneratorResistReserves.Find(reserve => reserve.PlayerAppearCharacterReserveModel.Id == playerAppearCharacterReserveModel.Id);

            Debug.Assert(dailyAppearCharacterGeneratorResistReserve != null, "要素が見つかりません");

            // 条件は増える可能性があるが、現状一回のみのやつは消してもいい
            return(dailyAppearCharacterGeneratorResistReserve.IsOnce());
        }
 public PlayerAppearCharacterViewModel Execute(
     Vector3 position,
     Vector3 rotation,
     PlayerAppearCharacterReserveModel playerAppearCharacterReserveModel
     )
 {
     return(playerAppearCharacterViewRepository.Create(
                position,
                rotation,
                playerAppearCharacterReserveModel
                ));
 }
 public PlayerAppearCharacterViewModel(
     uint id,
     Vector3 position,
     Vector3 rotation,
     PlayerAppearCharacterReserveModel playerAppearCharacterReserveModel,
     bool isReceiveReward)
 {
     this.Id       = id;
     this.Position = position;
     this.Rotation = rotation;
     this.PlayerAppearCharacterReserveModel = playerAppearCharacterReserveModel;
     this.IsReceiveReward = isReceiveReward;
 }
        public void Remove(PlayerAppearCharacterReserveModel playerAppearCharacterReserveModel)
        {
            var entry = this.GetEntry(playerAppearCharacterReserveModel.Id);

            if (entry != null)
            {
                var index = this.entrys.IndexOf(entry);
                this.entrys.RemoveAt(index);
            }
            else
            {
                Debug.Assert(false, "要素が存在しません : " + playerAppearCharacterReserveModel.Id.ToString());
            }
            PlayerContextMap.WriteEntry(this.entrys);
        }
        public void Store(PlayerAppearCharacterReserveModel playerAppearCharacterReserveModel)
        {
            var entry = this.GetEntry(playerAppearCharacterReserveModel.Id);

            if (entry != null)
            {
                var index = this.entrys.IndexOf(entry);

                var condition = Condition.None;
                var rate      = 0.0f;
                if (playerAppearCharacterReserveModel.DailyAppearCharacterRegistCondition is DailyAppearCharacterRegistConditionForce)
                {
                    condition = Condition.Force;
                }
                else if (playerAppearCharacterReserveModel.DailyAppearCharacterRegistCondition is DailyAppearCharacterRegistConditionByChance)
                {
                    condition = Condition.ByChance;
                    rate      = (playerAppearCharacterReserveModel.DailyAppearCharacterRegistCondition as DailyAppearCharacterRegistConditionByChance).Rate;
                }
                else
                {
                    Debug.Assert(false, "条件が見つかりません");
                }

                this.entrys[index] = new PlayerAppearCharacterReserveEntry()
                {
                    Id = playerAppearCharacterReserveModel.Id,
                    AppearCharacterId = playerAppearCharacterReserveModel.AppearCharacterModel.Id,
                    ConversationId    = playerAppearCharacterReserveModel.ConversationModel.Id,
                    RewardId          = playerAppearCharacterReserveModel.RewardModel.Id,
                    State             = condition.ToString(),
                    Rate         = rate,
                    IsNextRemove = playerAppearCharacterReserveModel.IsNextRemove
                };
            }
            else
            {
                Debug.Assert(false, "要素が存在しません : " + playerAppearCharacterReserveModel.Id.ToString());
            }
            PlayerContextMap.WriteEntry(this.entrys);
        }
Example #10
0
 public void Execute(PlayerAppearCharacterReserveModel playerAppearCharacterReserveModel)
 {
     playerAppearCharacterReserveRepository.Remove(playerAppearCharacterReserveModel);
 }
 public DailyAppearCharacterGeneratorResistReserve(PlayerAppearCharacterReserveModel playerAppearCharacterReserveModel)
 {
     this.PlayerAppearCharacterReserveModel = playerAppearCharacterReserveModel;
 }
Example #12
0
        public void RegistReserve(PlayerAppearCharacterReserveModel playerAppearCharacterReserveModel)
        {
            var dailyAppearCharacterGeneratorResistReserve = new DailyAppearCharacterGeneratorResistReserve(playerAppearCharacterReserveModel);

            this.dailyAppearCharacterGeneratorResistReserves.Add(dailyAppearCharacterGeneratorResistReserve);
        }