Esempio n. 1
0
        /// <summary>
        /// Build the reverse weighting map
        /// </summary>
        private void BuildReverseWeightingMap()
        {
            // Set goals
            staticReverseCrateWeighting = new Matrix(initialCrateMap, 10f);

            // Average
            staticReverseCrateWeighting = staticReverseCrateWeighting.Average(boundryMap);
        }
Esempio n. 2
0
        /// <summary>
        /// Build the weighting maps
        /// </summary>
        private void BuildForwardWeightingMap()
        {
            // All goal weightings
            staticForwardCrateWeighting = new Matrix(goalMap,55f);

            // Corner goals get another 10
            Bitmap cornerGoals = goalMap.BitwiseAND(cornerMap);
            staticForwardCrateWeighting = staticForwardCrateWeighting.Add(new Matrix(cornerGoals, 33f));

            staticForwardCrateWeighting = staticForwardCrateWeighting.Average(boundryMap);

            // No crates will ever get onto a dead piece, but this will make the area around a dead cell less likely to be filled by crates
            staticForwardCrateWeighting = staticForwardCrateWeighting.Add(new Matrix(deadMap, -5f));

            // Player map
            staticPlayerRating = new Matrix(controller.Map.Size);

            // Leave the plaer map at zero for now
        }