private void button1_Click(object sender, RoutedEventArgs e) { button.Visibility = Visibility.Visible; button1.Visibility = Visibility.Hidden; string code = textBox.Text; organism = new Organism.Organism(); Captain go = new Captain(code, organism); }
private void Paint(Organism.Organism organism) { string label_text; CellConfig work_cells = organism.cell_stats; label_text = "Cells:\r"; label_text += "--------------------------\n"; label_text += PaintCells(work_cells); label_text += "--------------------------\n"; label_text += "Generators:\r"; label.Content = label_text; }
public void exec(CommandEnum command, List<string> attributes, Organism.Organism organism) { switch (command) { case CommandEnum.born: Born born = new Born(organism); born.exec(attributes); break; default: break; } }
public Captain(string new_code, Organism.Organism new_organism) { code = new_code; organism = new_organism; Parser parser = new Parser(); List<string> lines = code.Split(stop_symbol).ToList(); for (var i=0; i<lines.Count; i++) { string line = lines[i]; string after_parse = parser.Parse(line); List<string> attributes = after_parse.Split().ToList(); CommandEnum command = (CommandEnum)Enum.Parse(typeof(CommandEnum), attributes[0]); attributes.RemoveAt(0); exec(command, attributes, organism); } }
public Born(Organism.Organism new_organism) { organism = new_organism; }