コード例 #1
0
        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));
        }
コード例 #2
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));
        }
コード例 #3
0
        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());
        }