/*
 * Derived from Epic Fight (https://github.com/Epic-Fight/epicfight)
 * by the Epic Fight Team, licensed under GPLv3.
 * Modifications © 2026 TiedUp! Remake Contributors, distributed under GPLv3.
 */

package com.tiedup.remake.rig.physics.ik;

import java.util.Optional;
import java.util.function.BooleanSupplier;

import com.tiedup.remake.rig.armature.Joint;
import com.tiedup.remake.rig.physics.PhysicsSimulator;
import com.tiedup.remake.rig.physics.SimulationObject;

/**
 * RIG stub. Upstream EF : simulateur d'inverse kinematics (solveur CCD
 * ou FABRIK) utilisé pour attacher des membres à des points cibles
 * pendant les animations d'attaque combat. Non utilisé en TiedUp.
 *
 * <p>Conservé comme shell vide pour que les imports StaticAnimation +
 * AnimationProperty compilent. Les nested types sont des stubs sans
 * logique.</p>
 */
public class InverseKinematicsSimulator implements PhysicsSimulator<Joint, InverseKinematicsSimulator.InverseKinematicsBuilder, InverseKinematicsProvider, InverseKinematicsSimulatable, InverseKinematicsSimulator.InverseKinematicsObject> {

	@Override public void tick(InverseKinematicsSimulatable object) {}
	@Override public boolean isRunning(Joint key) { return false; }
	@Override public void runUntil(Joint key, InverseKinematicsProvider provider, InverseKinematicsBuilder builder, BooleanSupplier when) {}
	@Override public void runWhen(Joint key, InverseKinematicsProvider provider, InverseKinematicsBuilder builder, BooleanSupplier when) {}
	@Override public void restart(Joint key) {}
	@Override public void stop(Joint key) {}
	@Override public Optional<InverseKinematicsObject> getRunningObject(Joint key) { return Optional.empty(); }


	public static class InverseKinematicsObject implements SimulationObject<InverseKinematicsBuilder, InverseKinematicsProvider, InverseKinematicsSimulatable> {
		public InverseKinematicsObject(InverseKinematicsBuilder builder) {
			// no-op
		}
	}

	public static class InverseKinematicsBuilder extends SimulationObject.SimulationObjectBuilder {
		// no-op stub
	}

	/**
	 * Définition d'une chaîne IK (armature joint + cible). Stub avec
	 * juste la méthode {@code bake()} appelée par StaticAnimation.
	 */
	public static class InverseKinematicsDefinition {
		public BakedInverseKinematicsDefinition bake(
				Object armature,
				Object jointTransforms,
				boolean correctY,
				boolean correctZ) {
			return new BakedInverseKinematicsDefinition();
		}
	}

	public static class BakedInverseKinematicsDefinition {
		// no-op stub
	}
}
