Feb 10, 2016 11:43 PM|djkav|LINK
What would be the best approach for this mini-project?
I'll have an object Task and a Year as a collection of Days. Each Day will have one or many Tasks.
Task will consist of a Name, Schedule (Daily, Weekly, Monthly) and Frequency (x1, x2, x3, x4, x5).
Eg: Task A is 2x Monthly, Task B is 1x Daily, Task C is 4x Weekly
I would like to generate a list for a complete year of tasks. Tasks have no set order or dates, and so should just be random. Only obeying the Schedule and Frequency.
Eg: February can't contain Task A more than twice.
I'm initially thinking of using Linq to select Tasks on Schedule into separate lists.
I'd then probably iterate the separate lists to make the extra Tasks from its Frequency.
Then I'd randomise the list of Tasks.
Iterate the Year and assign a Task from the random lists for daily, weekly and monthly.
How does that logic sound?