jurpe.world
Class Shop

java.lang.Object
  extended by jurpe.world.Shop

public class Shop
extends java.lang.Object

Shop Instance is an actual Shop in the game, containing a subset of items in the Shop class

Author:
Alessio Saltarin

Constructor Summary
Shop(java.lang.String name, MasterShop masterS, int numberOfItems)
          Constructor.
Shop(java.lang.String name, MasterShop masterS, int aArmors, int aShields, int aWeapons, int aItems)
          Constructor.
Shop(java.lang.String name, MasterShop masterS, int aArmors, int aShields, int aWeapons, int aItems, float randomItems)
          Constructor.
 
Method Summary
 java.util.AbstractSet<Armor> getArmors()
          Get armors in the Shop.
 java.util.AbstractSet<Item> getItems()
          Get items in the Shop.
 java.lang.String getName()
          Return shop name.
 java.util.AbstractSet<Shield> getShields()
          Get shields in the Shop.
 java.util.AbstractSet<Weapon> getWeapons()
          Get weapons in the Shop.
 void setAvailableArmors(int number)
          Set the number of available Armors in the shop
 void setAvailableItems(int number)
          Set the number of available Items in the shop
 void setAvailableShields(int number)
          Set the number of available Shields in the shop
 void setAvailableWeapons(int number)
          Set the number of available Weapons in the shop
 void setRandomPercentage(float perc)
          Set random percentage of items in this shop.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Shop

public Shop(java.lang.String name,
            MasterShop masterS,
            int numberOfItems)
Constructor.

Parameters:
name - Shop's name
masterS - Handle to Master Shop
numberOfItems - Number Of Items per category (Armors, Weapons, Shields, Items)

Shop

public Shop(java.lang.String name,
            MasterShop masterS,
            int aArmors,
            int aShields,
            int aWeapons,
            int aItems)
Constructor.

Parameters:
name - Shop's name
masterS - Handle to Master Shop
aArmors - number of available armors in the shop
aShields - number of available shields in the shop
aWeapons - number of available weapons in the shop
aItems - number of available items in the shop

Shop

public Shop(java.lang.String name,
            MasterShop masterS,
            int aArmors,
            int aShields,
            int aWeapons,
            int aItems,
            float randomItems)
Constructor.

Parameters:
name - Shop's name
masterS - Handle to Master Shop
aArmors - number of available armors in the shop
aShields - number of available shields in the shop
aWeapons - number of available weapons in the shop
aItems - number of available items in the shop
randomItems - percentage of random items (0.0 means all items are read from shop.xml, 0.5 means that 50% are read from shop.xml and the other are randomly created)
Method Detail

getName

public java.lang.String getName()
Return shop name.

Returns:
Shop name.

setRandomPercentage

public void setRandomPercentage(float perc)
Set random percentage of items in this shop.

Parameters:
perc - Percentage of random items

setAvailableArmors

public void setAvailableArmors(int number)
Set the number of available Armors in the shop

Parameters:
number - Number of available Armors in the shop

setAvailableShields

public void setAvailableShields(int number)
Set the number of available Shields in the shop

Parameters:
number - Number of available Shields in the shop

setAvailableWeapons

public void setAvailableWeapons(int number)
Set the number of available Weapons in the shop

Parameters:
number - Number of available Weapons in the shop

setAvailableItems

public void setAvailableItems(int number)
Set the number of available Items in the shop

Parameters:
number - Number of available Items in the shop

getArmors

public java.util.AbstractSet<Armor> getArmors()
Get armors in the Shop.

Returns:
List of armors (Armor) in the shop
See Also:
Armor

getWeapons

public java.util.AbstractSet<Weapon> getWeapons()
Get weapons in the Shop.

Returns:
List of weapons (Weapon) in the shop
See Also:
Weapon

getItems

public java.util.AbstractSet<Item> getItems()
Get items in the Shop.

Returns:
List of items (Item) in the shop
See Also:
Item

getShields

public java.util.AbstractSet<Shield> getShields()
Get shields in the Shop.

Returns:
List of shields (Shield) in the shop
See Also:
Shield

Jurpe - Java Universal Role Playing Engine - http://jurpe.sourceforge.net