Files
lime/project/src/math/Rectangle.cpp
2015-04-13 17:35:30 -07:00

44 lines
649 B
C++

#include <math/Rectangle.h>
namespace lime {
static int id_height;
static int id_width;
static int id_x;
static int id_y;
static bool init = false;
Rectangle::Rectangle () {
height = 0;
width = 0;
x = 0;
y = 0;
}
Rectangle::Rectangle (value rect) {
if (!init) {
id_height = val_id ("height");
id_width = val_id ("width");
id_x = val_id ("x");
id_y = val_id ("y");
init = true;
}
width = val_number (val_field (rect, id_width));
height = val_number (val_field (rect, id_height));
x = val_number (val_field (rect, id_x));
y = val_number (val_field (rect, id_y));
}
}