mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-08 13:44:59 +00:00
Removed all other uses of and support for ID numbers
This commit is contained in:
@@ -26,9 +26,6 @@ module GameData
|
||||
validate other => [Symbol, self, String, Integer]
|
||||
return other if other.is_a?(self)
|
||||
other = other.to_sym if other.is_a?(String)
|
||||
# if other.is_a?(Integer)
|
||||
# p "Please switch to symbols, thanks."
|
||||
# end
|
||||
raise "Unknown ID #{other}." unless self::DATA.has_key?(other)
|
||||
return self::DATA[other]
|
||||
end
|
||||
@@ -40,9 +37,6 @@ module GameData
|
||||
validate other => [Symbol, self, String, Integer]
|
||||
return other if other.is_a?(self)
|
||||
other = other.to_sym if other.is_a?(String)
|
||||
# if other.is_a?(Integer)
|
||||
# p "Please switch to symbols, thanks."
|
||||
# end
|
||||
return (self::DATA.has_key?(other)) ? self::DATA[other] : nil
|
||||
end
|
||||
|
||||
@@ -54,8 +48,8 @@ module GameData
|
||||
|
||||
# Yields all data in order of their id_number.
|
||||
def each
|
||||
keys = self::DATA.keys.sort { |a, b| self::DATA[a].id_number <=> self::DATA[b].id_number }
|
||||
keys.each { |key| yield self::DATA[key] if !key.is_a?(Integer) }
|
||||
sorted_keys = self::DATA.keys.sort { |a, b| self::DATA[a].id_number <=> self::DATA[b].id_number }
|
||||
sorted_keys.each { |key| yield self::DATA[key] if !key.is_a?(Integer) }
|
||||
end
|
||||
|
||||
def count
|
||||
@@ -218,7 +212,7 @@ module GameData
|
||||
elsif other.is_a?(self.class)
|
||||
return @id == other.id
|
||||
elsif other.is_a?(String)
|
||||
return @id_number == other.to_sym
|
||||
return @id == other.to_sym
|
||||
elsif other.is_a?(Integer)
|
||||
return @id_number == other
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user