Closed sbuller closed 15 years ago
I think combat should generally be instantiated via a 'factory method' on the Hero class.
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.
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.
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.