Ejemplo n.º 1
0
    public void ResetModel()
    {
        currentPhase = testPhase.SETUP;
        actionButton.GetComponentInChildren<Text>().text = "Start";
        this.SetTestReadiness(false);

        attackersIndex = 0;
        defendersIndex = 0;

        model = new Combat();
        model.PhaseChanged += OnCombatPhaseChanged;
        List<UnitGroup> attackers = new List<UnitGroup>();
        List<UnitGroup> defenders = new List<UnitGroup>();
        string[] unitTypeNames = UnitType.GetAllUnitTypeNames();

        for (int i = 0; i < unitTypeNames.Length; i++)
        {
            UnitType type = UnitType.GetUnitType(unitTypeNames[i]);
            if (type != null)
            {
                attackers.Add(new UnitGroup(type, 0));
                defenders.Add(new UnitGroup(type, 0));
            }
        }

        model.SetupGroups(attackers, defenders);
        DestroyAttackRollAttackResultObjects();
        UpdateUnitGroupViews();
    }