Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
Be sure to change this and the framework edition when changing data structures. Then change all the apps that rely on these.
  • Loading branch information
TheUnifox committed Dec 27, 2023
1 parent fe56566 commit 5450abc
Show file tree
Hide file tree
Showing 4 changed files with 156 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.vs/
**/bin/
**/obj/
25 changes: 25 additions & 0 deletions TECDataClasses.sln
Original file line number Diff line number Diff line change
@@ -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
119 changes: 119 additions & 0 deletions TECDataClasses/Data.cs
Original file line number Diff line number Diff line change
@@ -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
}
}
9 changes: 9 additions & 0 deletions TECDataClasses/TECDataClasses.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>

0 comments on commit 5450abc

Please sign in to comment.