Beispiel #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="index"></param>
 public void RemoveSomeTillageObjects(int index)
 {
     for (int i = ChildControllers.Count - 1; i >= index; --i)
     {
         ChildControllers.RemoveAt(i);
     }
 }
Beispiel #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sim"></param>
 public TillageController(Simulation sim, List <InputModel> inputModels) : this(sim)
 {
     foreach (InputModel im in inputModels)
     {
         ChildControllers.Add(new TillageObjectController(sim, (TillageInputModel)im));
     }
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="newcount"></param>
 public void RemoveSomeCropObjects(int newcount)
 {
     for (int i = ChildControllers.Count - 1; i >= newcount; --i)
     {
         ChildControllers.RemoveAt(i);
     }
 }
Beispiel #4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sim"></param>
 public PesticideController(Simulation sim, List <InputModel> inputModels) : base(sim)
 {
     foreach (InputModel im in inputModels)
     {
         ChildControllers.Add(new PesticideObjectController(sim, (PesticideInputModel)im));
     }
 }
Beispiel #5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="value"></param>
 public void AddSomeTillageObjects(int value)
 {
     for (int i = ChildControllers.Count; i < value; ++i)
     {
         TillageObjectController till = new TillageObjectController(Sim, null);
         ChildControllers.Add(till);
     }
 }
Beispiel #6
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="newcount"></param>
        public void RemoveSomePesticideObjects(int newcount)
        {
            int startcount = ChildControllers.Count;

            for (int i = ChildControllers.Count - 1; i >= newcount; --i)
            {
                ChildControllers.RemoveAt(i);
            }
        }
Beispiel #7
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="newcount"></param>
        public void AddSomePesticideObjects(int newcount)
        {
            int startcount = ChildControllers.Count;

            for (int i = startcount; i < newcount; ++i)
            {
                PesticideObjectController pest = new PesticideObjectController(Sim, null);
                ChildControllers.Add(pest);
            }
        }
        public GnosisTileController GetFirstTile()
        {
            GnosisContainerController firstChild = ChildControllers.OrderBy(x => x.ControlImplementation.Order).Where(x => !(x is GnosisNavTileController)).First();

            while (firstChild is GnosisSplitController)
            {
                firstChild = ((GnosisSplitController)firstChild).ChildControllers.OrderBy(x => x.ControlImplementation.Order).First();
            }

            return((GnosisTileController)firstChild);
        }
 /// <summary>
 ///
 /// </summary>
 /// <param name="sim"></param>
 /// <param name="inputModels"></param>
 public VegetationController(Simulation sim, List <InputModel> inputModels) : this(sim)
 {
     foreach (InputModel im in inputModels)
     {
         if (im.GetType() == typeof(LAIVegInputModel))
         {
             ChildControllers.Add(new LAIVegObjectController(sim, (LAIVegInputModel)im));
         }
         else
         {
             ChildControllers.Add(new CoverVegObjectController(sim, (CoverVegInputModel)im));
         }
     }
 }
        protected override void CreateControllers()
        {
            if (((GnosisPrimarySplit)ControlImplementation).GnosisNavTile != null)
            {
                GnosisNavigatorTile navTile = ((GnosisPrimarySplit)ControlImplementation).GnosisNavTile;
                // IGnosisNavTileImplementation navImplementation = GlobalData.Singleton.ImplementationCreator.GetGnosisNavTileImplementation();
                GnosisNavTileController navController = new GnosisNavTileController(navTile, EntityController, this);

                navController.PropertyChanged += ChildContainer_PropertyChanged;

                ChildControllers.Add(navController);
                NavTileController = navController;
            }

            base.CreateControllers();
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="newcount"></param>
        public void AddSomeCropObjects(int newcount)
        {
            VegObjectController firstcrop = GetCrop(0);

            for (int i = ChildControllers.Count; i < newcount; ++i)
            {
                if (UseLAIModel())
                {
                    ChildControllers.Add(new LAIVegObjectController(Sim));
                }
                else
                {
                    ChildControllers.Add(new CoverVegObjectController(Sim));
                }
            }
        }
Beispiel #12
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="pest"></param>
 /// <returns></returns>
 public int GetPesticideIndex(PesticideObjectController pest)
 {
     return(ChildControllers.IndexOf(pest));
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="veg"></param>
 /// <returns></returns>
 public int GetCropIndex(VegObjectController veg)
 {
     return(ChildControllers.IndexOf(veg));
 }