Marauroa Core API: Difference between revisions
Content deleted Content added
No edit summary |
imported>StephenIerodiaconou No edit summary |
||
Line 82:
* ''void isA(RPClass parent)''
These methods add attributes to the RPClass and set their type and visibility. You can also set the parent of this class. Of course, however, a class can have no parent (be parentless).
Once the class has been filled, you can query the data using these methods. These methods alow you to get the class name of the class, the the type of an attribute, determine if an attribute exists and to know if that RPClass is a subclass of another.<br>
Line 117:
</pre>
Each time you create a new RPClass
Notice
Note: You can choose not to use RPClasses
= RPAction =
It is up to you to create these when you design your game
= RPObject and RPSlot =
RPSlots are slots on objects that items can be placed on/in, such as backpacks, pockets, boxes, ...<br>
The methods of the RPObject to modify slots are:
* ''void addSlot(RPSlot slot)''
* RPSlot getSlot(String name)▼
*
*
* ''Iterator slotIterator()''
* ''RPObject.ID getID()''▼
▲These methods adds a slot to the object, retrieve it, remove it and test if the slot exists. Finally the slot iterator is used to visit all the slots in the object.
This is a helper method to get the unique ID of the object.▼
▲* RPObject.ID getID()
▲This is a helper method to get the ID of the object.
▲RPSlot has also a very simple API:
* void add(RPObject object)
* RPObject get(RPObject.ID id)
Line 145:
* RPObject remove(RPObject.ID id)
* void clear()
These methods modify objects in the RPSlot.
The clear() method removes all the
* Iterator iterator()
Line 164:
</pre>
Now for the complex part
=RPWorld=
TODO
=IRPZone=
The methods are:
<pre>
/** This method is called when the zone is created to
public void onInit() throws Exception;
/** This method is called when the server finish to save the content of the zone */
Line 204 ⟶ 205:
</pre>
In most of the cases all you will
* onInit
* onFinish
Line 211 ⟶ 212:
=IRPRuleProcessor=
This class *MUST* be implemented fully, but it is a
The API is as follows:
<pre>
/** Set the context where the actions are executed.
| |||