类 RidingRelationship

java.lang.Object
top.r3944realms.superleadrope.util.model.RidingRelationship

public class RidingRelationship extends Object
骑乘关系数据结构
  • 构造器详细资料

    • RidingRelationship

      public RidingRelationship()
      Instantiates a new Riding relationship.
    • RidingRelationship

      public RidingRelationship(List<RidingRelationship> passengers, UUID vehicleId, UUID entityId)
      Instantiates a new Riding relationship.
      参数:
      passengers - the passengers
      vehicleId - the vehicle id
      entityId - the entity id
  • 方法详细资料

    • getEntityId

      public UUID getEntityId()
      Gets entity id.
      返回:
      the entity id
    • setEntityId

      public void setEntityId(UUID entityId)
      Sets entity id.
      参数:
      entityId - the entity id
    • getPassengers

      public List<RidingRelationship> getPassengers()
      Gets passengers.
      返回:
      the passengers
    • setPassengers

      public void setPassengers(List<RidingRelationship> passengers)
      Sets passengers.
      参数:
      passengers - the passengers
    • addPassenger

      public void addPassenger(RidingRelationship passenger)
      Add passenger.
      参数:
      passenger - the passenger
    • getVehicleId

      public UUID getVehicleId()
      Gets vehicle id.
      返回:
      the vehicle id
    • setVehicleId

      public void setVehicleId(UUID vehicleId)
      Sets vehicle id.
      参数:
      vehicleId - the vehicle id
    • getTotalPassengerCount

      public int getTotalPassengerCount()
      获取所有嵌套乘客的数量
      返回:
      the total passenger count
    • containsEntity

      public boolean containsEntity(UUID entityId)
      检查是否包含特定实体
      参数:
      entityId - the entity id
      返回:
      the boolean
    • findAndReplaceAll

      public int findAndReplaceAll(UUID oldUuid, UUID newUuid)
      查找并替换所有匹配的UUID
      参数:
      oldUuid - 要查找的旧UUID
      newUuid - 要替换的新UUID
      返回:
      替换的数量 int
    • findAllOccurrences

      public List<String> findAllOccurrences(UUID targetUuid)
      查找所有出现的UUID位置
      参数:
      targetUuid - 要查找的UUID
      返回:
      包含位置的列表 ,格式为"角色(实体/载具)-索引"
    • batchFindAndReplace

      public int batchFindAndReplace(Map<UUID,UUID> replacements)
      查找并替换所有UUID(支持批量替换)
      参数:
      replacements - 替换映射表,key为旧UUID,value为新UUID
      返回:
      总替换数量 int
    • getAllUniqueUUIDs

      public Set<UUID> getAllUniqueUUIDs()
      获取树中所有唯一的UUID集合
      返回:
      包含所有UUID的集合 all unique uui ds
    • toString

      public String toString()
      覆盖:
      toString 在类中 Object