Created
May 3, 2012 20:06
-
-
Save jonsmock/2588878 to your computer and use it in GitHub Desktop.
Revisions
-
jonsmock created this gist
May 3, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ # in board initialize lookup = PlaceLookup.new lookup.add Buildable.new, Coord.new(3, 4) # coords would be calculated from land hexes # later player = Player.new PlaceLookup.build_at player, Coord.new(3, 4) PlaceLookup.at Coord.new(3, 4) # => Settlement.new The PlaceLookup mutates behind the scenes. So potential impl of #build_at is class PlaceLookup def build_at player, coord # when you call build on a Buildable object you get a Settlement.new back @places[coord] = @places[coord].build player end end