| 14 | class CelScriptObject : public script::ScriptObject { |
| 15 | public: |
| 16 | CelScriptObject() { |
| 17 | addProperty("x", |
| 18 | [this]{return cel()->x();}, |
| 19 | [this](int x){cel()->setPosition(x, cel()->y()); return x;}); |
| 20 | addProperty("y", |
| 21 | [this]{return cel()->y();}, |
| 22 | [this](int y){cel()->setPosition(cel()->x(), y); return y;}); |
| 23 | addProperty("image", [this]{return getEngine()->getScriptObject(cel()->image());}); |
| 24 | addProperty("frame", [this]{return cel()->frame();}); |
| 25 | |
| 26 | addFunction("setPosition", [this](int x, int y){ |
| 27 | cel()->setPosition(x, y); |
| 28 | return this; |
| 29 | }); |
| 30 | } |
| 31 | |
| 32 | doc::Cel* cel() { |
| 33 | auto cel = handle<doc::Object, doc::Cel>(); |
nothing calls this directly
no test coverage detected