Esempio n. 1
0
 public ControlForm(DrawPanel drawPanel)
 {
     InitializeComponent();
     this.lifePanel             = drawPanel;
     bindingRules               = new BindingSource(drawPanel.Rules, null);
     listRules.DataSource       = bindingRules;
     comboRule.DataSource       = new BindingSource(Enum.GetValues(typeof(CellState)), null);
     comboRuleSet.SelectedIndex = 2;
 }
Esempio n. 2
0
 public virtual void Draw(Graphics g, int generation)
 {
     if (!Death)
     {
         Draw(g, FromGeneration(generation), DrawPanel.Translate(Position), generation);
     }
     else
     {
         Draw(g, Brushes.PapayaWhip, DrawPanel.Translate(Position), generation);
     }
 }
Esempio n. 3
0
        public override void Draw(Graphics g, int generation)
        {
            switch (WireState)
            {
            case WireState.Empty:
                break;

            case WireState.Wire:
                Draw(g, Brushes.Orange, DrawPanel.Translate(Position), generation);
                break;

            case WireState.Head:
                Draw(g, Brushes.DodgerBlue, DrawPanel.Translate(Position), generation);
                break;

            case WireState.Tail:
                Draw(g, Brushes.Firebrick, DrawPanel.Translate(Position), generation);
                break;

            default:
                break;
            }
        }