Example #1
0
        public void InitVm(Parameters parameters)
        {
            RuleDatas.Clear();
            RuleInscriptions.Clear();
            RulePointerLine.Clear();
            RulePointer.Clear();
            RuleFillPointer.Clear();
            PanelBorderLine.Clear();
            LevelsInscriptions.Clear();

            _parameters = parameters;
            SetLength();
            SetPointsValue();
        }
Example #2
0
 public List <RuleData> GetDopRulePointerLine()
 {
     if (_parameters.v <= _mineConfig.MainViewConfig.MaxDopRuleSpeed.Value)
     {
         RulePointerLine.Add(new RuleData
         {
             Pen         = red_pen,
             FirstPoint  = new Point(x1_long, panelHeight / 2),
             SecondPoint = new Point(panelWidth - 15, panelHeight / 2)
         });
         RulePointer.Add(new Pointer
         {
             Pen      = red_pen,
             Triangle = new Point[3]
             {
                 new Point(panelWidth - 40, panelHeight / 2),
                 new Point(panelWidth - 15, panelHeight / 2 - 10),
                 new Point(panelWidth - 15, panelHeight / 2 + 10)
             }
         });
         RuleFillPointer.Add(new FillPointer
         {
             Brush    = red,
             Triangle = new Point[3]
             {
                 new Point(panelWidth - 40, panelHeight / 2),
                 new Point(panelWidth - 15, panelHeight / 2 - 10),
                 new Point(panelWidth - 15, panelHeight / 2 + 10)
             }
         });
         LevelsInscriptions.Add(new RuleInscription
         {
             Text     = "1",
             Font     = levelsFont,
             Brush    = white,
             Position = new Point(panelWidth - 25, panelHeight / 2 - 8)
         });
         if (_mineConfig.KletConfig.KletLevelsCount.Value > 1 && _mineConfig.MainViewConfig.LeftSosud == SosudType.Skip)
         {
             RulePointerLine.Add(new RuleData
             {
                 Pen         = red_pen,
                 FirstPoint  = new Point(x1_long, Convert.ToInt32(panelHeight / 2 - pixel_pro_ten_santimeter * _mineConfig.KletConfig.FirstLevelHight.Value)),
                 SecondPoint = new Point(panelWidth - 15, Convert.ToInt32(panelHeight / 2 - pixel_pro_ten_santimeter * _mineConfig.KletConfig.FirstLevelHight.Value))
             });
             RulePointer.Add(new Pointer
             {
                 Pen      = red_pen,
                 Triangle = new Point[3]
                 {
                     new Point(panelWidth - 40, Convert.ToInt32(panelHeight / 2 - pixel_pro_ten_santimeter * _mineConfig.KletConfig.FirstLevelHight.Value)),
                     new Point(panelWidth - 15, Convert.ToInt32(panelHeight / 2 - pixel_pro_ten_santimeter * _mineConfig.KletConfig.FirstLevelHight.Value) - 10),
                     new Point(panelWidth - 15, Convert.ToInt32(panelHeight / 2 - pixel_pro_ten_santimeter * _mineConfig.KletConfig.FirstLevelHight.Value) + 10)
                 }
             });
             RuleFillPointer.Add(new FillPointer
             {
                 Brush    = red,
                 Triangle = new Point[3]
                 {
                     new Point(panelWidth - 40, Convert.ToInt32(panelHeight / 2 - pixel_pro_ten_santimeter * _mineConfig.KletConfig.FirstLevelHight.Value)),
                     new Point(panelWidth - 15, Convert.ToInt32(panelHeight / 2 - pixel_pro_ten_santimeter * _mineConfig.KletConfig.FirstLevelHight.Value) - 10),
                     new Point(panelWidth - 15, Convert.ToInt32(panelHeight / 2 - pixel_pro_ten_santimeter * _mineConfig.KletConfig.FirstLevelHight.Value) + 10)
                 }
             });
             LevelsInscriptions.Add(new RuleInscription
             {
                 Text     = "2",
                 Font     = levelsFont,
                 Brush    = white,
                 Position = new Point(panelWidth - 25, Convert.ToInt32(panelHeight / 2 - pixel_pro_ten_santimeter * _mineConfig.KletConfig.FirstLevelHight.Value) - 8)
             });
         }
         if (_mineConfig.KletConfig.KletLevelsCount.Value > 2 && _mineConfig.MainViewConfig.LeftSosud == SosudType.Skip)
         {
             RulePointerLine.Add(new RuleData
             {
                 Pen         = red_pen,
                 FirstPoint  = new Point(x1_long, Convert.ToInt32(panelHeight / 2 - pixel_pro_ten_santimeter * (_mineConfig.KletConfig.FirstLevelHight.Value + _mineConfig.KletConfig.SecondLevelHight.Value))),
                 SecondPoint = new Point(panelWidth - 15, Convert.ToInt32(panelHeight / 2 - pixel_pro_ten_santimeter * (_mineConfig.KletConfig.FirstLevelHight.Value + _mineConfig.KletConfig.SecondLevelHight.Value)))
             });
             RulePointer.Add(new Pointer
             {
                 Pen      = red_pen,
                 Triangle = new Point[3]
                 {
                     new Point(panelWidth - 40, Convert.ToInt32(panelHeight / 2 - pixel_pro_ten_santimeter * (_mineConfig.KletConfig.FirstLevelHight.Value + _mineConfig.KletConfig.SecondLevelHight.Value))),
                     new Point(panelWidth - 15, Convert.ToInt32(panelHeight / 2 - pixel_pro_ten_santimeter * (_mineConfig.KletConfig.FirstLevelHight.Value + _mineConfig.KletConfig.SecondLevelHight.Value)) - 10),
                     new Point(panelWidth - 15, Convert.ToInt32(panelHeight / 2 - pixel_pro_ten_santimeter * (_mineConfig.KletConfig.FirstLevelHight.Value + _mineConfig.KletConfig.SecondLevelHight.Value)) + 10)
                 }
             });
             RuleFillPointer.Add(new FillPointer
             {
                 Brush    = red,
                 Triangle = new Point[3]
                 {
                     new Point(panelWidth - 40, Convert.ToInt32(panelHeight / 2 - pixel_pro_ten_santimeter * (_mineConfig.KletConfig.FirstLevelHight.Value + _mineConfig.KletConfig.SecondLevelHight.Value))),
                     new Point(panelWidth - 15, Convert.ToInt32(panelHeight / 2 - pixel_pro_ten_santimeter * (_mineConfig.KletConfig.FirstLevelHight.Value + _mineConfig.KletConfig.SecondLevelHight.Value)) - 10),
                     new Point(panelWidth - 15, Convert.ToInt32(panelHeight / 2 - pixel_pro_ten_santimeter * (_mineConfig.KletConfig.FirstLevelHight.Value + _mineConfig.KletConfig.SecondLevelHight.Value)) + 10)
                 }
             });
             LevelsInscriptions.Add(new RuleInscription
             {
                 Text     = "3",
                 Font     = levelsFont,
                 Brush    = white,
                 Position = new Point(panelWidth - 25, Convert.ToInt32(panelHeight / 2 - pixel_pro_ten_santimeter * (_mineConfig.KletConfig.FirstLevelHight.Value + _mineConfig.KletConfig.SecondLevelHight.Value)) - 8)
             });
         }
     }
     return(RulePointerLine);
 }