feat(phase-2): pure-Java chain resolution algorithm

Adds com.mythlane.chainlightning.chain package with 7 types (Vec3,
ChainEntity, EntitySource, RayCaster, ChainParameters, ChainHit,
ChainResolver). Algorithm: ray-cast primary target then BFS hops with
distanceSquared closest-neighbor selection, deterministic lexicographic
tie-breaker on entity id, max 5 targets, 8-block radius, damage curve
[8,6,4,3,2]. Strict no-Hytale-imports boundary — runtime adapters land
in Phase 3.

JUnit 5 suite: 25 tests green (Vec3 5 + ChainParameters 10 +
ChainResolver 10). All 10 mandatory cases covered (no primary,
primary-only, full chain, overflow, out-of-radius, no-double-hit,
closest, tie-breaker determinism, dead entity, custom maxTargets).
This commit is contained in:
2026-04-26 19:29:20 +02:00
parent edca00fa4a
commit cd5d0bedd3
11 changed files with 553 additions and 0 deletions
@@ -0,0 +1,11 @@
package com.mythlane.chainlightning.chain;
/**
* Contrat minimal d'une cible de chaîne. Stable, mockable, sans dépendance Hytale.
* Phase 3 adaptera l'entité Hytale vers ChainEntity à la frontière.
*/
public interface ChainEntity {
String id();
Vec3 position();
boolean isAlive();
}