public DeveloperView(Developer philosopher, string imagePath) { // This call is required by the Windows.Forms Form Designer. InitializeComponent(); m_Developer = philosopher; m_Developer.StateChanged += new EventHandler(DeveloperStateChanged); updnCodingDelay.Minimum = 0; updnCodingDelay.Maximum = 10000; updnCodingDelay.Increment = 100; updnThinkingDelay.Minimum = 0; updnThinkingDelay.Maximum = 10000; updnThinkingDelay.Increment = 100; updnCodingDelay.Value = m_Developer.CodingDelay; updnThinkingDelay.Value = m_Developer.ThinkingDelay; checkRandomDelays.Checked = m_Developer.UseRandomDelay; pictureBox.Image = Image.FromFile(imagePath); }
public override Developer NewDeveloper(string name, Developer left, Developer right, DeveloperController controller) { return new MonitorBasedDeveloper(name, left, right, controller); }
/// <summary> /// Constructs a new developer. /// </summary> /// <param name="name">The name of the developer.</param> /// <param name="left">The developer to the immediate left.</param> /// <param name="right">The developer to the immediate right.</param> /// <param name="controller">The controller.</param> /// <returns>The newly constructed developer.</returns> public abstract Developer NewDeveloper(string name, Developer left, Developer right, DeveloperController controller);
public MonitorBasedDeveloper(string name, Developer left, Developer right, DeveloperController controller) : base(name, left, right, controller) { }
/// <summary> /// Construct a new developer. /// </summary> protected Developer(string name, Developer left, Developer right, DeveloperController controller) { m_Left = left; m_Right = right; m_controller = controller; m_Name = name; m_CodingDelay = 1000; m_ThinkingDelay = 1000; m_CodingCount = 0; m_UseRandomDelay = true; m_controller.Start += new EventHandler(Controller_Start); SetState(DeveloperState.Thinking); }