Class RPObject.ID

java.lang.Object
marauroa.common.game.RPObject.ID
Enclosing class:
RPObject

public static class RPObject.ID extends Object
This class stores the basic identification for a RPObject
  • Constructor Details

    • ID

      public ID(int objectid, String zone)
      Constructor
      Parameters:
      objectid - the object id
      zone - the zone
    • ID

      public ID(int objectid, IRPZone.ID zoneid)
      Constructor
      Parameters:
      objectid - the object id
      zoneid - the zone-id
    • ID

      public ID(RPObject attr)
      Constructor
      Parameters:
      attr - an RPObject containing object_id attribute
    • ID

      public ID(RPAction attr)
      Constructor
      Parameters:
      attr - an RPAction containing sourceid attribute
  • Method Details

    • getObjectID

      public int getObjectID()
      This method returns the object id
      Returns:
      the object id.
    • getZoneID

      public String getZoneID()
      returns the zone id as string
      Returns:
      zone id
    • equals

      public boolean equals(Object anotherid)
      This method returns true of both ids are equal.
      Overrides:
      equals in class Object
      Parameters:
      anotherid - another id object
      Returns:
      true if they are equal, or false otherwise.
    • hashCode

      public int hashCode()
      We need it for HashMap
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      This method returns a String that represent the object
      Overrides:
      toString in class Object
      Returns:
      a string representing the object.