private static GenericStem CreateStem(IServiceProvider service) { var creator = service.GetService <IPlantPartCellCreator>(); var internodeCells = creator.CreateCells(21, 17, new Vector3(0), 0f); Internode internode = new GenericInternode(internodeCells, 0); return(new GenericStem(internode, 0)); }
public static IPlant CreatePlant() { var internode = new GenericInternode(CreateStemCells(), 0); var stem = new GenericStem(internode, 0); IShootSystem shoot = new GenericShootSystem(stem); IRootSystem root = new GenericRootSystem(new GenericRoot(new List <IPlantCell>(0), new List <Root>(0), 0)); return(new GenericPlant(shoot, root)); }
public void SetUp() { var cellFactory = new GenericCellFactory(); var cellCreator = new HexagonCellCreator(cellFactory); var cellTypeLocator = CornCellTypeLocator.GetCornCellTypeLocator(); var optionsService = PlantSimulatorOptionsHelper.CreateOptionsService(); var cellGridCreator = new HexagonalCellGridFactory(cellCreator, cellTypeLocator, optionsService); creator = new PlantPartCellCreator(cellGridCreator); var internodeCells = creator.CreateCells(21, 17, new Vector3(0), 0f); Internode internode = new GenericInternode(internodeCells, 0); plant = internode.Cells; collisionDetection = new CellCollisionDetection(new GeometryHelper()); }