Permalink
Browse files

Aliased alive to alive? to more accurately signal the boolean return …

…value.
  • Loading branch information...
1 parent 57f3697 commit 7d47285b6eeda0c876b2ba6e34f82ba69dce9f85 @DanKnox DanKnox committed Apr 24, 2012
Showing with 2 additions and 1 deletion.
  1. +1 −0 engine/player.rb
  2. +1 −1 engine/player_proxy.rb
View
@@ -1,6 +1,7 @@
class Player
attr_accessor :proxy
attr_reader :max_health, :health, :level, :strength, :defense, :alive
+ alias :alive? :alive
LEVEL_THRESHOLDS = [50,100,200,500,1000,1500,2500,4000]
HEALTH_INDEX = [100,110,125,145,170,195,225,260]
@@ -4,7 +4,7 @@ def initialize(player)
end
def method_missing(method, *args, &block)
- if [:alive, :move, :fight, :to_s, :trade, :rest, :inspect, :stats].include? method
+ if [:alive, :alive?, :move, :fight, :to_s, :trade, :rest, :inspect, :stats].include? method
@player.send(method, *args, &block)
end
end

0 comments on commit 7d47285

Please sign in to comment.