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
meanTurnsForRegrow
Fields inherited from class marauroa.common.game.RPObject
INVALID_ID
-
Constructor Summary
ConstructorDescriptionConstructor.FlowerGrower(String infoString)
Constructor of a FlowerGrower growing an item with the name specified in infostring.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 int
protected void
Creates a new fruit.boolean
Checks if this entity is on a free fertile spot.void
onFruitPicked(Item picked)
Removes this from world.Methods inherited from class games.stendhal.server.entity.mapstuff.spawner.VegetableGrower
getNotRipeEnoughMessage, getVegetableName, onUsed, setNotRipeEnoughMessage, setVegetableName
Methods inherited from class games.stendhal.server.entity.mapstuff.spawner.GrowingPassiveEntityRespawnPoint
generateRPClass, getMaxRipeness, getRipeness, onItemPickedUp, setRipeness, setToFullGrowth, update
Methods inherited from class games.stendhal.server.entity.mapstuff.spawner.PassiveEntityRespawnPoint
onTurnReached, setStartState
Methods 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, onAdded, onMoved, onRemoved, setCursor, setDescription, setEntityClass, setEntitySubclass, setMenu, setPosition, setResistance, setSize, setVisibility, slotIterator, slots, squaredDistance, squaredDistance, stopped
Methods 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, writeToJson
Methods inherited from class marauroa.common.game.SlotOwner
deserializeRPSlots, fill, serializeRPSlots
Methods 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, toAttributeString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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:
StendhalRPObjectFactory
-
FlowerGrower
public FlowerGrower()Constructor. Default FlowerGrower produces lilia. -
FlowerGrower
Constructor of a FlowerGrower growing an item with the name specified in infostring.- Parameters:
infoString
- 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:
onFruitPicked
in 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:
getRandomTurnsForRegrow
in classPassiveEntityRespawnPoint
-
describe
The description depends upon the ripeness of the flower grower- Overrides:
describe
in 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:PassiveEntityRespawnPoint
Creates a new fruit.- Overrides:
growNewFruit
in classGrowingPassiveEntityRespawnPoint
-