2011-05-13 04:24:42 -04:00
|
|
|
package org.moparscape.msc.gs.npchandler;
|
2011-04-27 01:44:26 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The definition of a npc handler, for use with XStream.
|
|
|
|
*/
|
|
|
|
public class NpcHandlerDef {
|
2011-06-25 01:44:53 -04:00
|
|
|
/**
|
|
|
|
* The name of the handler class
|
|
|
|
*/
|
|
|
|
public String className;
|
|
|
|
/**
|
|
|
|
* The IDs of npcs which the handler is responsible for
|
|
|
|
*/
|
|
|
|
public int[] ids;
|
2011-04-27 01:44:26 -04:00
|
|
|
|
2011-06-25 01:44:53 -04:00
|
|
|
/**
|
|
|
|
* Constructs a new packet handler definition, entailing that npcs with the
|
|
|
|
* given IDs are to be handled by the specified class.
|
|
|
|
*
|
|
|
|
* @param ids
|
|
|
|
* The IDs of npcs to be handled
|
|
|
|
* @param className
|
|
|
|
* The name of the packet handler class
|
|
|
|
*/
|
|
|
|
public NpcHandlerDef(int[] ids, String className) {
|
|
|
|
this.ids = ids;
|
|
|
|
this.className = className;
|
|
|
|
}
|
2011-04-27 01:44:26 -04:00
|
|
|
|
2011-06-25 01:44:53 -04:00
|
|
|
/**
|
|
|
|
* Returns the IDs of npcs to be handled.
|
|
|
|
*
|
|
|
|
* @return An <code>int</code> array containing the IDs of npcs to be
|
|
|
|
* handled.
|
|
|
|
*/
|
|
|
|
public int[] getAssociatedNpcs() {
|
|
|
|
return ids;
|
|
|
|
}
|
2011-04-27 01:44:26 -04:00
|
|
|
|
2011-06-25 01:44:53 -04:00
|
|
|
/**
|
|
|
|
* Returns the name of the npc handler class.
|
|
|
|
*
|
|
|
|
* @return The name of the npc handler's class
|
|
|
|
*/
|
|
|
|
public String getClassName() {
|
|
|
|
return className;
|
|
|
|
}
|
2011-04-27 01:44:26 -04:00
|
|
|
}
|