Beispiel #1
0
        public override List <string> GetTodoList(DateRange range)
        {
            List <string> result = new List <string>();

            string PlantingName = Name;

            if (range.IsDateInRange(created))
            {
                foreach (KeyValuePair <VarietyKeySeq, PlantingInfo> pair in Varieties)
                {
                    VarietyKeySeq varietyKeySeq = pair.Key;
                    PlantingInfo  plantingInfo  = pair.Value;
                    Plant         plant         = GardenData.LoadedData.GetPlant(varietyKeySeq);
                    string        sown          = plant.MustBeSownOutside ? "sow" : "plant";
                    string        strike        = plantingInfo.AlreadyPlanted ? "#" : ""; //added as prefix to indicate that this entry should be marked as done
                    result.Add($"{strike}{DateRange.ApproxDayMonthDateTimeToString(plantingInfo.PlannedPlantingDate)}: {sown} {GardenData.LoadedData.GetVariety(varietyKeySeq).Name}");
                }
                //if (Varieties.Count > 0)
                //    result.Add(DateRange.ApproxDayMonthDateTimeToString(created)+": plant "+ Varieties.Keys.ToList().ConvertAll((VarietyKeySeq input) => GardenData.LoadedData.GetVariety(input).Name).Aggregate((string elem1, string elem2) => elem1 + ", " + elem2)+ " in "+PlantingName);
            }

            foreach (VarietyKeySeq varietyKeySeq in Varieties.Keys)
            {
                PlantVariety    variety      = GardenData.LoadedData.GetVariety(varietyKeySeq);
                PlantingInfo    plantingInfo = Varieties[varietyKeySeq];
                System.DateTime plantTime    = plantingInfo.PlannedPlantingDate.AddDays(-variety.DaysUntilPlantOutside);
                if (variety.MustBeSownInside && range.IsDateInRange(plantTime))
                {
                    string strike = plantingInfo.AlreadyPlanted ? "#" : ""; //added as prefix to indicate that this entry should be marked as done
                    result.Add(strike + DateRange.ApproxDayMonthDateTimeToString(plantTime) + ": sow " + variety.Name + " inside");
                }
            }

            return(result);
        }
Beispiel #2
0
 public PlantingInfo(PlantingInfo plantingInfo)
 {
     this.PlannedPlantingDate = plantingInfo.PlannedPlantingDate;
     this.AlreadyPlanted      = plantingInfo.AlreadyPlanted;
     this.PlantingDate        = plantingInfo.PlantingDate;
     this.Count            = plantingInfo.Count;
     this.Rows             = plantingInfo.Rows;
     this.RowSpacing       = plantingInfo.RowSpacing;
     this.InBetweenSpacing = plantingInfo.InBetweenSpacing;
     this.SeedsPerGroup    = plantingInfo.SeedsPerGroup;
     this.DirectlySown     = plantingInfo.DirectlySown;
     this.HarvestCount     = plantingInfo.HarvestCount;
     this.HarvestWeight    = plantingInfo.HarvestWeight;
 }
Beispiel #3
0
 public void AddVariety(PlantVariety variety, PlantingInfo plantingInfo) =>
 AddVarietyKeys(variety.FamilyID, variety.PlantID, variety.ID, plantingInfo);
Beispiel #4
0
        public void AddVarietyKeys(string family, string plant, string variety, PlantingInfo plantingInfo)
        {
            VarietyKeySeq varietyKeySeq = new VarietyKeySeq(family, plant, variety);

            Varieties.Add(new VarietyKeySeq(family, plant, variety), plantingInfo);
        }