
#ifndef obstacleH
#define obstacleH

#include <vector.h>
#include "point.h"
#include "ant.h"

class ant_class;

class obstacle_class
{

  public:
    // constructor  position and size
    obstacle_class(vector<obstacle_class> &obstacles, vector<ant_class *> &ants);

    void __fastcall draw(Graphics::TBitmap *buffer);

    bool __fastcall point_inside(point p);

    point get_upper_left( void ) { return upper_left; };
    point get_lower_right( void ) { return lower_right; };

    // two are made on the fly
    intpoint get_upper_right( void ) { return get_intpoint(lower_right.x, upper_left.y); };
    intpoint get_lower_left( void )  { return get_intpoint(upper_left.x, lower_right.y); };
    TColor get_color ( void ) { return color; };

    void refresh_screen_points(void);

  private:

    point upper_left;
    point lower_right;

    intpoint screen_upper_left;     // precalculated screen point
    intpoint screen_lower_right;

    TColor color;
};

void random_obstacle( unsigned int num );


#endif
