13 ms·
Better still: do local move = { [Direction.up] = View.Up, [Direction.left] = View.Left, [Direction.right] = View.Ri
by pygy_ 13y ago
Better still:
do
local move = {
[Direction.up] = View.Up,
[Direction.left] = View.Left,
[Direction.right] = View.Right,
[Direction.down] = View.Down
}
function View.move(self, direction) move[direction](self) end
end