Strangely Consistent

Theory, practice, and languages, braided together

July 21 2012 — it's too dark in here!

Implementing flashlight/torch logic is straightforward but not without its surprises. Nevertheless, I have two commits for you today as well.

Now to get the flashlight to work.

I'm happy about today's harvest of events:

Very descriptive. Oh, and there should also be an exception TooDark, but there's nothing in the hall yet to try it on. Will add it tommorrow.

I'm starting to suffer very slightly from scaling issues. The whole bin/crypt file is now 2485 lines long, but that's partly because it contains everything: game engine, crypt game, hanoi subgame, and tests for all of them. So there's some splitting up to do before the month is over.

But there's also the fact that the Adventure::Engine class has 21 attributes, which is a bit much. I suspect it could easily be given a few inner classes to handle rooms and things separately, and that that would help combat the monolithic list of attributes. Luckily, such a refactor will be very straightforward, since we're not exposing any internals at all.

Tomorrow will be interesting — that's when we integrate the hanoi game we wrote at the beginning of the month. I... I hope it fits in with the rest of the game. 哈哈