I wanted to know if I can do what the title suggests. Here is some code.
struct Crop {
var name = String()
var season = String()
var reharvistable = Bool()
//struct Stages:
struct Stage1{
var minDay = Int()
var maxDay = Int()
var minWater = Int()
var maxWater = Int()
}/*
struct Stage2{
var minDay = Int()
var maxDay = Int()
var minWater = Int()
var maxWater = Int()
} */
}
var Crops = [Crop]()
var temp = Crop(name: "Turnip", season: "Spring", reharvistable: false)
Crops.append(Crop(Name: "Turnip", Season: "Spring", Reharvistable:
false, Stage1(minDay: 2, maxDay: 3, minWater: 2, maxWater: 7)))
Stage 2 is commented out but I wanted to have up to Stage 6 in the future.
"temp" works but my attempt to add them to the array didn't. My ultimate goal is to have these "Crop"s to be store in an array, "Crops" so I want to be able to dynamically add more "Crop"s. Also, the parentheses are after each datatype because they were giving me an error without them.