From ced9f3a4f51ad170853cb2bce872e1a5f7e0c07a Mon Sep 17 00:00:00 2001 From: ryan Date: Sun, 15 Aug 2021 07:05:25 -0400 Subject: [PATCH] adding polymophic classes --- classes.cs | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/classes.cs b/classes.cs index f5c8213..8b94419 100644 --- a/classes.cs +++ b/classes.cs @@ -24,19 +24,29 @@ public class Objective public string Description { get; set; } public DateTime Target { get; set; } public Student Student { get; set; } - public ICollection Tracks { get; set; } - public TrackType TrackType { get; set; } + public ICollection Events { get; set; } + public ObjectiveType Type { get; set; } } -public class Track +public abstract class Event { public Guid Id { get; set; } - public DateTime Date { get; set; } + public DateTime StartDate { get; set; } + public DateTime? EndDate { get; set; } public Objective Objective { get; set; } - public object Data { get; set; } } -public enum TrackType +public class YesNoEvent : Event +{ + public bool Occurred { get; set; } +} + +public class FrequencyEvent : Event +{ + public int Instances { get; set; } +} + +public enum ObjectiveType { [Description("Yes/No")] YesNo = 0,