Beispiel #1
0
        public MainWindow()
        {
            InitializeComponent();

            string FName = "qbase.dat";

            BinaryFormatter formatter = new BinaryFormatter();

            if (File.Exists(FName))
            {
                using (FileStream fs = new FileStream(FName, FileMode.OpenOrCreate))
                {
                    QLearning = (TQLearning)formatter.Deserialize(fs);
                }
            }
            else
            {
                QLearning = new TQLearning(textBox);

                using (FileStream fs = new FileStream(FName, FileMode.OpenOrCreate))
                {
                    formatter.Serialize(fs, QLearning);
                }
            }

            Base = new TBase();

            Pole = new TPole(gPole, textBox, textBox1, Base, QLearning);
        }
Beispiel #2
0
        public MainWindow()
        {
            InitializeComponent();

            Base = new TBase();

            Pole = new TPole(gPole, Base);
        }
Beispiel #3
0
        public TPole(Canvas g, TextBox tb, TextBox tbCount, TBase Base, TQLearning QL)
        {
            this.Base = Base;
            this.QL   = QL;

            this.g       = g;
            this.tb      = tb;
            this.tbCount = tbCount;

            H       = g.Height;
            g.Width = H;

            Init();
        }
Beispiel #4
0
        public TPole(Canvas g, TBase Base)
        {
            this.Base = Base;

            this.g  = g;
            H       = g.Height;
            g.Width = H;

            g.Children.Clear();

            DrawPole();

            Pos = new TPosition();
            V   = 'X';
        }