Created
January 17, 2014 16:10
This file contains 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 characters
class ProgressSuggestions(TransportModel): | |
def __init__(self): | |
self.suggestions = [] | |
class SuggestionService(object): | |
def suggest(self, playerId): | |
current = DB.load(playerId) | |
currentIds = [current.sug1, current.sug2, current.sug3] | |
progress = ProgressSuggestions() | |
progress.suggestions = [] | |
for index, suggestedId in enumerate(currentIds): | |
suggestedItem = DB.loadItem(suggestedId) | |
if not suggestedItem.stillExists(): | |
suggestedItem = self.calculateNew(playerId) | |
progress.suggestions.append(suggestedItem) | |
return progress |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment