Ben Evans / Mbed 2 deprecated Defender_Game

Dependencies:   mbed

Explosion/Explosion.h

Committer:
evanso
Date:
2020-05-17
Revision:
40:71f947254fda
Parent:
29:e96d91f1d39c
Child:
82:3211b31e9421

File content as of revision 40:71f947254fda:

#ifndef EXPLOSION_H
#define EXPLOSION_H

// Included libraries ----------------------------------------------------------
#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"
#include "Position.h"

/** Animation Struct
 * @brief Struct to draw explosion animation 
 */   
struct Animation{
    bool draw_circle_one; /**< Bool to draw circle one */
    bool draw_circle_two; /**< Bool to draw circle two */
    FillType circle_one; /**< Fill type of circle one */
    FillType circle_two; /**< Fill type of circle two */
};

/** Explosion class
 * @brief Draws explosion animation 
 * @author Benjamin Evans, University of Leeds
 * @date May 2020
 */      
class Explosion: private Position {
    public:
        /** Constructor */
        Explosion();
        
        /** Destructor */
        ~Explosion();
        
        /** Initalises explosion 
         * @param destroyed_position @details Vector2D of destoyed xy pos
         */
        void init(Vector2D destroyed_position);
    
        /** Draws the explosion 
         * @param lcd @details N5110 object
         */
        void draw_explosion(N5110 &lcd);
    
    // Accessors and mutators --------------------------------------------------
        
        /** Gets the explosion radius
         * @returns explosion_radius_
         */
        int get_explosion_radius();
        
    private:   
       
    // Varibles ---------------------------------------------------------------- 
        
        /** Explosion circle radius */ 
        int explosion_radius_;
        
        /** FSM counter for state in FSM */ 
        int fsm_counter_;
        
        /** Draw cunter  */
        int draw_counter;
};
 
#endif