public void Awake() { bulletPool = GetComponent <NormalBulletGenerator>(); misilPool = GetComponent <MisilBulletGenerator>(); view = new ViewPlayer(); model = new ModelPlayer(this.transform, shield); controller = new ControllerPlayer(model, view, this, camara); automaticStrategy = new Automatic(canShot, fireRate, bullet, mainGun, bulletPool); tripleStrategy = new Triple(canShot, fireRate, bullet, mainGun, sideGunL, sideGunR, bulletPool); misilStrategy = new Misil(canShot, fireRate, bullet, mainGun, sideGunL, sideGunR, bulletPool, misilGunL, misilGunR, misilPool); }
public void MakeMove(IShootStrategy shootStrategy) { Cell changedCell; try { changedCell = shootStrategy.Shoot(EventManager.IsPlayerOneTurn ? FieldPlayerTwo : FieldPlayerOne); } catch (Exception exception) { EventManager.Notify(exception); return; } if (IsGameEndedCheck()) { EventManager.Notify(); } else { EventManager.Notify(changedCell); } }
public WeaponShoot(Weapon hWeap, int iCount, ShootMode hMode) { m_hOwner = hWeap; m_iShootCount = iCount; ShootModeFactory shootFactory = new ShootModeFactory(this); m_hShootStrategy = shootFactory.GetMode(hMode); }