Пример #1
0
        public override void SetRewardAmount(IRewardAmount rewardAmount)
        {
            var monoRewardAmount = rewardAmount as MonoRewardAmount;

            Debug.Assert(monoRewardAmount != null, "MonoRewardAmountがnullです");
            this.monoInfoModel = this.monoInfoRepository.Get(monoRewardAmount.MonoInfoId);
            this.rewardMonoInfoView.UpdateView(this.monoInfoModel.Name);
        }
Пример #2
0
 public PlayerMonoInfo(
     uint id,
     MonoInfo monoInfo,
     bool isRelease
     )
 {
     this.Id        = id;
     this.MonoInfo  = monoInfo;
     this.IsRelease = isRelease;
 }
Пример #3
0
 public PlayerMonoViewModel(
     uint id,
     MonoInfo monoInfo,
     int level
     )
 {
     this.Id       = id;
     this.MonoInfo = monoInfo;
     this.Level    = level;
 }
Пример #4
0
        public void Execute(IPlayerArrangementTarget arrangementTarget, MonoInfo monoInfo)
        {
            // プレイヤー情報の変更
            arrangementTarget.RegisterMaking(monoInfo);
            playerArrangementTargetRepository.Store(arrangementTarget.PlayerArrangementTargetModel);

            // 予約
            ArrangementResourceHelper.ReserveConsume(arrangementTarget.MonoInfo.ArrangementResourceAmount);
            GameManager.Instance.ArrangementManager.AddArrangement(arrangementTarget);
        }
Пример #5
0
        static public ArrangementInfo Generate(Vector3 position, MonoInfo mono)
        {
            var arrangementX = Mathf.FloorToInt(position.x / ArrangementAnnotater.ArrangementWidth + 0.5f);
            var arrangementZ = Mathf.FloorToInt(position.z / ArrangementAnnotater.ArrangementHeight + 0.5f);

            var info = new ArrangementInfo()
            {
                x    = arrangementX,
                z    = arrangementZ,
                mono = mono
            };

            return(info);
        }
Пример #6
0
        public MonoViewModel CreateMono(MonoInfo monoInfo, Vector3 position)
        {
            var instance = Object.AppearToFloor(monoInfo.MonoPrefab, root, position);
            var monoView = instance.GetComponent <MonoView> ();

            Debug.Assert(monoView != null, "monoViewではありません");

            // プレイヤー情報の作成
            var playerMonoViewModel = this.monoViewCreateService.Execute(monoInfo.Id);

            var monoViewModel = new MonoViewModel(monoView, playerMonoViewModel);

            monoViewModels.Add(monoViewModel);

            return(monoViewModel);
        }
Пример #7
0
 public PlayerArrangementTargetModel(
     uint id,
     Vector3 centerPosition,
     float range,
     List <ArrangementPosition> positions,
     ArrangementTargetState state,
     MonoInfo monoInfo,
     PlayerMonoViewModel playerMonoViewModel
     )
 {
     this.Id                  = id;
     this.CenterPosition      = centerPosition;
     this.Range               = range;
     this.Positions           = positions;
     this.State               = state;
     this.MonoInfo            = monoInfo;
     this.PlayerMonoViewModel = playerMonoViewModel;
 }
        private PlayerArrangementTargetModel CreateByEntry(PlayerArrangementTargetEntry entry)
        {
            MonoInfo monoInfo = null;

            if (entry.HasMonoInfoId)
            {
                monoInfo = this.monoInfoRepository.Get(entry.MonoInfoId);
                Debug.Assert(monoInfo != null, "MonoInfoが存在していません");
            }
            PlayerMonoViewModel monoViewModel = null;

            if (entry.HasMonoViewModelId)
            {
                monoViewModel = this.playerMonoViewRepository.Get(entry.MonoViewModelId);
                Debug.Assert(monoViewModel != null, "MonoViewModelが存在していません");
            }

            var state = ArrangementTargetState.None;

            if (Enum.TryParse(entry.ArrangementTargetState, out ArrangementTargetState outState))
            {
                state = outState;
            }

            return(new PlayerArrangementTargetModel(
                       entry.Id,
                       new Vector3(entry.CenterPosition.X, entry.CenterPosition.Y, entry.CenterPosition.Z),
                       entry.Range,
                       entry.ArrangementPositions.Select(pos => new ArrangementPosition()
            {
                x = pos.X,
                z = pos.Z,
            }).ToList(),
                       state,
                       entry.HasMonoInfoId ? monoInfo : null,
                       entry.HasMonoViewModelId ? monoViewModel : null
                       ));
        }
        public PlayerArrangementTargetModel Create(
            Vector3 centerPosition,
            float range,
            List <ArrangementPosition> positions,
            ArrangementTargetState state,
            MonoInfo monoInfo,
            PlayerMonoViewModel playerMonoViewModel
            )
        {
            var id    = this.MaximuId() + 1;
            var entry = new PlayerArrangementTargetEntry()
            {
                Id             = id,
                CenterPosition = new Position3Entry()
                {
                    X = centerPosition.x,
                    Y = centerPosition.y,
                    Z = centerPosition.z
                },
                Range = range,
                ArrangementPositions = positions.Select(pos => new Position2Entry()
                {
                    X = pos.x,
                    Z = pos.z
                }).ToArray(),
                ArrangementTargetState = state.ToString(),
                HasMonoInfoId          = monoInfo != null,
                MonoInfoId             = monoInfo != null ? monoInfo.Id : uint.MaxValue,
                HasMonoViewModelId     = playerMonoViewModel != null,
                MonoViewModelId        = playerMonoViewModel != null ? playerMonoViewModel.Id : uint.MaxValue
            };

            this.entrys.Add(entry);
            PlayerContextMap.WriteEntry(this.entrys);
            return(CreateByEntry(entry));
        }
Пример #10
0
 public void SelectMonoInfo(MonoInfo monoInfo)
 {
     this.selecetedMonoInfo = monoInfo;
 }
Пример #11
0
 public void SelectMonoInfo(MonoInfo MonoInfo)
 {
     this.selectedMonoInfo = MonoInfo;
 }
Пример #12
0
 public void RemoveSelect()
 {
     this.selectedMonoInfo = null;
 }
Пример #13
0
 public void SetTagetMonoInfo(MonoInfo monoInfo)
 {
     this.targetMonoInfo = monoInfo;
 }
Пример #14
0
 public void RegisterMaking(MonoInfo monoInfo)
 {
     this.playerArrangementTargetModel.SetMonoInfo(monoInfo);
 }
Пример #15
0
 public void SetMonoInfo(MonoInfo monoInfo)
 {
     this.MonoInfo = monoInfo;
 }
Пример #16
0
 public void RegisterMaking(MonoInfo monoInfo)
 {
     this.MonoInfo = monoInfo;
 }
Пример #17
0
 public PreMono(Mouse mouse, GameObject makingPrefab, MonoInfo mono)
 {
     this.mouse        = mouse;
     this.makingPrefab = makingPrefab;
     this.mono         = mono;
 }