private void button2_Click(object sender, EventArgs e) { //if (this.task == 1) //{ // //Add to main Device // SetSpriteShape(); if (p_mainForm.sequence.partMan.FindLayer(this.particle.لایه).IsUnique(particle.نام)) { this.particle.type = EntityTypes.Particle; p_mainForm.sequence.partMan.AddParticleSystem((Particle)particle.Clone(), true); } else { MessageBox.Show("Particle :" + "نام انتخاب شده تکراری است"); } //} //else if (this.task == 2) //{ // p_mainForm.sequence.partMan.p_activLayer.Find(this.clientSpriteID).script = this.sprite.script; //} this.Visible = false; this.Pouse(); }
protected static void CloneIfGbest(Particle<ICell[]> particle,ref Particle<ICell[]> gbest) { if (particle.Fitness < gbest.Fitness) gbest = (Particle<ICell[]>)particle.Clone(); }