RuleConst

ldtk.rules.RuleConst (Class)

Constants shared by every consumer of the auto-layer rule engine. Rule pattern cell encoding: 0 = ignored, +v = IntGrid value v required, -v = value v forbidden, +/-ANYTHING = any value / no value, (groupUid+1)*GROUP_VALUE_BASE = any value of an IntGrid group.

Static Members

ANYTHING: Int

Special pattern value meaning "any IntGrid value" (positive) or "no IntGrid value" (negative)


MAX_PATTERN_SIZE: Int

Largest supported pattern size (must be odd)


MAX_RADIUS: Int

Half of MAX_PATTERN_SIZE, used to expand recompute rectangles


GROUP_VALUE_BASE: Int

Pattern values above this encode IntGrid groups


AREA_SIZE: Int

Size (in cells) of the square areas used by the IntGrid value prefilter


groupUidFromRuleValue(ruleValue: Int): Int
Name Type
ruleValue Int
Returns
Int

ruleValueFromGroupUid(groupUid: Int): Int
Name Type
groupUid Int
Returns
Int

isGroupValue(absValue: Int): Bool
Name Type
absValue Int
Returns
Bool

isValidPatternSize(size: Int): Bool
Name Type
size Int
Returns
Bool