Implemented GameData::BerryPlant

This commit is contained in:
Maruno17
2020-11-13 21:34:11 +00:00
parent d7e9f6db67
commit d8476d1fa4
5 changed files with 89 additions and 57 deletions

View File

@@ -0,0 +1,36 @@
module GameData
class BerryPlant
attr_reader :id
attr_reader :id_number
attr_reader :hours_per_stage
attr_reader :drying_per_hour
attr_reader :minimum_yield
attr_reader :maximum_yield
DATA = {}
DATA_FILENAME = "berry_plants.dat"
NUMBER_OF_REPLANTS = 9
extend ClassMethods
include InstanceMethods
def initialize(hash)
validate hash => Hash, hash[:id] => Symbol
@id = hash[:id]
@id_number = hash[:id_number] || -1
@hours_per_stage = hash[:hours_per_stage] || 3
@drying_per_hour = hash[:drying_per_hour] || 15
@minimum_yield = hash[:minimum_yield] || 2
@maximum_yield = hash[:maximum_yield] || 5
end
end
end
#===============================================================================
# Deprecated methods
#===============================================================================
def pbGetBerryPlantData(item)
Deprecation.warn_method('pbGetBerryPlantData', 'v20', 'GameData::BerryPlant.get(item)')
return GameData::BerryPlant.get(item)
end