= Updated Styleguide and comments

This commit is contained in:
Matthew Cech
2019-04-12 22:22:07 -07:00
parent e1c9c80dd7
commit e70bd5d8d2
2 changed files with 17 additions and 3 deletions
+16 -1
View File
@@ -1,6 +1,9 @@
KittyBot Style Guide
---
# Formatting
#### Indenting
Tabs are used so that individual developers can configure their own indent width settings that won't be enforced on others working on the project.
@@ -44,4 +47,16 @@ public class MyClass
#### Ternary Operator (`?:`)
Don't.
#### <more to come>
# Architecture
#### Commands
All commands get spawned on their own threads, and should be implemented in a thread-safe way. Commands all derive from the Command.java class, and use the custom types defined in KittyBot. In order to make any later changes easier and decouple the command logic from core and routing, no JDA structures should be directly exposed in commands, and instead everything needed should be added to the kitty structures that add space to the system. Commands should override the `HelpText` and `Run` functions. Commands are registered in the ObjectBuilderFactory, and the command registration structure can be used for sub-commands as needed. See the RPG for an example.
#### Tracked Values
Does something need to be tracked in a database? Make sure the class with the data you want inherits from DatabaseTrackedObject, and override the appropriate functions. The object, when marked as dirty, will automatically be written to the database when the next database upkeep tick occurs. Refer to CommandBoop to see an example of a tracked global value, and KittyUser for tracked per-user values.
#### Tokens, Secrets, etc
Things like tokens, private keys, an secrets are kept in the offline package. This file is intentionally excluded from the repo. If it shouldn't be in the repo, put it in the offline package.