Dependencies:   AmmoPusher AmmoSupplier Shooter

Dependents:   OBROT_ALL

Files at this revision

API Documentation at this revision

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;
 };