Esempio n. 1
0
        public PlayerStrategy(GameSetting gameSetting, String file, bool mirror)
            : base(gameSetting)
        {
            gStrategy = new GridStrategy(file, mirror);
            tactic    = new TacticChooser(mirror, gameSetting);

            zorder = new ZOrder();
            graph  = new Graph();
            graph.Fill(gStrategy, gameSetting, 0.7);
        }
Esempio n. 2
0
        //adapt strategy rules
        public override void AdaptStrategy(List <object> adaptedRules)
        {
            foreach (GridRule rule in adaptedRules)
            {
                gStrategy.Rules.Add(rule);
            }

            zorder = new ZOrder();
            graph  = new Graph();
            graph.Fill(gStrategy, gameSetting, 0.7);
        }
Esempio n. 3
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);
        }
    }
}