From 5450abc8194a7adea0e167cd0ab2208db3248810 Mon Sep 17 00:00:00 2001 From: Unifox Date: Tue, 26 Dec 2023 23:21:18 -0700 Subject: [PATCH] Initial Commit Be sure to change this and the framework edition when changing data structures. Then change all the apps that rely on these. --- .gitignore | 3 + TECDataClasses.sln | 25 ++++++ TECDataClasses/Data.cs | 119 +++++++++++++++++++++++++++ TECDataClasses/TECDataClasses.csproj | 9 ++ 4 files changed, 156 insertions(+) create mode 100644 .gitignore create mode 100644 TECDataClasses.sln create mode 100644 TECDataClasses/Data.cs create mode 100644 TECDataClasses/TECDataClasses.csproj diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f9195be --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.vs/ +**/bin/ +**/obj/ diff --git a/TECDataClasses.sln b/TECDataClasses.sln new file mode 100644 index 0000000..eac8479 --- /dev/null +++ b/TECDataClasses.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.33516.290 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TECDataClasses", "TECDataClasses\TECDataClasses.csproj", "{6B699938-E098-481F-BA3D-766BEAA1C900}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {6B699938-E098-481F-BA3D-766BEAA1C900}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6B699938-E098-481F-BA3D-766BEAA1C900}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6B699938-E098-481F-BA3D-766BEAA1C900}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6B699938-E098-481F-BA3D-766BEAA1C900}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {E63F6769-E454-4C6E-9E99-0BE7A8802285} + EndGlobalSection +EndGlobal diff --git a/TECDataClasses/Data.cs b/TECDataClasses/Data.cs new file mode 100644 index 0000000..517f336 --- /dev/null +++ b/TECDataClasses/Data.cs @@ -0,0 +1,119 @@ +using System.Runtime.CompilerServices; + +namespace TECDataClasses +{ + public class UserData + { + public UserData(string username, string discordUsername, string encryptedPassword, string email, UserRole role, bool emailConfirmed, string pronouns, DateTime birthday, int userID) + { + this.username = username; + this.discordUsername = discordUsername; + this.encryptedPassword = encryptedPassword; + this.email = email; + this.role = role; + this.emailConfirmed = emailConfirmed; + this.pronouns = pronouns; + this.birthday = birthday; + this.userID = userID; + } + + public string username { get; set; } + public string discordUsername { get; set; } + public string encryptedPassword { get; set; } + public string email { get; set; } + public UserRole role { get; set; } + public bool emailConfirmed { get; set; } + public string pronouns { get; set; } + public DateTime birthday { get; set; } + public int userID { get; set; } + } + + public enum UserRole + { + user, + moderator, + admin, + staff, + owner + } + + public static class UserRoleExtentions + { + public static UserRole Parse(this string currentString) + { + switch (currentString) + { + case "U": + return UserRole.user; + case "M": + return UserRole.moderator; + case "A": + return UserRole.admin; + case "S": + return UserRole.staff; + case "O": + return UserRole.owner; + default: + throw new Exception("Incorrect value for UserRole"); + } + } + } + + public class EventInfo + { + public EventInfo( + int eventNumber, + string eventName, + string eventDescription, + EventType eventType, + bool questCompatable, + string userPings, + string eventLink, + EventRating eventRating, + DateTime eventDate, + DateTime eventEnd, + string eventLocation) + { + EventNumber = eventNumber; + EventName = eventName; + EventDescription = eventDescription; + EventType = eventType; + QuestCompatable = questCompatable; + UserPings = userPings; + EventLink = eventLink; + EventRating = eventRating; + EventDate = eventDate; + EventEnd = eventEnd; + EventLocation = eventLocation; + } + + public int EventNumber { get; set; } + public string EventName { get; set; } + public string EventDescription { get; set; } + public EventType EventType { get; set; } + public bool QuestCompatable { get; set; } + public string UserPings { get; set; } //Json encoded list of pings by discord user ID + public string EventLink { get; set; } + public EventRating EventRating { get; set; } + public DateTime EventDate { get; set; } + public DateTime EventEnd { get; set; } + public string EventLocation { get; set; } + } + + public enum EventType + { + Game, + Panel, + Special, + GuestPanel, + GuestGame, + Video, + Shop + } + public enum EventRating + { + Everyone, + PG13, + Adult + } +} \ No newline at end of file diff --git a/TECDataClasses/TECDataClasses.csproj b/TECDataClasses/TECDataClasses.csproj new file mode 100644 index 0000000..132c02c --- /dev/null +++ b/TECDataClasses/TECDataClasses.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + +