paulofmandown / rotLove

Roguelike Toolkit in Love. A Love2D/lua port of rot.js
http://paulofmandown.github.io/rotLove/
Other
258 stars 25 forks source link

Bind callbacks to class instances #26

Closed airstruck closed 7 years ago

airstruck commented 7 years ago

This is a continuation of #25. Base class is given a bind function. Dungeon callbacks are bound to class instances, like the JS version. Gives several functions the same signatures as their JS counterparts, no more passing self with callbacks or awkwardly documented gen param.

May have missed something here, only tested with preciseWithMovingPlayer. Maybe worth considering automated tests some time?

airstruck commented 7 years ago

Relevant changes in 78e31b0. Would have branched off master, but base class seemed like best place for bind.

timothymtorres commented 7 years ago

It might be worth considering adding LuaUnit to the framework to run some unit tests.