public void SetGivenAmountOfDroplets(int dropletAmounts, Module module) { Droplets.Clear(); for (int i = 0; i < dropletAmounts; i++) { Droplet droplet = new Droplet(); droplet.Shape = new Rectangle(Droplet.DROPLET_WIDTH, Droplet.DROPLET_HEIGHT, 0, 0); Droplets.Add(new Droplet()); } module.RepositionLayout(); }
/* * public MixerModule(int width, int height, int operationTime) : base(width, height, operationTime, 2, 2){ * Layout = GetBasicMixerLayout(width, height); * } */ public static ModuleLayout GetDefaultLayout(Rectangle Shape) { List <Rectangle> EmptyRectangles = new List <Rectangle>(); List <Droplet> OutputLocations = new List <Droplet>(); Droplet output1 = new Droplet(); output1.Shape = new Rectangle(Droplet.DROPLET_WIDTH, Droplet.DROPLET_HEIGHT, Droplet.DROPLET_WIDTH, 0); Rectangle emptyRectangle = new Rectangle(Droplet.DROPLET_WIDTH, Droplet.DROPLET_HEIGHT, 0, 0); OutputLocations.Add(output1); EmptyRectangles.Add(emptyRectangle); return(new ModuleLayout(Shape, EmptyRectangles, OutputLocations)); }
public static ModuleLayout GetDefaultSingleOutputOrInputLayout(Rectangle rectangle) { Droplet droplet = new Droplet(); var newRectangles = Rectangle.SplitIntoSmallerRectangles(rectangle, droplet.Shape); droplet.Shape = newRectangles.newSmaller; List <Rectangle> emptyRectangles = new List <Rectangle>(); if (newRectangles.top != null) { emptyRectangles.Add(newRectangles.top); } if (newRectangles.right != null) { emptyRectangles.Add(newRectangles.right); } return(new ModuleLayout(rectangle, emptyRectangles, new List <Droplet>() { droplet })); }