Skip to content

Commit

Permalink
Added amount argument to increment on achievements, so increments don…
Browse files Browse the repository at this point in the history
…t have to be by one
  • Loading branch information
Brian Knobbs committed Sep 12, 2014
1 parent 14f5813 commit 8d6f1a5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pychievements/achievements.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ def unachieved(self):
"""
return [_ for _ in self.goals if self._current < _['level']]

def increment(self, *args, **kwargs):
def increment(self, amount=1, *args, **kwargs):
"""
Increases the current level. Achievements can redefine this function to take options to
increase the level based on given arguments. By default, this will simply increment the
current count by 1.
current count by ``amount`` (which defaults to 1).
"""
self._current = self._current + 1
self._current = self._current + amount

def evaluate(self, *args, **kwargs):
"""
Expand Down

0 comments on commit 8d6f1a5

Please sign in to comment.