public MainPanelController(GrowthSimulation v, Habitat env) { view = v; environment = env; environment.AddNewBindingListener(new BindingListener(view)); view.AddCloseListener(new CloseListener(env)); view.StatusMessage("Started"); }
static void Main(string[] args) { Crystals.Habitat environment = new Crystals.Habitat(150, 10, 0.01, 150, 150, 1, Molecule.RADIUS); environment.ThreadStart(); //3.14*80*80*0.01 }
public void SetUp() { habitat = new Habitat(1, 1, 1, 150, 150, 1, 2*Molecule.RADIUS); mZero = new Molecule(habitat); mZero.Position.X = 0; mZero.Position.Y = 0; mZero.AttachedIteration = 0; mZero.BoundType = BoundType.I; }
static void Main() { double radius = 200, temperature = 10, density = 0.01; float scale = (float)0.5; double Desire = 1; double DesireRadius = Molecule.RADIUS * 10; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); growthSimulation = new GrowthSimulation((int)radius, scale); env = new Habitat(radius, temperature, density, growthSimulation.Center.X, growthSimulation.Center.Y, Desire, DesireRadius); densityBarController = new DensityBarController(growthSimulation, env); densityBarController.BindListeners(); speedBarController = new SpeedBarController(growthSimulation, env); speedBarController.BindListeners(); mainPanelController = new MainPanelController(growthSimulation, env); env.ThreadStart(); Application.Run(growthSimulation); }
public Molecule(Habitat habitat, InitMoleculeType type) { Init(habitat, type); }
public Molecule(Habitat habitat) { Init(habitat, InitMoleculeType.Initial); }
public void Init(Habitat habitat, InitMoleculeType type) { this.habitat = habitat; if (type == InitMoleculeType.Center) { Position = new Position(0, 0, new V(0, 0), this); AttachedIteration = 0; } else { Position = Position.NextRandomPosition( habitat.CondensationCenter.Position.X, habitat.CondensationCenter.Position.Y, habitat.Radius, this.DefaultSpeed, this, type == InitMoleculeType.Additional); } }
public CloseListener(Habitat env) { habitat = env; }
public ParametersChangedListener(Habitat env) { habitat = env; }
public DensityListener(Habitat env) { environment = env; }
public DensityBarController(GrowthSimulation v, Habitat env) { view = v; environment = env; }
public HabitatPresenter(Habitat habitat) { Habitat = habitat; }
public MoleculeAddListener(Habitat habitat) { this.habitat = habitat; }
public SpeedListener(Habitat env) { environment = env; }