mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-05 00:38:14 +00:00
Add shops support.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
require 'java'
|
||||
|
||||
java_import 'org.apollo.cache.def.ItemDefinition'
|
||||
|
||||
java_import 'org.apollo.game.model.Item'
|
||||
|
||||
# An Item in a Shop.
|
||||
class ShopItem
|
||||
attr_reader :amount, :cost, :id, :name
|
||||
|
||||
# Creates the ShopItem.
|
||||
def initialize(id, amount, cost = nil)
|
||||
definition = ItemDefinition.lookup(id)
|
||||
@id = id
|
||||
@amount = amount
|
||||
@cost = cost.nil? ? definition.value : cost
|
||||
@name = definition.name
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user