All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scripts.conditions.slot.js Maven / Gradle / Ivy

The newest version!
//@Condition()

key = "slot";

names = ["槽位: (?.*)"];

function parameters(matcher, text) {
  var requiredSlot = matcher.group("slot");
  return mapOf({ required: requiredSlot });
}

function condition(entity, map) {
  if (entity == null) return true;
  // 槽位会自动初始化到参数中
  const slot = map.get("slot");
  const required = map.get("required");
  if (slot == null || required == null) return true;
  return slot.equalsIgnoreCase(required);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy