barsuift.simLife.tree
Class BasicTreeLeaf
java.lang.Object
java.util.Observable
barsuift.simLife.tree.BasicTreeLeaf
- All Implemented Interfaces:
- IObservable, LivingPart, Persistent<State>, TreeLeaf
public class BasicTreeLeaf
- extends java.util.Observable
- implements TreeLeaf
| Methods inherited from class java.util.Observable |
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BasicTreeLeaf
public BasicTreeLeaf(Universe universe,
TreeLeafState leafState)
spendTime
public void spendTime()
- Make the leaf older than it was.
Concretely, it means :
- reduce the efficiency by 5 percent
- collect solar energy : add energy based on sun luminosity and leaf efficiency
- if the leaf is too weak, then fall, else, use collected energy to improve the leaf efficiency
- Specified by:
spendTime in interface LivingPart
isTooWeak
public boolean isTooWeak()
- Return true if the leaf efficiency is lower than the lowest acceptable value
- Specified by:
isTooWeak in interface TreeLeaf
getEfficiency
public java.math.BigDecimal getEfficiency()
- Specified by:
getEfficiency in interface TreeLeaf
getEnergy
public java.math.BigDecimal getEnergy()
- Specified by:
getEnergy in interface TreeLeaf
collectFreeEnergy
public java.math.BigDecimal collectFreeEnergy()
- Specified by:
collectFreeEnergy in interface TreeLeaf
getAge
public int getAge()
- Specified by:
getAge in interface LivingPart
getTreeLeaf3D
public TreeLeaf3D getTreeLeaf3D()
- Specified by:
getTreeLeaf3D in interface TreeLeaf
getState
public TreeLeafState getState()
- Specified by:
getState in interface Persistent<State>
synchronize
public void synchronize()
- Specified by:
synchronize in interface Persistent<State>
Copyright © 2010. All Rights Reserved.