Added class GameData::Habitat

This commit is contained in:
Maruno17
2021-02-06 22:06:55 +00:00
parent 033434807d
commit a5af35beb1
9 changed files with 183 additions and 103 deletions

View File

@@ -0,0 +1,74 @@
module GameData
class Habitat
attr_reader :id
attr_reader :real_name
DATA = {}
extend ClassMethodsSymbols
include InstanceMethods
def self.load; end
def self.save; end
def initialize(hash)
@id = hash[:id]
@real_name = hash[:name] || "Unnamed"
end
# @return [String] the translated name of this egg group
def name
return _INTL(@real_name)
end
end
end
GameData::Habitat.register({
:id => :None,
:name => _INTL("None")
})
GameData::Habitat.register({
:id => :Grassland,
:name => _INTL("Grassland")
})
GameData::Habitat.register({
:id => :Forest,
:name => _INTL("Forest")
})
GameData::Habitat.register({
:id => :WatersEdge,
:name => _INTL("Water's Edge")
})
GameData::Habitat.register({
:id => :Sea,
:name => _INTL("Sea")
})
GameData::Habitat.register({
:id => :Cave,
:name => _INTL("Cave")
})
GameData::Habitat.register({
:id => :Mountain,
:name => _INTL("Mountain")
})
GameData::Habitat.register({
:id => :RoughTerrain,
:name => _INTL("Rough Terrain")
})
GameData::Habitat.register({
:id => :Urban,
:name => _INTL("Urban")
})
GameData::Habitat.register({
:id => :Rare,
:name => _INTL("Rare")
})