Exemplo n.º 1
0
        public BuildTown(IMapController map, double kNearestTown, double kTownItself, double kPoints, int depth, BuildSourceBuilding buildingGoal)
            : base(map, depth, "Build Town")
        {
            lastBestTown = null;

            double sum = (kNearestTown + kTownItself + kPoints);
            this.kNearestTown = kNearestTown / sum;
            this.kTownItself = kTownItself / sum;
            this.kPoints = kPoints / sum;
            this.buildingGoal = buildingGoal;
        }
Exemplo n.º 2
0
        private void AddMainGoals()
        {
            int offset = 0;
            if (coeficients.Length == 11)
                offset = 0;
            else if(coeficients.Length == 22 && level == 1)
                offset = 11;

            mainGoals = new LinkedList<MainGoal>();

            BuildSourceBuilding buildSourceBuilding = new BuildSourceBuilding(map, coeficients[offset + 2][1], coeficients[offset + 2][2], coeficients[offset + 2][3], depth + 1);
            mainGoals.AddLast(new MainGoal(new BuildTown(map, coeficients[offset + 0][1], coeficients[offset + 0][2], coeficients[offset + 0][3], depth + 1, buildSourceBuilding), coeficients[offset + 0][0]));
            mainGoals.AddLast(new MainGoal(new BuildRoad(map, coeficients[offset + 1][1], depth + 1), coeficients[offset + 1][0]));
            mainGoals.AddLast(new MainGoal(buildSourceBuilding, coeficients[offset + 2][0]));

            if (!map.IsBanAction(PlayerAction.BuildFort))
            {
                mainGoals.AddLast(new MainGoal(new BuildFort(map, coeficients[offset + 3][1], coeficients[offset + 3][2], coeficients[offset + 3][3], coeficients[offset + 3][4], depth + 1), coeficients[offset + 3][0]));
                if (!map.IsBanAction(PlayerAction.FortParade))
                    mainGoals.AddLast(new MainGoal(new FortShowParade(map, coeficients[offset + 4][1], depth + 1), coeficients[offset + 4][0]));
                if (!map.IsBanAction(PlayerAction.FortStealSources))
                    mainGoals.AddLast(new MainGoal(new FortStealSources(map, coeficients[offset + 9][1], depth + 1), coeficients[offset + 9][0]));
                if (!map.IsBanAction(PlayerAction.FortCaptureHexa))
                    mainGoals.AddLast(new MainGoal(new FortCaptureHexa(map, coeficients[offset + 10][1], depth + 1), coeficients[offset + 10][0]));
            }
            if (!map.IsBanAction(PlayerAction.BuildMarket))
            {
                mainGoals.AddLast(new MainGoal(new BuildMarket(map, coeficients[offset + 5][1], coeficients[offset + 5][2], coeficients[offset + 5][3], coeficients[offset + 5][4], coeficients[offset + 5][5], depth + 1), coeficients[offset + 5][0]));
                mainGoals.AddLast(new MainGoal(new BuyLicence(map, coeficients[offset + 8][1], depth + 1), coeficients[offset + 8][0]));
            }
            if (!map.IsBanAction(PlayerAction.BuildMonastery))
            {
                mainGoals.AddLast(new MainGoal(new BuildMonastery(map, coeficients[offset + 6][1], coeficients[offset + 6][2], coeficients[offset + 6][3], coeficients[offset + 6][4], coeficients[offset + 6][5], depth + 1), coeficients[offset + 6][0]));
                mainGoals.AddLast(new MainGoal(new InventUpgrade(map, coeficients[offset + 7][1], depth + 1), coeficients[offset + 7][0]));
            }
        }