public int GenerateCometColumns() { MConfig conf = MConfig.GetInstance(); float fsize = conf.FSize; int colWidth = (int)Math.Ceiling(fsize) + conf.ColumnGap; for (int i = 0; i < width / colWidth; i++) { string str = MColumnBase.PRETEXT[random.Next(MColumnBase.PRETEXT.Length)]; int startingX = i * colWidth + random.Next(colWidth) / 2 - colWidth / 4; int verticalGap = random.Next(10); int rndinterval = random.Next(8) + 1; int rndlen = random.Next(12) + 5; MColumn mc = new MColumnComet(new Point(startingX, 0), fsize, height, canv, str, rndlen); for (int j = 1; j < MAX_CYCLE; j++) { if (0 == j % rndinterval) { ArrCycleList[j].Add(mc); } } } return(0); }
public static MConfig GetInstance() { if (null == _instance) { _instance = new MConfig(); } return(_instance); }
public bool GenerateColumns() { MConfig mcf = MConfig.GetInstance(); switch (mcf.Style) { case MWStyle.Comet: this.GenerateCometColumns(); break; case MWStyle.Straight: this.GenerateStraightColumns(); break; default: break; } return(true); }
private void buttonCancel_Click(object sender, RoutedEventArgs e) { MConfig.GetInstance().LoadConfig(); DialogResult = false; }
private void buttonOK_Click(object sender, RoutedEventArgs e) { MConfig.GetInstance().SaveConfig(); MScreen.ReGen(); DialogResult = true; }
public OptionForm() { InitializeComponent(); ((Grid)FindName("MainGrid")).DataContext = MConfig.GetInstance(); }