예제 #1
0
        public void Execute(GunView gunView, PlayerView playerView)
        {
            var damage = gunView.GetDamage();

            playerHealthDecrease.Execute(playerView, damage);
            gunView.DestroyView();
        }
예제 #2
0
    void Start()
    {
        UnaimedView = new GunView(m_transformAdjust.localPosition, m_transformAdjust.localRotation, Camera.main.fieldOfView);
        AimedView   = new GunView(m_aimTransform.localPosition, m_aimTransform.localRotation, m_aimFOV);
        TargetView  = UnaimedView;

        NBullets   = m_bulletCapacity;
        NMagazines = m_magazineCapacity;

        ChangeState(new GunStateDraw());
    }
예제 #3
0
        public void Execute(GunView gunView, EnemyView enemyView)
        {
            var enemyViewModel = enemyView.GetModel();

            enemyViewModel.Health = Mathf.Max(enemyViewModel.Health - 1, 0);

            if (enemyViewModel.Health.Equals(0))
            {
                playerRepository.AddScore(enemyViewModel.ScorePoints);
                gunView.DestroyView();
                enemyView.Explote();
            }
        }
예제 #4
0
        public override ActionResult Delete(int?id)
        {
            var entityViewModel = new GunViewModel();

            using (var localService = this.service as IGunService)
            {
                var entity = localService.GetAll().OfType <Gun>().Where(b => b.Id == id).First();

                var entityView = new GunView {
                    CaliberViewName = entity.Caliber.Name, ManufacturerName = entity.Manufacturer.Name, GunTypeName = entity.GunType.Name, LengthUnitViewAbbreviation = entity.BarrelLengthUnit.Abbreviation
                };

                entityViewModel.CanDelete  = !(entity.GunImages.Any() || entity.ShootingSessions.Any());
                entityViewModel.Entity     = entity;
                entityViewModel.EntityView = entityView;
            }

            return(View(entityViewModel));
        }
예제 #5
0
 public static GunPresenter Provide(GunView view)
 {
     return(new GunPresenter(view, GameProvider.ProvideRemoveCollision()));
 }
예제 #6
0
 public void SwitchGun(IPlayerController obj)
 {
     viewType        += 1;
     myGunView.sprite = guns[(int)viewType];
     anim.speed      *= 2;
 }
예제 #7
0
 public GunPresenter(GunView view, RemoveCollision removeCollision)
 {
     this.view            = view;
     this.removeCollision = removeCollision;
 }