Skip to main content

✅ Is in range in range uses source unit data

CategoryInteraction
StatusPassing
Testtests/test_targeting.py::test_is_in_range_in_range_uses_source_unit_data

Range.IN_RANGE defers to the source demon's own range_enum.

Preconditions

  • source is Duban (#001), range=Local, in lane 0.

  • target_same is in lane 0.

  • target_different is in lane 1.

Action

  • is_in_range(source, target_same, Range.IN_RANGE)

  • is_in_range(source, target_different, Range.IN_RANGE)

source = make_demon("001", lane=0)   # Duban — Local range
target_same = make_demon("002", lane=0)
target_different = make_demon("093", lane=1)

Expected Postconditions

  • Same-lane target: True (Duban is Local, lane 0 == lane 0).

  • Different-lane target: False (Duban is Local, lane 0 != lane 1).

  • IN_RANGE resolves to LOCAL → same-lane check.

Assertions

assert is_in_range(source, target_same, Range.IN_RANGE) is True
assert is_in_range(source, target_different, Range.IN_RANGE) is False