コード例 #1
0
ファイル: MicroManager.cs プロジェクト: srferran/ES2015A
 public MicroManager(AIController ai)
 {
     agents = new List<BaseAgent>();
     squads = new List<Squad>();
     this.ai = ai;
     AssistAgent assistAgent = new AssistAgent(ai, "Assist");
     AttackAgent aA = new AttackAgent(ai, assistAgent, "Atack");
     agents.Add(aA);
     AGENT_ATACK = 0;
     if (!ai.StoryMode)
     {
         AGENT_EXPLORER = 1;
         AGENT_RETREAT = 2;
         AGENT_ASSIST = 3;
         AGENT_STRATEGY = 4;
         agents.Add(new ExplorerAgent(ai, assistAgent, "Explorer"));
     }
     else
     {
         AGENT_RETREAT = 1;
         AGENT_ASSIST = 2;
         AGENT_STRATEGY = 3;
     }
     agents.Add(new RetreatAgent(ai, aA, assistAgent, "Retreat"));
     agents.Add(assistAgent);
     agents.Add(new StrategyAgent(ai, assistAgent, "Strategy"));
     squads.Add(new Squad(ai.race,ai.DifficultyLvl)); //Hero
     squads.Add(new Squad(ai.race, ai.DifficultyLvl));
 }
コード例 #2
0
ファイル: AIArchitect.cs プロジェクト: srferran/ES2015A
        public AIArchitect(AIController aiController)
        {
            defences = new Queue<BuildingTypes>();
            avaliablePositions = new Dictionary<StructureType, List<Vector3>>();
            avaliablePositions.Add(StructureType.MILITARY_BUILDING, new List<Vector3>());
            avaliablePositions.Add(StructureType.RESOURCE_BUILDING, new List<Vector3>());
            avaliablePositions.Add(StructureType.TOWER, new List<Vector3>());
            avaliablePositions.Add(StructureType.HORIZONTALL_WALL, new List<Vector3>());
            avaliablePositions.Add(StructureType.VERTICALL_WALL, new List<Vector3>());
            avaliablePositions.Add(StructureType.CORNER_WALL, new List<Vector3>());
            avaliablePositions.Add(StructureType.DEFENCE_ZONE, new List<Vector3>());
            constructionGrid = GameObject.Find("GameController").GetComponent<ConstructionGrid>();
            buildingsPlaced = 0;
            ai = aiController;

            baseCriticPoints = new List<Vector3>();
            constructionGrid.reservePositionForStronghold(ai.rootBasePosition);

            if(constructionGrid.mode == AIController.AIMode.BATTLE)
            {
                planifyBuildingsAccordingToDifficulty();
                readMapData();
            }
            else
            {
                buildingPrefs = new List<BuildingTypes>();
            }
        }
コード例 #3
0
    private void loadPlayers()
    {
        int id = 1;

        foreach (Battle.PlayerInformation player in info.GetBattle().GetPlayerInformationList())
        {
            // TODO It would be better if it wasn't race dependent
            if (player.Race != info.GetPlayerRace())
            {
                Assets.Scripts.AI.AIController ai = gameObject.AddComponent <Assets.Scripts.AI.AIController>();
                ai.PlayerID = id;
            }
            else
            {
                user          = gameObject.AddComponent <Player>();
                user.PlayerID = id;
            }
            id++;
        }
        // TODO Set initial resources in the map
    }