summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2013-04-24 17:27:25 -0600
committermo khan <mo@mokhan.ca>2013-04-24 17:27:25 -0600
commit06a049938a800a77d61bae9ed6daa562347dfa27 (patch)
tree25f5b8a464a26c7166b7c0a8550268caf2c69a7e
parent27816feca037b8e5c1dd34c404b27564f02f2601 (diff)
remove unneccessary usages of initial health
-rw-r--r--rubywarrior/alimo-beginner/player.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/rubywarrior/alimo-beginner/player.rb b/rubywarrior/alimo-beginner/player.rb
index 7044745..26c9390 100644
--- a/rubywarrior/alimo-beginner/player.rb
+++ b/rubywarrior/alimo-beginner/player.rb
@@ -5,7 +5,6 @@ class Player
end
def play_turn(warrior)
- @initial_health ||= warrior.health
@behaviours.each do |action|
action.play(warrior) if action.matches(warrior)
end
@@ -48,8 +47,7 @@ class Rest
end
def matches(warrior)
- @initial_health ||= warrior.health
- warrior.feel.empty? == false && @good_health.matches(warrior) == false
+ !warrior.feel.empty? && !@good_health.matches(warrior)
end
def play(warrior)