Battlers now make use of Ability objects to be consistent with Pokemon objects

This commit is contained in:
Maruno17
2020-11-04 21:27:56 +00:00
parent 9dc6da0742
commit ff70791104
26 changed files with 189 additions and 183 deletions

View File

@@ -1,8 +1,7 @@
class Data
module PokemonData
# A mixin module for data classes which provides common class methods (called
# by Data::Thing.method) that provide access to data held within. Assumes the
# data class's data is stored in a class constant hash called DATA.
# by PokemonData::Thing.method) that provide access to data held within.
# Assumes the data class's data is stored in a class constant hash called DATA.
module ClassMethods
# @param other [Symbol, self, Integer]
# @return [Boolean] whether the given other is defined as a self
@@ -37,7 +36,7 @@ class Data
def each
keys = self::DATA.keys
keys.sort! { |a, b| a.to_s <=> b.to_s }
keys.sort! { |a, b| a.id_number <=> b.id_number }
keys.each do |key|
yield self::DATA[key] if key.is_a?(Symbol)
end
@@ -71,5 +70,4 @@ class Data
return false
end
end
end