public static TetrisAI GeneticMode(TetrisPanel tetrisPanel, Label lblScore, Label lblBestNum, int id, Weight weight) { TetrisAI t = new TetrisAI(tetrisPanel, null, lblScore, lblBestNum, id, weight); t.SetGeneticMode(); return(t); }
public static TetrisAI AITestMode(TetrisPanel tetrisPanel, MetroPanel nextBlockPanel, Label lblScore, int id, Weight weight) { TetrisAI t = new TetrisAI(tetrisPanel, nextBlockPanel, lblScore, null, id, weight); t.SetAiTestMode(); return(t); }
public Tetris(TetrisPanel tetrisPanel, MetroPanel nextBlockPanel, Label lblScore, Keyboard key, int id) { PlayerId = id; _nextBlockPanel = nextBlockPanel; _tetrisPanel = tetrisPanel; _lblScore = lblScore; _keyboard = key; _tetrisPanel.SetValue(_tetrisBoard, _block); }
private TetrisAI(TetrisPanel tetrisPanel, MetroPanel nextBlockPanel, Label lblScore, Label lblBestNum, int id, Weight weight) : base(tetrisPanel, nextBlockPanel, lblScore, null, id) { Weight = weight; lbl_BestNum = lblBestNum; DoBlockMoveAsyncFunc = DoBlockMoveAsyncNormal; SetScoreTextAction = base.SetScoreText; DrawColorAction = base.DrawColer; ReSetBlockAction = base.ReSetBlock; LoopDownAsyncFunc = base.LoopDownAsync; ReDrawBlockAction = base.ReDrawBlock; }
private TetrisPanel NewPanel(PanelValue panelValue) { TetrisPanel p = new TetrisPanel(30) { Location = new Point(panelValue.PointX, panelValue.PointY), Size = new Size(panelValue.Width, panelValue.Height), BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D, BackColor = Color.Black }; Controls.Add(p); _panels.Push(p); return(p); }
private static void SetPanels(Control form) { for (int i = 0; i < _weights.Length; i++) { _panels[i] = new TetrisPanel(10) { Location = new Point((1 + i % 6 * 11) * 10, (16 + i / 6 * 21) * 10), Size = new Size(105, 205), BorderStyle = BorderStyle.Fixed3D, BackColor = Color.Black } } ; form.Controls.AddRange(_panels); }
public static TetrisAI GeneralMode(TetrisPanel tetrisPanel, MetroPanel nextBlockPanel, Label lblScore, int id, Weight weight) { return(new TetrisAI(tetrisPanel, nextBlockPanel, lblScore, null, id, weight)); }