Class FlowerGrower
java.lang.Object
marauroa.common.game.Attributes
marauroa.common.game.SlotOwner
marauroa.common.game.RPObject
games.stendhal.server.entity.Entity
games.stendhal.server.entity.mapstuff.spawner.PassiveEntityRespawnPoint
games.stendhal.server.entity.mapstuff.spawner.GrowingPassiveEntityRespawnPoint
games.stendhal.server.entity.mapstuff.spawner.VegetableGrower
games.stendhal.server.entity.mapstuff.spawner.FlowerGrower
- All Implemented Interfaces:
TurnListener,UseListener,Killer,Cloneable,Iterable<String>,Serializable
Is an item producer that destroys itself when item is removed.
The standard vegetable grower would restart production cycle after removal of fruit. Fruit is only grown when FlowerGrower is in the same place as an entity in zone that implements FertileGround
-
Nested Class Summary
Nested classes/interfaces inherited from class marauroa.common.game.RPObject
RPObject.ID -
Field Summary
Fields inherited from class games.stendhal.server.entity.mapstuff.spawner.PassiveEntityRespawnPoint
meanTurnsForRegrowFields inherited from class marauroa.common.game.RPObject
INVALID_ID -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.FlowerGrower(String itemData) Constructor of a FlowerGrower growing an item with the name specified in itemdata.FlowerGrower(RPObject object, String itemname) Constructor for loading FlowerGrower from the stored zone used by StendhalRPObjectFactory. -
Method Summary
Modifier and TypeMethodDescriptiondescribe()The description depends upon the ripeness of the flower growerprotected intprotected voidCreates a new fruit.booleanChecks if this entity is on a free fertile spot.voidonFruitPicked(Item picked) Removes this from world.Methods inherited from class games.stendhal.server.entity.mapstuff.spawner.VegetableGrower
getItemName, getNotRipeEnoughMessage, getVegetableName, onUsed, setNotRipeEnoughMessage, setVegetableNameMethods inherited from class games.stendhal.server.entity.mapstuff.spawner.GrowingPassiveEntityRespawnPoint
generateRPClass, getMaxRipeness, getRipeness, onItemPickedUp, setRipeness, setToFullGrowth, updateMethods inherited from class games.stendhal.server.entity.mapstuff.spawner.PassiveEntityRespawnPoint
onAdded, onRemoved, onTurnReached, setStartStateMethods inherited from class games.stendhal.server.entity.Entity
getAdjacentNodes, getArea, getArea, getCursor, getDescription, getDescriptionName, getEntitySlot, getHeight, getName, getOrigin, getResistance, getResistance, getTitle, getWidth, getX, getY, getZone, hasDescription, isInSight, isObstacle, nextTo, nextTo, notifyWorldAboutChanges, onMoved, setCursor, setDescription, setEntityClass, setEntitySubclass, setMenu, setPosition, setResistance, setSize, setVisibility, slotIterator, slots, squaredDistance, squaredDistance, stoppedMethods inherited from class marauroa.common.game.RPObject
addEvent, addLink, addLink, addMap, addSlot, addSlot, applyDifferences, clearEvents, clearVisible, clone, containsKey, equals, events, eventsIterator, fill, get, getBaseContainer, getBoolean, getContainer, getContainerBaseOwner, getContainerOwner, getContainerSlot, getDifferences, getDouble, getFromSlots, getID, getInt, getLink, getLinkedObject, getMap, getSlot, has, hashCode, hasLink, hasMap, hasSlot, hide, isContained, isEmpty, isHidden, isStorable, maps, put, put, put, put, readObject, remove, removeLink, removeMap, removeSlot, resetAddedAndDeleted, resetAddedAndDeletedMaps, resetAddedAndDeletedRPLink, resetAddedAndDeletedRPSlot, setAddedMaps, setAddedRPSlot, setContainer, setDeletedMaps, setDeletedRPSlot, setID, size, slots, slotsIterator, store, toString, unhide, unstore, writeObject, writeObject, writeToJsonMethods inherited from class marauroa.common.game.SlotOwner
deserializeRPSlots, fill, serializeRPSlotsMethods inherited from class marauroa.common.game.Attributes
add, applyDifferences, get, getBool, getDouble, getInt, getList, getLong, getRPClass, has, instanceOf, iterator, put, put, put, put, put, readFromMap, remove, resetAddedAndDeletedAttributes, setAddedAttributes, setDeletedAttributes, setRPClass, setRPClass, toAttributeStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
FlowerGrower
Constructor for loading FlowerGrower from the stored zone used by StendhalRPObjectFactory.- Parameters:
object- the restored object from dbitemname- the item to grow- See Also:
-
FlowerGrower
public FlowerGrower()Constructor. Default FlowerGrower produces lilia. -
FlowerGrower
Constructor of a FlowerGrower growing an item with the name specified in itemdata.- Parameters:
itemData- the name of the item to produce
-
-
Method Details
-
onFruitPicked
Removes this from world. This method is called when the fruit of this grower is picked.- Overrides:
onFruitPickedin classGrowingPassiveEntityRespawnPoint- Parameters:
picked- The fruit that has been picked. Use null for subclasses of PlantGrower that don't use items as fruits.
-
getRandomTurnsForRegrow
protected int getRandomTurnsForRegrow()- Overrides:
getRandomTurnsForRegrowin classPassiveEntityRespawnPoint
-
describe
The description depends upon the ripeness of the flower grower- Overrides:
describein classVegetableGrower- Returns:
- description from the players point of view
-
isOnFreeFertileGround
public boolean isOnFreeFertileGround()Checks if this entity is on a free fertile spot. If yes, the flower can grow. Otherwise it withers and dies.- Returns:
- true if there is an item implementing FertileGround in the zone, and the position of this is in its area.
-
growNewFruit
protected void growNewFruit()Description copied from class:PassiveEntityRespawnPointCreates a new fruit.- Overrides:
growNewFruitin classGrowingPassiveEntityRespawnPoint
-