Groovy Documentation

de.dewarim.goblin.shop
[Groovy] Class ShopOwner

java.lang.Object
  de.dewarim.goblin.shop.ShopOwner

class ShopOwner

Owner of a shop. At the moment, shop owners are not strictly necessary (the fields could be rolled into the shop class), but later on we might want race specific shop owners like in Moria and Angband.


Property Summary
static java.lang.Object constraints

java.lang.String description

static java.lang.Object hasMany

java.lang.String name

java.lang.Integer priceModifier

The value generated by the priceModifierDice is stored in priceModifier.

Dice priceModifierDice

This dice is the factor by how many % the price of items will be adjusted.

 
Constructor Summary
ShopOwner()

 
Method Summary
java.lang.Integer calculatePrice(java.lang.Object itemType)

Calculate how much a player character has to pay

void calculatePriceModifier()

java.lang.Integer calculateSellPrice(java.lang.Object item)

Calculate how much the shop owner will pay for a given item.

boolean equals(java.lang.Object o)

int hashCode()

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Property Detail

constraints

static java.lang.Object constraints


description

java.lang.String description


hasMany

static java.lang.Object hasMany


name

java.lang.String name


priceModifier

java.lang.Integer priceModifier
The value generated by the priceModifierDice is stored in priceModifier. Later on, it should be re-rolled every day or so to create price changes.


priceModifierDice

Dice priceModifierDice
This dice is the factor by how many % the price of items will be adjusted.


 
Constructor Detail

ShopOwner

ShopOwner()


 
Method Detail

calculatePrice

java.lang.Integer calculatePrice(java.lang.Object itemType)
Calculate how much a player character has to pay
Parameters:
item - the itemType
Returns:
price in gold pieces


calculatePriceModifier

void calculatePriceModifier()


calculateSellPrice

java.lang.Integer calculateSellPrice(java.lang.Object item)
Calculate how much the shop owner will pay for a given item. He will generally pay half of what it's worth.
Parameters:
item - the player's item
Returns:
the price the item will fetch from this shop owner.


equals

boolean equals(java.lang.Object o)


hashCode

int hashCode()


 

Groovy Documentation