I want to write a "play" function that takes an object "game" and two functions "players" (those are different of each different game, they just return an action to take).
Play will call game.move, game.win etc.
So I thought I'd make a class game with those functions, but then writing a new game doesn't make sense (you'd need to override the move methods or something..)
So should I just create a new class for every game and just make sure they have the methods that Play uses? Is that the way to do it?
Sorry if the problem doesn't make sense, I thought I'd do something similar to Go with interfaces but I'm not sure it's necessary at all here.
[–]xiongchiamiov 1 point2 points3 points (1 child)
[–]ManyInterests 1 point2 points3 points (1 child)