Marauroa Core API: Difference between revisions
Content deleted Content added
imported>StephenIerodiaconou No edit summary |
imported>MiguelAngelBlanchLardin |
||
Line 171:
=RPWorld=
This class is just a container of zones.
RPWorld provides several methods to make easier the handling of RPZones.
onInit and onFinish are called on server startup and finalization. You need to subclass RPWorld to give proper behaviour to them.
public void onInit() throws Exception
public void onFinish() throws Exception
Some helper methods to add zones and iterate them.
public void addRPZone(IRPZone zone)
public IRPZone getRPZone(IRPZone.ID zoneid)
public IRPZone getRPZone(RPObject.ID objectid)
public Iterator<IRPZone> iterator()
public int size()
Methods to add,get,test existence, remove and modify objects.
Modify is as you know for delta^2 algorithm.
public void add(RPObject object) throws NoRPZoneException, RPObjectInvalidException
public RPObject get(RPObject.ID id) throws NoRPZoneException, RPObjectInvalidException
public boolean has(RPObject.ID id) throws NoRPZoneException, RPObjectInvalidException
public RPObject remove(RPObject.ID id) throws NoRPZoneException, RPObjectNotFoundException
public void modify(RPObject object) throws NoRPZoneException
These are helper methods for changing the zone of an object. Use them instead of doing it by hand.
public void changeZone(IRPZone.ID oldzoneid, IRPZone.ID newzoneid, RPObject object) throws NoRPZoneException
public void changeZone(String oldzone, String newzone, RPObject object) throws NoRPZoneException
=IRPZone=
| |||