If i have a struct that enables a user to initialize some of the members of the struct but at a later time update other members (i.e below kittyPriceTomorrow) and this struct is inside an array. How would we access that struct inside the array to update the values with? To further this lets say tomorrow has arrived thus time has expired and the user calls this group to return the results which triggers an update function that goes into this specific group being reference and updates the kittyPriceTomorrow member.
//struct for users and group name
struct kitties {
bytes groupName;
account user1;
account kitty1;
uint kittyPriceToday;
uint kittyPriceTomorrow;
}
//array to hold structs
kitties[] public allKitties;
I anticipated the following to locate the group being requested, verify the end date of the time has been reached, locate the price at the set endtime and update the struct with the price at that time inside the specific struct. This is based off other examples I've seen but visually and logically i am struggling with the comprehending on where i am suppose to input the group name that the user gave for the specific struct to be updated. I would think its allKitties.kitties.groupName.kittyPriceToday but I seem to be missing something fundamental to complete the update. please help!
function updateKittyStruct() public {
//storing the struct to the array
kitties storage allkitties = allkitties
//pass in the updated values below
allkitties.kittyPriceToday = xyzPrice;
// something like below
allKitties.kitties.groupName.kittyPriceToday = xyzPrice;
}