/*
 * 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.util;

/**
 * Stub RIG Phase 0 — encodage résultat d'attaque combat EF. Utilisé uniquement
 * comme type pour {@code ATTACK_RESULT} StateFactor côté EntityState. Pas de
 * logique combat dans TiedUp — logique porté Phase 2 si besoin hitboxes menottes.
 */
public class AttackResult {
	public final ResultType resultType;
	public final float damage;

	public AttackResult(ResultType resultType, float damage) {
		this.resultType = resultType;
		this.damage = damage;
	}

	public static AttackResult success(float damage) { return new AttackResult(ResultType.SUCCESS, damage); }
	public static AttackResult blocked(float damage) { return new AttackResult(ResultType.BLOCKED, damage); }
	public static AttackResult missed(float damage) { return new AttackResult(ResultType.MISSED, damage); }
	public static AttackResult of(ResultType resultType, float damage) { return new AttackResult(resultType, damage); }

	public static enum ResultType {
		SUCCESS(true, true), MISSED(false, false), BLOCKED(false, true);

		boolean dealtDamage;
		boolean shouldCount;

		ResultType(boolean dealtDamage, boolean countAsHitEntity) {
			this.dealtDamage = dealtDamage;
			this.shouldCount = countAsHitEntity;
		}

		public boolean dealtDamage() { return this.dealtDamage; }
		public boolean shouldCount() { return this.shouldCount; }
	}
}
