Search

Friday, August 17, 2012

Day 9: Refactoring



As I said this midnight, one of the things I have to change is the possibleMoves method. Why? Because the responsability of knowing what moves are legal is not of the engine. The ruleset actor is the one that should know what moves are legal.

So, I moved the method to Ruleset, deleted the Actors class. So, Engine and Human don't inherit from nobody now.

Engine now creates a Ruleset object and gets the legal moves from him.

No comments:

Post a Comment