Ballz.GameSession.Logic.Weapons.ChargedProjectileWeapon.Update C# (CSharp) Method

Update() public method

public Update ( float elapsedSeconds, bool>.Dictionary KeysPressed, bool &turnEndindActionHappened, bool &canSwitchWeapon ) : void
elapsedSeconds float
KeysPressed bool>.Dictionary
turnEndindActionHappened bool
canSwitchWeapon bool
return void
        public override void Update(float elapsedSeconds, Dictionary<InputMessage.MessageType, bool> KeysPressed, out bool turnEndindActionHappened, out bool canSwitchWeapon)
        {
            base.Update(elapsedSeconds, KeysPressed, out turnEndindActionHappened, out canSwitchWeapon);

            if (Game.Match.IsRemoteControlled)
                return;

            Ball.IsCharging = KeysPressed[InputMessage.MessageType.ControlsAction];
            canSwitchWeapon = (Ball.ShootCharge == 0) || (!Game.Match.UsePlayerTurns);

            Ball.IsAiming = true;
            if (!Ball.IsCharging && Ball.ShootCharge > 0)
            {
                turnEndindActionHappened = true;
                canSwitchWeapon = !Game.Match.UsePlayerTurns;

                FireProjectile();
                Ball.ShootCharge = 0f;
            }
        }