Britbot
static void Britbot.Navigator.Node.UpdateMap ( Group  group) [inline, static]

This function should be called ONCE PER GROUP in the CalculatePriorities function it updates the map data based on the current game state it sets what areas are passable and what are dangerous.

Parameters:
groupthe group we update the map for

Definition at line 97 of file Node.cs.

            {
                //reading board size
                int cols = Bot.Game.GetCols();
                int rows = Bot.Game.GetRows();

                //get the radius of the group

                //go over the entire map, set locations and their wight
                for (int x = 0; x < cols; x++)
                {
                    for (int y = 0; y < rows; y++)
                    {
                        //check if this is passable
                        //if (!Bot.Game.IsPassableEnough(Node.Map[y, x].Loc, groupRadius))
                        if (!Bot.Game.IsPassableEnough(Node.Map[y, x].Loc, group))
                        {
                            //set the weight of the node to "infinity"
                            Node.Map[y, x].Weight = Node.Infinity;

                            //if so then we are finished here, move to next Node
                            continue;
                        }

                        // Node.Map[y, x].Weight = Node.CalcEnemyFactor(Node.Map[y, x].Loc, groupStrength);
                        Node.Map[y, x].Weight = 1;
                        //now set the wight based on enemyGroups
                        //double enemyFactor = Node.CalcEnemyFactor(Node.Map[y, x].Loc, groupStrength);
                    }
                }
                //update enemy threat

                Node.CalculateEnemyWeight(group.FightCount());

                //TODO: update also friendly location
            }