Skip to content

Instantly share code, notes, and snippets.

@reikje
Created January 17, 2014 16:10
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