diff --git a/build.gradle b/build.gradle index 58c7bf9f1..abd682e3b 100755 --- a/build.gradle +++ b/build.gradle @@ -58,9 +58,11 @@ sourceSets { launch { compileClasspath += main.compileClasspath + main.runtimeClasspath + main.output } - tenor {} + tenor { + compileClasspath += comms.compileClasspath + comms.output + } main { - compileClasspath += tenor.compileClasspath + compileClasspath += tenor.compileClasspath + tenor.output } } diff --git a/src/tenor/java/tenor/Bot.java b/src/tenor/java/tenor/Bot.java index a3e44a0be..fcecbed3c 100644 --- a/src/tenor/java/tenor/Bot.java +++ b/src/tenor/java/tenor/Bot.java @@ -17,10 +17,28 @@ package tenor; -public class Bot { +import comms.IConnection; +import comms.IMessageListener; +import comms.upward.MessageStatus; + +public class Bot implements IMessageListener { public final BotTaskRegistry taskRegistry = new BotTaskRegistry(this); + private final IConnection connectionToBot; + private volatile MessageStatus mostRecentUpdate; + + public Bot(IConnection conn) { + this.connectionToBot = conn; + // TODO event loop to read messages non blockingly + } + public int getCurrentQuantityInInventory(String item) { + // TODO get this information from the most recent update throw new UnsupportedOperationException("oppa"); } + + @Override + public void handle(MessageStatus msg) { + mostRecentUpdate = msg; + } }