sbuller / divided-posterity

An online multiplayer browser based bonanza.
4 stars 0 forks source link

Combat class initialization #6

Closed sbuller closed 15 years ago

sbuller commented 15 years ago

The Combat model is currently passed a location and a user. It further internally calls on the Hero and Enemy models to acquire one of each. This initialization pattern is somewhat haphazard, unfortunately, it's not clear how this should be implemented.

frazazel commented 15 years ago

I think combat should generally be instantiated via a 'factory method' on the Hero class.

frazazel commented 15 years ago

Currently combat is instantiated with a factory method as described above. However, the Hero class does not have then location saved anywhere, and the request is not always available to it. (Right now the location is chosen at random from all available locations.) I think that the location that the Hero is at should be saved in the database.

frazazel commented 15 years ago

Combat initialization has been on the Combatant for a while now, and I don't think it's particularly in need of further attention. Closed.