Record Class PersonaRecord

java.lang.Object
java.lang.Record
io.github.protasm.jvmud.engine.identity.PersonaRecord

public record PersonaRecord(PersonaId id, Optional<Entity> entity, Optional<PlayerId> controllingPlayerId, Optional<Object> mudlibBehaviorProjection) extends Record
Engine-owned record for the Player's in-World manifestation.

The entity link may be absent while a compatibility runtime is still attaching a legacy mudlib object before full World entity integration.

The mudlib behavior projection is opaque to the runtime model. Compatibility layers may use it to associate LPC-authored behavior, such as LP245's combined player object.

  • Constructor Details

    • PersonaRecord

      public PersonaRecord(PersonaId id, Optional<Entity> entity, Optional<PlayerId> controllingPlayerId, Optional<Object> mudlibBehaviorProjection)
      Creates an instance of a PersonaRecord record class.
      Parameters:
      id - the value for the id record component
      entity - the value for the entity record component
      controllingPlayerId - the value for the controllingPlayerId record component
      mudlibBehaviorProjection - the value for the mudlibBehaviorProjection record component
    • PersonaRecord

      public PersonaRecord(PersonaId id, Entity entity)
    • PersonaRecord

      public PersonaRecord(PersonaId id)
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • id

      public PersonaId id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • entity

      public Optional<Entity> entity()
      Returns the value of the entity record component.
      Returns:
      the value of the entity record component
    • controllingPlayerId

      public Optional<PlayerId> controllingPlayerId()
      Returns the value of the controllingPlayerId record component.
      Returns:
      the value of the controllingPlayerId record component
    • mudlibBehaviorProjection

      public Optional<Object> mudlibBehaviorProjection()
      Returns the value of the mudlibBehaviorProjection record component.
      Returns:
      the value of the mudlibBehaviorProjection record component