Exemple #1
0
        /// <summary>
        /// 何も無い状態のコンストラクタ
        /// </summary>
        /// <param name="inputViewModel"></param>
        /// <param name="parent"></param>
        public MapModel(EditMapViewModel inputViewModel, StageModel parent)
        {
            Initialize(parent);
            SetProperties(inputViewModel, parent);

            this.MapChipModel = new MapChipModel(this, MapCellWidth, MapCellHeight);
            this.ObjectChipModel = new ObjectChipModel(this);

            SetEvent();
            ChangeBackground();
        }
 /// <summary>
 /// EditMapViewModelからMapModelの値のセット
 /// </summary>
 /// <param name="inputViewModel"></param>
 /// <param name="parent"></param>
 private void SetProperties(EditMapViewModel inputViewModel, StageModel parent)
 {
     this.ID = System.Int32.Parse(inputViewModel.InputID);
     this.MapName = string.Format("World{0}-Stage{1}-Map{2}", parent.World, parent.Stage, ID);
     this.Background = inputViewModel.InputBackground;
     this.MapCellWidth = System.Int32.Parse(inputViewModel.InputMapCellWidth);
     this.MapCellHeight = System.Int32.Parse(inputViewModel.InputMapCellHeight);
     this.BgNo = System.Int32.Parse(inputViewModel.InputBgNo);
     this.BGMNo = System.Int32.Parse(inputViewModel.InputBGMNo);
     this.ScrollSpeed = System.Int32.Parse(inputViewModel.InputScrollSpeed);
     this.ScrollAngle = System.Int32.Parse(inputViewModel.InputScrollAngle);
     this.MapChipType = System.Int32.Parse(inputViewModel.InputMapChipType);
     this.TimeLimit = System.Int32.Parse(inputViewModel.InputTimeLimit);
 }
 public void UpdateFromInput(EditMapViewModel editMapViewModel)
 {
     ID = Int32.Parse(editMapViewModel.InputID);
     MapName = editMapViewModel.InputMapName;
     Background = editMapViewModel.InputBackground;
     MapCellWidth = Int32.Parse(editMapViewModel.InputMapCellWidth);
     MapCellHeight = Int32.Parse(editMapViewModel.InputMapCellHeight);
     BgNo = Int32.Parse(editMapViewModel.InputBgNo);
     BGMNo = Int32.Parse(editMapViewModel.InputBGMNo);
     ScrollSpeed = Int32.Parse(editMapViewModel.InputScrollSpeed);
     ScrollAngle = Int32.Parse(editMapViewModel.InputScrollAngle);
     MapChipType = Int32.Parse(editMapViewModel.InputMapChipType);
     TimeLimit = Int32.Parse(editMapViewModel.InputTimeLimit);
 }