Class RPLink

java.lang.Object
marauroa.common.game.RPLink
All Implemented Interfaces:
Cloneable, Serializable

public class RPLink extends Object implements Serializable, Cloneable
An RPLink represent an object relation that is not as strong as RPSlot, and although it could be modelled with a slot it would be better to manage it with an RPLink. I.e: Buddies are handle now with a slot, when buddies are not an slot, so it just makes code harder and more prone to error. Buddies are not an slot in the sense that it is not something that a player contains, but an abstraction of something that a player is aware of. Bag is an slot Buddies should be an RPLink
Author:
miguel
  • Constructor Details

    • RPLink

      public RPLink(String name, RPObject object)
      Constructor
      Parameters:
      name - name of link
      object - target object
  • Method Details

    • getName

      public String getName()
      Return the name of the rplink
      Returns:
      the name of the rplink
    • setObject

      public void setObject(RPObject object)
      Sets the object for this RPLink.
      Parameters:
      object - the object that will represent this RPLink.
    • getObject

      public RPObject getObject()
      Returns the object that represent this rplink.
      Returns:
      the object that represent this rplink.
    • clone

      public Object clone()
      Overrides:
      clone in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • writeObject

      public void writeObject(OutputSerializer out) throws IOException
      Description copied from interface: Serializable
      Method to convert the object into a stream
      Specified by:
      writeObject in interface Serializable
      Parameters:
      out - OutputSerializer to write the object to
      Throws:
      IOException - in case of an IO-error
    • writeObject

      public void writeObject(OutputSerializer out, DetailLevel level) throws IOException
      Method to convert the object into a stream
      Parameters:
      out - OutputSerializer to write the object to
      level - DetailLevel
      Throws:
      IOException - in case of an IO-error
    • readObject

      public void readObject(InputSerializer in) throws IOException
      Description copied from interface: Serializable
      Method to build the object from a stream of bytes
      Specified by:
      readObject in interface Serializable
      Parameters:
      in - InputSerializer to read from
      Throws:
      IOException - in case of an IO-error
    • equals

      public boolean equals(Object obj)
      Returns true if two objects are exactly equal
      Overrides:
      equals in class Object
      Parameters:
      obj - the object to compare with this one.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object