2012-04-30 18:59:30 +04:00
|
|
|
#ifndef __COLORED_SQUARE_H__
|
|
|
|
#define __COLORED_SQUARE_H__
|
|
|
|
|
|
|
|
#include "Square.h"
|
|
|
|
|
|
|
|
typedef struct ColoredSquare_data
|
|
|
|
{
|
|
|
|
Square_data;
|
|
|
|
|
|
|
|
int color;
|
|
|
|
|
|
|
|
} ColoredSquare_data;
|
|
|
|
|
2012-05-01 00:55:56 +04:00
|
|
|
struct ColoredSquare;
|
|
|
|
|
2012-04-30 18:59:30 +04:00
|
|
|
typedef struct ColoredSquare_interface
|
|
|
|
{
|
|
|
|
Square_interface;
|
|
|
|
|
2012-05-01 00:55:56 +04:00
|
|
|
void (*set_color) (struct ColoredSquare *this, int color);
|
2012-04-30 18:59:30 +04:00
|
|
|
|
|
|
|
} ColoredSquare_interface;
|
|
|
|
|
2012-05-01 00:55:56 +04:00
|
|
|
void ColoredSquare_constructor (struct ColoredSquare *this,
|
2012-04-30 23:50:36 +04:00
|
|
|
double a,
|
|
|
|
int color);
|
2012-05-01 00:55:56 +04:00
|
|
|
void ColoredSquare_copy (struct ColoredSquare *to, struct ColoredSquare *from);
|
|
|
|
struct ColoredSquare* ColoredSquare_clone (struct ColoredSquare *this);
|
|
|
|
const char* ColoredSquare_type (struct ColoredSquare *this);
|
|
|
|
void ColoredSquare_draw (struct ColoredSquare *this);
|
|
|
|
void ColoredSquare_set_color (struct ColoredSquare *this, int color);
|
2012-04-30 18:59:30 +04:00
|
|
|
|
|
|
|
/* public */
|
|
|
|
typedef struct ColoredSquare
|
|
|
|
{
|
|
|
|
ColoredSquare_interface *vtable;
|
|
|
|
|
|
|
|
ColoredSquare_data;
|
|
|
|
|
|
|
|
} ColoredSquare;
|
|
|
|
|
2012-05-01 00:55:56 +04:00
|
|
|
ColoredSquare* ColoredSquare_new (double a, int color);
|
2012-04-30 18:59:30 +04:00
|
|
|
|
|
|
|
#endif // __COLORED_SQUARE_H__
|