Hello, loves!

A quick report on removing the old content objects in favor of the new. It goes quite well.

I moved the new CombinedContent and ContentFactory to a file in the src tree. I figure I’ll keep them in just one file as they go together.

Then I modified all the tests that used old content, basically just using an object from the ContentFactory instead:

        factory = ContentFactory()
        spikes = factory.spikes(name='spikes')

That replaces an old spikes=Animated('spikes') line. Did that throughout. Had to change some lines in spikes tests that were using the old state_number control to use the new control event. Change the text, remove the unnecessary content parameter.

I just ticked through each of the old Content subclasses, found the usages, all in tests, fixed up the tests, so they are all still running, but using the new CombinedContent scheme.

Then I removed all the classes, one by one, finally removed the whole file. Then I renamed CombinedContent to Content, much better name.

There are a few tests marked skip. Let’s see if we can fix those up. There are a couple of tests left over from when I was trying the Strategy approach, which I belayed when it seemed less than helpful. Remove that whole test file, it’s safe in the repo of we ever want it, and we won’t.

I’ve now gone through and unmarked all the skipped tests and made them work. Some worked immediately, some needed new content objects from the factory. One rather intricate one needed a DungeonView to be created, because announcement events now pass through the view.

There is now only one skipped test, and it is in the TextureFinder tests. TextureFinder is a helper for laying out the dungeon floor. The test in question is supposed to check for a missing key. We’ll look into that at some future time. Note made.

There is probably duplication to look into and other improvements are surely possible. But out with the old and in with the new. A very pleasant afternoon requiring almost no brain power whatsoever, just some simple substitutions.

And that is just what I had hoped for. See you next time!