コード例 #1
0
        //Reset
        private void btn_reset_Click(object sender, EventArgs e)
        {
            Attributes.AmountOfCellsPerLine = 16;
            gridstyle       = UI.FieldOfLifeUI.GridStyles.Continuous;
            cellstyle       = UI.FieldOfLifeUI.CellStyles.Square;
            distance        = 1;
            backgroundcolor = Color.FromArgb(40, 40, 40);
            gridcolor       = Color.FromArgb(75, 75, 75);
            livingcolor     = Color.LightBlue;
            hovercolor      = Color.FromArgb(127, 255, 165, 0);
            torusactive     = false;
            refreshrate     = 100;
            ruletosurvive   = "23";
            ruletoborn      = "3";

            tb_fieldsize.Value        = Attributes.AmountOfCellsPerLine;
            cb_gridstyle.Text         = gridstyle.ToString();
            cb_cellstyle.Text         = cellstyle.ToString();
            nud_distance.Value        = Math.Min(distance, nud_distance.Maximum);
            btn_backcolor.BackColor   = backgroundcolor;
            btn_gridcolor.BackColor   = gridcolor;
            btn_livingcolor.BackColor = livingcolor;
            btn_hovercolor.BackColor  = hovercolor;
            nud_refreshrate.Value     = refreshrate;
            cb_torus.Checked          = torusactive;
            cb_rules.SelectedIndex    = 0;

            this.Invalidate();
        }
コード例 #2
0
 private void cb_cellstyle_SelectedIndexChanged(object sender, EventArgs e)
 {
     cellstyle = (UI.FieldOfLifeUI.CellStyles)System.Enum.Parse(typeof(UI.FieldOfLifeUI.CellStyles), cb_cellstyle.Text);
 }