Exemple #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);
        }
Exemple #2
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();
        }