public static void Init(PictureBox _pb) { IDrawer stdDrawer = new DrawerStandart(_pb); IDrawer testDrawer = new DrawerDebug(_pb); IDrawer interstingDrawer = new DrawerInteresting(_pb); m_pBox = _pb; m_factory2 = new ParticleFactoryStandart(_pb.Width, _pb.Height, stdDrawer); m_tstFactory = new ParticleFactoryInteresting(_pb.Width, _pb.Height, interstingDrawer); var borderOfArea = new BorderBounce(new List <PairDouble> { new PairDouble(0, 0), new PairDouble(0, _pb.Height), new PairDouble(_pb.Width, _pb.Height), new PairDouble(_pb.Width, 0) }); m_box = new ParticleBox(m_factory2, Miscelaneous.ParticleCount, stdDrawer, borderOfArea); Run(m_box); }
public static void Init(PictureBox _pb) { IDrawer stdDrawer = new DrawerStandart(_pb); IDrawer testDrawer = new DrawerDebug(_pb); IDrawer interstingDrawer = new DrawerInteresting(_pb); m_pBox = _pb; m_factory2 = new ParticleFactoryStandart(_pb.Width, _pb.Height, stdDrawer); m_tstFactory = new ParticleFactoryInteresting(_pb.Width, _pb.Height, interstingDrawer); var borderOfArea = new BorderBounce(new List<PairDouble> { new PairDouble(0, 0), new PairDouble(0, _pb.Height), new PairDouble(_pb.Width, _pb.Height), new PairDouble(_pb.Width, 0) }); m_box = new ParticleBox(m_factory2, Miscelaneous.ParticleCount, stdDrawer, borderOfArea); Run(m_box); }
private static async void Run(IParticleBox _box) { _box.Draw(); while (true) { await Task.Run(() => Live(_box)); } }
private static async void Run(IParticleBox _box) { _box.Draw(); while(true) { await Task.Run(() => Live(_box)); } }
public static void Live(IParticleBox _box) { lock (_box) { _box.NextStep(); _box.Draw(); _box.Particles.Last().Draw(m_pBox); } }
public static void Live(IParticleBox _box) { lock (_box) { _box.NextStep(); _box.Draw(); _box.Particles.Last().Draw(m_pBox); } }
public virtual void Draw(IParticleBox _box) { var bmp = new Bitmap(SizeX, SizeY, Graph); tempGraph = Graphics.FromImage(bmp); tempGraph.Clear(Color.White); foreach (var particle in _box.Particles) { particle.Draw(); } Graph.DrawImage(bmp, 0, 0); }
public virtual void Draw(IParticleBox _box) { var bmp = new Bitmap(SizeX, SizeY, Graph); tempGraph = Graphics.FromImage(bmp); tempGraph.Clear(Color.White); foreach (var particle in _box.Particles) { particle.Draw(); } Graph.DrawImage(bmp, 0, 0); }