예제 #1
0
파일: TetrisAI.cs 프로젝트: jsm150/Tetris
        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);
        }
예제 #2
0
파일: TetrisAI.cs 프로젝트: jsm150/Tetris
        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);
        }
예제 #3
0
 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);
 }
예제 #4
0
파일: TetrisAI.cs 프로젝트: jsm150/Tetris
 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;
 }
예제 #5
0
        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);
        }
예제 #6
0
        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);
        }
예제 #7
0
파일: TetrisAI.cs 프로젝트: jsm150/Tetris
 public static TetrisAI GeneralMode(TetrisPanel tetrisPanel, MetroPanel nextBlockPanel, Label lblScore, int id,
                                    Weight weight)
 {
     return(new TetrisAI(tetrisPanel, nextBlockPanel, lblScore, null, id, weight));
 }