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); }
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; }
public void AddVariety(PlantVariety variety, PlantingInfo plantingInfo) => AddVarietyKeys(variety.FamilyID, variety.PlantID, variety.ID, plantingInfo);
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); }