Some plans are being made

This commit is contained in:
Kecskeméti László 2024-05-29 21:23:43 +02:00
parent fad1fbb4d5
commit dfcbce03d8
2 changed files with 183 additions and 0 deletions

25
event_structure.wsd Normal file
View File

@ -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<string, object> Fields
}
abstract class CreateEvent extends Event{
}
abstract class ModifyEvent extends Event{
}
abstract class DeleteEvent extends Event{
}
@enduml

158
object_structure.wsd Normal file
View File

@ -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 <<readonly>>{
+ uint64 id
}
class LifeSpan{
+ bool Alive
+ {event} Expired
+ {static} Infinite
~ Kill()
}
abstract class DiscordObject{
+ ID Id
+ ReadonlyDictionary<string, string> UnmanagedFields
+ LifeSpan LifeSpan
~ void Update(ModifyEvent e)
+ {static} DiscordObject CreateNew(CreateEvent e)
}
class DiscordList <<generic>> implements "IReadonlyDictionary<ID; DiscordObject>"{
- Dictionary<ID, DiscordObject> Items
+ void UpdateMany(IEnumerable<Event> 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<Role> 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<Role> Roles
+ DiscordList<Emoji> Emojis
+ DiscordList<GuildMember> Members
+ DiscordList<GuildChannel> 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