Beispiel #1
0
 public SettingsForm()//System.Threading.Tasks.Task Task_)
 {
     this.ThreadsManager = new ProgramThreads();
     this.Colors         = new List <Color>();
     //this.ThreadsManager.AddTask(Task_);
     InitializeComponent();
     this.InitSettings();
     this.InitButtons();
     this.SetColors();
     //var ra = string.Concat(System.Environment.CurrentDirectory.Split(System.IO.Path.DirectorySeparatorChar).Where((z, j) => j < System.Environment.CurrentDirectory.Split(System.IO.Path.DirectorySeparatorChar).Select((x, i) => x == "SnakeGame" ? i : 0).Sum()).Select(x => x + System.IO.Path.DirectorySeparatorChar)) + @"PrevPicture.bmp";
     //this.openFileDialog1.InitialDirectory = string.Concat(System.Environment.CurrentDirectory.Split(System.IO.Path.DirectorySeparatorChar).Where((z, j) => j < System.Environment.CurrentDirectory.Split(System.IO.Path.DirectorySeparatorChar).Select((x, i) => x == "SnakeGame" ? i : 0).Sum()).Select(x => x + System.IO.Path.DirectorySeparatorChar))+ @"PrevPicture.bmp";
     this.openFileDialog1.InitialDirectory = System.Environment.CurrentDirectory + @"PrevPicture.bmp";
     this.openFileDialog1.FileName         = this.openFileDialog1.InitialDirectory;
     openFileDialog1_FileOk(this.Game, new CancelEventArgs());
 }
Beispiel #2
0
 public GamingForm(ref ProgramThreads ThreadStack, List <System.Drawing.Color> Colors, List <bool> Settings, int Multipiller, System.Drawing.Font GameFont, int Interval, string Path)//int Interval, string MapPath, bool Mode, Color[] Colors)
 {
     this.ThreadsManager = ThreadStack;
     InitializeComponent();
     Rnd_Gen             = new Random();
     this.KeyDownControl = new Control();
     this.KeyDownControl.PreviewKeyDown += PreviewKeyDownEventHandler;
     this.pictureBox1.Controls.Add(this.KeyDownControl);
     this.GlobalTimer          = new Timer();
     this.GlobalTimer.Tick    += GlobalTimerElapse;
     this.GlobalTimer.Interval = Interval;
     this.pictureBox1.Focus();
     this.GlobalTimer.Stop();
     this.GameField         = new SnakeMainProcessor(this.pictureBox1.Height, this.pictureBox1.Width, Multipiller, Colors.ToArray(), Settings, GameFont, Path);
     this.pictureBox1.Image = this.GameField.MessageStartContext(this.pictureBox1.Height, this.pictureBox1.Width);
     this.GlobalTimer.Start();
 }