Beispiel #1
0
        //adapt strategy rules
        public override void AdaptStrategy(List <GridRule> adaptedRules)
        {
            foreach (GridRule rule in adaptedRules)
            {
                gStrategy.Rules.Add(rule);
            }

            zorder = new ZOrder();
            graph  = new Graph();
            graph.Fill(gStrategy, gameSetting, 0.7);
        }
Beispiel #2
0
        public RightPlayerStrategy(GameSetting gameSetting, String file)
            : base(gameSetting)
        {
            gStrategy = new GridStrategy(file, true);
            tactic    = new TacticChooser(true, gameSetting);
            //ruleIndex = new int[4];
            //ruleIndex = new int[4] { 0, 1, 2, 3 };

            zorder = new ZOrder();
            graph  = new Graph();
            graph.Fill(gStrategy, gameSetting, 0);
            //graph.PrintGraph();
        }
Beispiel #3
0
        public LeftPlayerStrategy(GameSetting gameSetting, String file)
            : base(gameSetting)
        {
            gStrategy = new GridStrategy(file, false);
            tactic    = new TacticChooser(false, gameSetting);
            //ruleIndex = new int[4];
            //ruleIndex = new int[4] { 0, 1, 2, 3 };

            zorder = new ZOrder();
            graph  = new Graph();
            graph.Fill(gStrategy, gameSetting, 0.7);
            //graph.Fill_LeftStrg31(gStrategy, gameSetting);
            //graph.PrintGraph();
        }
Beispiel #4
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);
        }
    }
}