using System; using System.Collections.Generic; using System.Text; using Sunweaver.Commands.Abstracts; namespace Sunweaver.DataPrototypes { public class Codule { public List BasePairs; public Codule(List dna) { BasePairs = dna; } public Codule() { BasePairs = new List(); } public void Execute(VirtualMachine VM) { foreach(BasePair bp in BasePairs) { //Move these to the bp.Implementation if (bp.ToString() == "stop") VM.Executing = false; else if (bp.ToString() == "start") VM.Executing = true; if(VM.Executing) bp.Implementation(VM); } } public override bool Equals(object obj) { if (!obj.GetType().Equals(this.GetType())) { return false; } Codule c = (Codule)obj; if (this.BasePairs.Count != c.BasePairs.Count) { return false; } for (int i = 0; i < this.BasePairs.Count; i++) { if(!this.BasePairs[i].ToString().Equals(c.BasePairs[i].ToString())){ return false; } } return true; } public override int GetHashCode() { return base.GetHashCode(); } } }