rle.simple.board.item
Class SimpleItemFactory
java.lang.Object
rle.core.vm.PlugInBase
rle.simple.board.item.SimpleItemFactory
- All Implemented Interfaces:
- PlugIn
public class SimpleItemFactory
- extends PlugInBase
Used to create items. Item creation follows this basic outline:
1. CreationContext info is used to pick item type
2. Item object instantiated and setConfig() called
3. Magic and any additional properties are handled by a pluggable ItemFinisher
Some basic conclusions follow from this. If you'd like to influence the type
of item chosen, provide a hint with the CreationContext. If you want higher
quality items, use either an ICC hint or provide an ICC with a higher level. If
you want to modify bonuses or any other arbitrary stuff modeled by Item attributes,
the best place to do so is with an ItemFinisher because it has the last word,
although it cannot actually cause a different Item object to be returned.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SimpleItemFactory
public SimpleItemFactory()
create
public Item create(Board d)
- Create an item with a CreationContext configured for this Board.
create
public Item create(CreationContext cc)
- Create an item using the given context.
createItem
public Item createItem(InfoView info)