Class: Stats::Max

Inherits:
StatsType show all
Defined in:
lib/shades/stats.rb

Instance Method Summary collapse

Methods inherited from StatsType

get

Constructor Details

#initialize(d) ⇒ Max

Returns a new instance of Max.



98
99
100
# File 'lib/shades/stats.rb', line 98

def initialize(d)
  @max = d
end

Instance Method Details

#add(d) ⇒ Object



102
103
104
# File 'lib/shades/stats.rb', line 102

def add(d)
  @max = [@max, d].max
end

#get_valueObject



114
115
116
# File 'lib/shades/stats.rb', line 114

def get_value
  @max
end

#merge(stat) ⇒ Object



110
111
112
# File 'lib/shades/stats.rb', line 110

def merge(stat)
  @max = [@max, stat.get_value].max
end

#remove(d) ⇒ Object



106
107
108
# File 'lib/shades/stats.rb', line 106

def remove(d)
  puts "ignoring remove"
end