mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-11 23:24:59 +00:00
Implemented GameData::Nature, improved registration of GameData entries
This commit is contained in:
@@ -4,6 +4,10 @@ module GameData
|
||||
# Assumes the data class's data is stored in a class constant hash called DATA.
|
||||
# For data that is known by a symbol or an ID number.
|
||||
module ClassMethods
|
||||
def register(hash)
|
||||
self::DATA[hash[:id]] = self::DATA[hash[:id_number]] = self.new(hash)
|
||||
end
|
||||
|
||||
# @param other [Symbol, self, String, Integer]
|
||||
# @return [Boolean] whether the given other is defined as a self
|
||||
def exists?(other)
|
||||
@@ -60,6 +64,10 @@ module GameData
|
||||
# Assumes the data class's data is stored in a class constant hash called DATA.
|
||||
# For data that is only known by an ID number.
|
||||
module ClassMethodsIDNumbers
|
||||
def register(hash)
|
||||
self::DATA[hash[:id]] = self.new(hash)
|
||||
end
|
||||
|
||||
# @param other [self, Integer]
|
||||
# @return [Boolean] whether the given other is defined as a self
|
||||
def exists?(other)
|
||||
|
||||
Reference in New Issue
Block a user