Skip to content

Commit

Permalink
fix camel case
Browse files Browse the repository at this point in the history
  • Loading branch information
silverweed committed Oct 3, 2017
1 parent 8a8238a commit 0eee215
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions behavioral/memento.cr
Expand Up @@ -9,11 +9,11 @@ class Match
@state = State.new({fighter1, fighter2}, rounds, time)
end

def saveMemento
def save_memento
@state
end

def restoreMemento(memento : Match::State)
def restore_memento(memento : Match::State)
@state = memento
end

Expand Down Expand Up @@ -45,11 +45,11 @@ end

match = Match.new("Liu Kang", "Kano", 3, 60.seconds)
# Save the current state
previousMatchState = match.saveMemento
previous_match_state = match.save_memento
# Change the state
match.rounds = 5
match.fighters = {"Sonya Blade", "Goro"}
match.start
# Restore the previous state
match.restoreMemento(previousMatchState)
match.restore_memento(previous_match_state)
match.start

0 comments on commit 0eee215

Please sign in to comment.