MikeTaylor / scottkit

Scott Adams adventure toolkit: compile, decompile and play 80s-style adventure games
30 stars 10 forks source link

Refactor the play loop #11

Closed drewish closed 6 years ago

drewish commented 6 years ago

Here's a series of commits to try to extract some of the logic from the play loop into methods.

MikeTaylor commented 6 years ago

Anyway, I read the individual commits and they all make sense, so I am merging. Thanks for this.

MikeTaylor commented 6 years ago

Uh-oh -- now that I accepted this, rake test no longer passes.

Can you look into this, please? It seems that occurrences are firing at a different time.

drewish commented 6 years ago

Yeah had left separate commits to make the changes easier to follow. I should have called out that the prepare game method had a change to the order of the look vs occurance handling. I wanted to run the change in order by you first.

Give the test diff a look and see what you think. Happy to revert that commit or fix the order.

MikeTaylor commented 6 years ago

I did look at the diff, yes. I'd appreciate it if you'd fix the order.

(And yes, your individual commits were a much easier read than the total diff -- the opposite of what is usually the case in my experience.)

MikeTaylor commented 6 years ago

Meanwhile I prefer to leave the look as while true and avoid duplicating the call.