public void endWar(War war, Nation attacker, Nation defender)
    {
        Debug.Log("End war");
        warPanel.SetActive(false);
        App           app         = UnityEngine.Object.FindObjectOfType <App>();
        int           playerIndex = app.GetHumanIndex();
        Nation        human       = State.getNations()[playerIndex];
        Province      prov        = State.getProvince(0);
        EventRegister eventLogic  = State.eventRegister;
        DecisionEvent newEvent    = new DecisionEvent();

        if (war.ProvIndex != -1)
        {
            prov = State.getProvince(war.ProvIndex);
        }

        if (war.AttackerForces == 0 || war.AttackerMorale == 0)
        {
            Debug.Log("Attack fails");
            // Attack fails and defender wins
            attacker.decreasePrestige(2);
            defender.increasePrestige(2);
            attacker.landForces.Morale -= 10;
            defender.landForces.Morale += 10;
            int payment = (int)(attacker.getGold() / 3);
            PlayerPayer.payAnotherPlayer(attacker, defender, payment);

            if (war.AttackerIndex == human.getIndex())
            {
                eventLogic.initializeFailedInvasionEvent(newEvent, currentEvent, war);
            }
            else
            {
                eventLogic.initializeSucessfulDefenseEvent(newEvent, currentEvent, war);
            }
            currentEvent = newEvent;
            showDecisionPanel(human);
        }

        else if (war.DefenderMorale == 0 || war.DefenderForces == 0)
        {
            // Attack succeeds
            Debug.Log("Attack succeeds");
            attacker.increasePrestige(2);
            defender.decreasePrestige(2);
            attacker.landForces.Morale += 10;
            defender.landForces.Morale -= 10;
            if (war.ProvIndex > -1)
            {
                prov.changeProvinceControl(defender, attacker);
                MapChange        newMapChange = new MapChange(defender.getIndex(), attacker.getIndex(), prov.getIndex());
                List <MapChange> mapChanges   = State.MapChanges;
                mapChanges.Add(newMapChange);
            }
            else
            {
                int payment = (int)(defender.getGold() / 3);
                PlayerPayer.payAnotherPlayer(defender, attacker, payment);
            }

            if (war.AttackerIndex == human.getIndex())
            {
                eventLogic.initializeSucessfulInvasionEvent(newEvent, currentEvent, war);
                currentEvent = newEvent;
                showDecisionPanel(human);
            }
            else
            {
                eventLogic.initializeFailedDefenseEvent(newEvent, currentEvent, war);
                currentEvent = newEvent;
                showDecisionPanel(human);
            }
        }
    }