#ifndef __SHOCKWAVEACTOR_H__
#define __SHOCKWAVEACTOR_H__

#include "actor.h"

// Exploding missile
class ShockwaveActor : public Actor
{
public:
  ShockwaveActor(f32 x, f32 y)
    : Actor(), state(SW_NULL), x(x), y(y), r(0), t(0) {};
  bool isFinished() {return state == SW_FINISHED;}

public:
  void activate();
  void update();

  f32 getX() {return x;}
  f32 getY() {return y;}
  f32 getR() {return r;}
  f32 getRotation() {return 0;}
  int getT() {return t;}
  bool isActive() {return state != SW_NULL;}

protected:
  const static f32 RMAX = 40.0;
  const static f32 RINC = 0.5;

  enum {
    SW_NULL,
    SW_EXPAND,
    SW_SHRINK,
    SW_FINISHED
  } state;

  f32 x,y; // Center of shockwave
  f32 r; // Current blast radius
  int t; // Frames since explosion
};

#endif
