/**
 * Given the health of entity1 and the damage done by entity2, calculate the new health of entity1 after the damage.
 * The function should return a Pair containing the new entity1 health and a boolean indicating if it survived the attack.
 *
 * @param entity1Health The current health of entity1.
 * @param entity2Damage The damage dealt by entity2.
 * @return A Pair containing the new health of entity1 and a boolean (true if entity1 survives, false otherwise).
 */
fun calculateEntityDamage(entity1Health: Int, entity2Damage: Int): Pair<Int, Boolean> {

    val newHealth = entity1Health - entity2Damage
    val survived = newHealth > 0
    return Pair(newHealth, survived)
}
/**
 * Given the health of entity1 and the damage done by entity2, calculate the new health of entity1 after the damage.
 * The function should return a Pair containing the new entity1 health and a boolean indicating if it survived the attack.
 *
 * @param entity1Health The current health of entity1.
 * @param entity2Damage The damage dealt by entity2.
 * @return A Pair containing the new health of entity1 and a boolean (true if entity1 survives, false otherwise).
 */
fun calculateEntityDamage(entity1Health: Int, entity2Damage: Int): Pair<Int, Boolean> {
/**
 * Given the health of entity1 and the damage done by entity2, calculate the new health of entity1 after the damage.
 * The function should return a Pair containing the new entity1 health and a boolean indicating if it survived the attack.
 *
 * @param entity1Health The current health of entity1.
 * @param entity2Damage The damage dealt by entity2.
 * @return A Pair containing the new health of entity1 and a boolean (true if entity1 survives, false otherwise).
 */
fun calculateEntityDamage(entity1Health: Int, entity2Damage: Int): Pair<Int, Boolean> {

    val newHealth = entity1Health - entity2Damage
    val survived = newHealth > 0
    return Pair(newHealth, survived)
}