示例#1
0
    public EnemyParty loadSpecificEnemyParty(int idOfCorridor, int idOfEnemyParty)
    {
        //Checks whatever there are already created parties of enemies
        EnemyParty generatedEnemyParty = dungeonManager.getLevelsArray().Find(x => x.getIdOfLevel() == idOfCorridor).getSpecificEnemyParty(idOfEnemyParty);

        //Adds EnemyParty to DungeonManager || DungeonLevel || enemyParties
        generatedEnemyParty.loadAlreadyExistingSettingOfEnemies(idOfCorridor, idOfEnemyParty, true);
        generatedEnemyParty.displayHealthBarsOnEnemies(idOfCorridor, idOfEnemyParty, true);
        return(generatedEnemyParty);
    }
示例#2
0
    public void loadEnemyParties()
    {
        //Reading already written number of parties
        int howManyToLoad = dungeonManager.getLevelsArray().Find(x => x.getIdOfLevel() == idOfCorridor).getEnemyParties().Count;

        Debug.Log("DungeonsGenerator || loadEnemyParties || How many enemy parties to load: " + howManyToLoad);
        string debugString = "";

        for (int i = 0; i < howManyToLoad; i++)
        {
            Debug.Log("DungeonsGenerator || loadEnemyParties || How many levels are generated already: " + dungeonManager.getLevelsArray().Count);
            Debug.Log("DungeonsGenerator || loadEnemyParties || Current corridor: " + idOfCorridor);

            for (int Ii = 0; Ii < dungeonManager.getLevelsArray().Count; Ii++)
            {
                debugString += dungeonManager.getLevelsArray()[Ii].getIdOfLevel() + " ";
            }
            Debug.Log("DungeonsGenerator || loadEnemyParties || SavedId's(already generated levels): " + debugString);


            Debug.Log("DungeonsGenerator || loadEnemyParties || How many enemies parties are there: " + dungeonManager.getLevelsArray().Find(x => x.getIdOfLevel() == idOfCorridor).getEnemyParties().Count);
            //Creates new party with current number of objects, and IdOfCorridor
            //Checks whatever there are already created parties of enemies
            EnemyParty generatedEnemyParty = dungeonManager.getLevelsArray().Find(x => x.getIdOfLevel() == idOfCorridor).getSpecificEnemyParty(i);
            //Adds newly created EnemyParty to DungeonManager || DungeonLevel || enemyParties
            generatedEnemyParty.loadAlreadyExistingSettingOfEnemies(idOfCorridor, i);
            Debug.Log("DungeonsGenerator || loadEnemyParties || Generating party number " + i);
            debugString = "";
        }
        for (int i = 0; i < dungeonManager.getLevelsArray().Find(x => x.getIdOfLevel() == idOfCorridor).getEnemyParties().Count; i++)
        {
            debugString += dungeonManager.getLevelsArray().Find(x => x.getIdOfLevel() == idOfCorridor).getEnemyParties()[i].getInitialPositionX() + " ";
        }
        Debug.Log("DungeonsGenerator || loadEnemyParties || Possitions of " +
                  dungeonManager.getLevelsArray().Find(x => x.getIdOfLevel() == idOfCorridor).getEnemyParties().Count + " enemy parties on this levels: " + debugString);
    }