Mercurial > fife-parpg
diff engine/swigwrappers/python/extensions.i.templ @ 0:4a0efb7baf70
* Datasets becomes the new trunk and retires after that :-)
author | mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Sun, 29 Jun 2008 18:44:17 +0000 |
parents | |
children | c0c3f64bfc2d |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/engine/swigwrappers/python/extensions.i.templ Sun Jun 29 18:44:17 2008 +0000 @@ -0,0 +1,62 @@ +namespace FIFE { + + %extend PointType2D<int> { + int getX() { return $self->x; } + int getY() { return $self->y; } + void setX(int _x) { $self->x = _x; } + void setY(int _y) { $self->y = _y; } + + std::string __str__() { + std::stringstream str; + str << "Point" << *$self; + return str.str(); + } + }; + + %extend PointType2D<double> { + double getX() { return $self->x; } + double getY() { return $self->y; } + void setX(double _x) { $self->x = _x; } + void setY(double _y) { $self->y = _y; } + + std::string __str__() { + std::stringstream str; + str << "DoublePoint" << *$self; + return str.str(); + } + }; + + %extend PointType3D<int> { + std::string __str__() { + std::stringstream str; + str << "Point3D" << *$self; + return str.str(); + } + }; + + %extend PointType3D<double> { + std::string __str__() { + std::stringstream str; + str << "DoublePoint3D" << *$self; + return str.str(); + } + }; + + %extend Rect { + int getX() { return $self->x; } + int getY() { return $self->y; } + void setX(int _x) { $self->x = _x; } + void setY(int _y) { $self->y = _y; } + + int getW() { return $self->w; } + int getH() { return $self->h; } + void setW(int _w) { $self->w = _w; } + void setH(int _h) { $self->h = _h; } + + std::string __str__() { + std::stringstream str; + str << "Rect" << *$self; + return str.str(); + } + }; +}