= Updated Styleguide and comments
This commit is contained in:
+16
-1
@@ -1,6 +1,9 @@
|
|||||||
KittyBot Style Guide
|
KittyBot Style Guide
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
|
# Formatting
|
||||||
|
|
||||||
#### Indenting
|
#### 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.
|
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 (`?:`)
|
#### Ternary Operator (`?:`)
|
||||||
Don't.
|
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.
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package core;
|
package core;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import dataStructures.KittyChannel;
|
import dataStructures.KittyChannel;
|
||||||
import dataStructures.KittyGuild;
|
import dataStructures.KittyGuild;
|
||||||
import dataStructures.KittyRating;
|
import dataStructures.KittyRating;
|
||||||
@@ -42,7 +41,7 @@ public abstract class Command
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO(wisp, rin): ADD CHANNEL CHECK HERE
|
//TODO: ADD CHANNEL CHECK HERE
|
||||||
|
|
||||||
if(user.GetRole().getValue() >= roleLevel.getValue())
|
if(user.GetRole().getValue() >= roleLevel.getValue())
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user