public void TransferPowerUp(PoweredUpData data) { if (data.IsValid()) { if (data.ChangePaddleSpeed) { obj.ApplySpeedPowerup(); } if (data.GivePlayerLife) { obj.ApplyLifePowerup(); } if(data.UndoPlayerMove) { obj.ApplyUndoPowerup(); } obj.ChangeState(new HalfPowerState(obj)); } }