Package com.starpoints.game
Class ShopItemInfo
- java.lang.Object
-
- com.starpoints.game.ShopItemInfo
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
public class ShopItemInfo extends java.lang.Object implements java.io.Serializable, java.lang.Cloneable
Info class for ShopItems.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description ItemInfo
itemInfo
ItemInfo for the item.int
itemMinCondition
A condition for this shop item.java.lang.String[]
itemTexts
Texts to display for this item.int
price
The price of the item.
-
Constructor Summary
Constructors Constructor Description ShopItemInfo(ItemInfo ii, int price)
Creates a new ShopItemInfo for the given ItemInfo and price.ShopItemInfo(ItemInfo ii, int price, java.lang.String[] texts)
Creates a new ShopItemInfo for the given ItemInfo and price and texts.ShopItemInfo(ItemInfo ii, int price, java.lang.String[] texts, int itemMinCondition)
Creates a new ShopItemInfo for the given ItemInfo and price texts and min condition.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
clone()
Returns a clone.ShopItemState
createState()
Creates a state object for this ShopItemInfo.java.lang.String[]
getItemTexts()
Gets the texts for this shop item.int
getPrice()
Gets the price for this shop item.
-
-
-
Field Detail
-
itemInfo
public ItemInfo itemInfo
ItemInfo for the item.
-
price
public int price
The price of the item.
-
itemTexts
public java.lang.String[] itemTexts
Texts to display for this item. Should not be longer than 10 chars each for line breaks in shop painter.
-
itemMinCondition
public int itemMinCondition
A condition for this shop item. Before entering a shop, each shop item is checked against this condition (if greater 0). If the users power (depending on the item type) is already higher than the min condition, it is not offered (to prevent overpowered players). Represents a shielding value for Shield items, the ram power for ItemRamPower, an initial energy for ItemInitialEnergy or the number of slots for ItemExtraSlots.
-
-
Constructor Detail
-
ShopItemInfo
public ShopItemInfo(ItemInfo ii, int price)
Creates a new ShopItemInfo for the given ItemInfo and price.- Parameters:
ii
- The ItemInfo.price
- The price.
-
ShopItemInfo
public ShopItemInfo(ItemInfo ii, int price, java.lang.String[] texts)
Creates a new ShopItemInfo for the given ItemInfo and price and texts.- Parameters:
ii
- The ItemInfo.price
- The price.texts
- The texts.
-
ShopItemInfo
public ShopItemInfo(ItemInfo ii, int price, java.lang.String[] texts, int itemMinCondition)
Creates a new ShopItemInfo for the given ItemInfo and price texts and min condition.- Parameters:
ii
- The ItemInfo.price
- The price.texts
- The texts.itemMinCondition
- The item condition.
-
-
Method Detail
-
getPrice
public int getPrice()
Gets the price for this shop item.- Returns:
- The price.
-
getItemTexts
public java.lang.String[] getItemTexts()
Gets the texts for this shop item.- Returns:
- The texts.
-
clone
public java.lang.Object clone()
Returns a clone.- Overrides:
clone
in classjava.lang.Object
-
createState
public ShopItemState createState()
Creates a state object for this ShopItemInfo.- Returns:
- The ShopItemState.
-
-