+Added SubCommand system

This commit is contained in:
Alex
2019-06-25 02:24:24 -04:00
parent 771c1ee53f
commit df7973b3d7
3 changed files with 137 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
package core;
import dataStructures.KittyEmbed;
import dataStructures.Response;
// Only one isn't null!
public class SubCommandFormattable
{
public final KittyEmbed resEmbed;
public final String resString;
// Default constructor is hidden and disabled.
// If somehow it is called, defaults to an empty string and no embed.
@SuppressWarnings("unused")
private SubCommandFormattable()
{
this.resEmbed = null;
this.resString = "";
}
public SubCommandFormattable(String res)
{
this.resEmbed = null;
this.resString = res;
}
public SubCommandFormattable(KittyEmbed embed)
{
this.resEmbed = embed;
this.resString = null;
}
public void Call(Response res)
{
if(resEmbed == null)
res.Call(resString);
else
res.CallEmbed(resEmbed);
}
}