public Form1() { InitializeComponent(); InitializePanels(); //Create the environnement thread castle = new Castle(); castle.DataChanged += HandleDataChanged; Thread thread = new Thread(new ThreadStart(castle.Run)); thread.Start(); //Create the agent thread agent = new Agent(castle); Thread thread2 = new Thread(new ThreadStart(agent.Run)); thread2.Start(); castle.SubscribeToAgent(agent); Invalidate(); }
public Sensor(Castle castle) { this.castle = castle; }