Exemplo n.º 1
0
        public PlayerStrategy(GameSetting gameSetting, String file, bool mirror)
            : base(gameSetting)
        {
            gStrategy = new GridStrategy(file, mirror);
            tactic    = new TacticChooser(mirror, gameSetting);
            //ruleIndex = new int[4];
            //ruleIndex = new int[4] { 0, 1, 2, 3 };

            RobotsMirror = mirror;

            zorder = new ZOrder();
            graph  = new Graph();
            graph.Fill(gStrategy, gameSetting, 0);
            //graph.PrintGraph();
        }
Exemplo n.º 2
0
        //naplneni ZOrder
        public void fillZOrder()
        {
            ZOrder zord = new ZOrder();
            int    x, y;

            List <int>[,] matrix;

            matrix = new List <int> [6, 4];
            for (int i = 0; i < mine.Length; i++)
            {
                x = Convert.ToInt32(mine[i].X) - 1;
                y = Convert.ToInt32(mine[i].Y) - 1;
                if (matrix[x, y] != null)
                {
                    matrix[x, y].Add(i);
                }
                else
                {
                    matrix[x, y] = new List <int>()
                    {
                        i
                    }
                };
            }
            zMine = zord.zOrderMain(matrix, 2);

            matrix = new List <int> [6, 4];
            for (int i = 0; i < oppnt.Length; i++)
            {
                x = Convert.ToInt32(oppnt[i].X) - 1;
                y = Convert.ToInt32(oppnt[i].Y) - 1;
                if (matrix[x, y] != null)
                {
                    matrix[x, y].Add(i);
                }
                else
                {
                    matrix[x, y] = new List <int>()
                    {
                        i
                    }
                };
            }
            zOppnt = zord.zOrderMain(matrix, 2);
        }
    }
}