diff --git a/event_structure.wsd b/event_structure.wsd new file mode 100644 index 0000000..7efdbdc --- /dev/null +++ b/event_structure.wsd @@ -0,0 +1,25 @@ +/' +Copyright (C) 2024 CSharp.Discord.API +This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +'/ + +@startuml Event structure + +abstract class Event{ + ' The main event class describing every + ' event happening within the state machine + + + Readonly Dictionary Fields +} + +abstract class CreateEvent extends Event{ +} + +abstract class ModifyEvent extends Event{ +} + +abstract class DeleteEvent extends Event{ +} + +@enduml \ No newline at end of file diff --git a/object_structure.wsd b/object_structure.wsd new file mode 100644 index 0000000..2c001fa --- /dev/null +++ b/object_structure.wsd @@ -0,0 +1,158 @@ +/' +Copyright (C) 2024 CSharp.Discord.API +This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +'/ + +@startuml Object structure + +struct ID <>{ + + uint64 id +} + +class LifeSpan{ + + bool Alive + + {event} Expired + + {static} Infinite + ~ Kill() +} + +abstract class DiscordObject{ + + ID Id + + ReadonlyDictionary UnmanagedFields + + LifeSpan LifeSpan + ~ void Update(ModifyEvent e) + + {static} DiscordObject CreateNew(CreateEvent e) +} + +class DiscordList <> implements "IReadonlyDictionary"{ + - Dictionary Items + + void UpdateMany(IEnumerable events) +} + +class Application extends DiscordObject { + + string Name + ' There are a lot of extra fields not accounted for here +} + +abstract class Channel extends DiscordObject{ + ' Type will be expressed by the dynamic type of the object + ' This is a broad parent class for all channels +} + +abstract class GuildChannel extends Channel{ + ' Channels inside guilds + + string Name + + Guild Guild + + Channel? Parent +} + +class DirectChannel extends Channel{ + ' Direct channels between two users +} + +class GroupDMChannel extends DirectChannel{ + +} + +class GuildCategoryChannel extends GuildChannel{ + +} + +class GuildTextChannel extends GuildChannel{ + +} + +class GuildAnnouncementChannel extends GuildTextChannel{ + +} + +class GuildForumChannel extends GuildTextChannel{ + +} + +class GuildThreadChannel extends GuildTextChannel{ + +} + +class GuildAnnouncementThreadChannel extends GuildThreadChannel{ + +} + +class GuildPublicThreadChannel extends GuildThreadChannel{ + +} + +class GuildPrivateThreadChannel extends GuildThreadChannel{ + +} + +class GuildVoiceChannel extends GuildChannel{ + + int Bitrate +} + +class GuildStageChannel extends GuildVoiceChannel{ + +} + +class Emoji extends DiscordObject{ + + string Name + + ID[]? AllowedRoles +} + +class Sticker extends DiscordObject{ + + string Name + + string? Description + + int Type + + int FormatType + + Guild? Guild +} + +class User extends DiscordObject{ + + string Username + + string? Discriminator + + string? GlobalName +} + +class GuildMember extends DiscordObject{ + + User? User + + string? Nickname + + List Roles + + DateTime JoinedAt + + bool Mute + + bool Deaf +} + +class Role extends DiscordObject { + + string Name + + uint Color + + bool Hoist + + int Position + + bool Mentionable +} + +class Guild extends DiscordObject{ + + string Name + + string? Description + + ID OwnerId + + Channel? AfkChannel + + Channel? SystemChannel + + Channel? RulesChannelId + + int AfkTimeout + + DiscordList Roles + + DiscordList Emojis + + DiscordList Members + + DiscordList Channels +} + +ID *-- DiscordObject +User *-- GuildMember +GuildMember "0..*" <-- Guild +Role "0..*" <-- Guild +Emoji "0..*" <-- Guild +Sticker "0..*" <-- Guild +GuildChannel "0..*" <-- Guild +LifeSpan *-- DiscordObject +DiscordObject "0..*" <-- DiscordList + +@enduml \ No newline at end of file