Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: AmmoPusher AmmoSupplier Shooter
Revision 3:bf4ae302724c, committed 2015-10-15
- Comitter:
- inst
- Date:
- Thu Oct 15 08:45:53 2015 +0000
- Parent:
- 2:4972946a6dfc
- Commit message:
Changed in this revision
| ShootingSystem.cpp | Show annotated file Show diff for this revision Revisions of this file |
| ShootingSystem.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/ShootingSystem.cpp Wed Oct 14 06:02:19 2015 +0000
+++ b/ShootingSystem.cpp Thu Oct 15 08:45:53 2015 +0000
@@ -60,6 +60,14 @@
}
}
+ShootingSystem::~ShootingSystem(){
+ delete mShooterAngleServo;
+ delete mAmmoPusher;
+ delete mAmmoSupplier;
+ delete mShooter;
+ delete mPositionManager;
+}
+
void ShootingSystem::waiting( Command command ){
if ( command.isSupplying() ){
mAmmoSupplier->supply();
--- a/ShootingSystem.h Wed Oct 14 06:02:19 2015 +0000
+++ b/ShootingSystem.h Thu Oct 15 08:45:53 2015 +0000
@@ -34,6 +34,7 @@
ShootingSystem( I2CServo* angleManagerServo, AmmoPusher* ammoPusher,
AmmoSupplier* ammoSupplier, Shooter* shooter,
I2CServo* positoinManager );
+ ~ShootingSystem();
void update( Command command );
@@ -46,11 +47,11 @@
static bool mIsShootable;
- I2CServo* mShooterAngleServo;
- AmmoPusher* mAmmoPusher;
- AmmoSupplier* mAmmoSupplier;
- Shooter* mShooter;
- I2CServo* mPositionManager;
+ I2CServo* mShooterAngleServo;
+ AmmoPusher* mAmmoPusher;
+ AmmoSupplier* mAmmoSupplier;
+ Shooter* mShooter;
+ I2CServo* mPositionManager;
State mState;
Timer mTimer;
};