Пример #1
0
        public SnakeForm()
        {
            InitializeComponent();
            drawingEngine     = DrawingEngine.GetInstance(pictureBoxSnake, pictureBoxSnake.Size);
            applicaitonEngine = ApplicationEngine.GetInstance();
            timerForLogic     = new Timer
            {
                Interval = 100,
                Enabled  = true
            };
            timerForLogic.Tick += TimerForLogic_Tick;

            timerForDrawing = new Timer
            {
                Interval = 100,
                Enabled  = true
            };
            timerForDrawing.Tick += TimerForDrawing_Tick;
        }
Пример #2
0
 public static DrawingEngine GetInstance(PictureBox pictureBox, Size size)
 {
     return(_drawingEngineInstance = (_drawingEngineInstance ?? new DrawingEngine(pictureBox, size)));
 }