tenor dependency on comms

This commit is contained in:
Leijurv 2018-11-23 13:08:38 -08:00
parent c5ecb9bb9b
commit 806c2a4af1
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
2 changed files with 23 additions and 3 deletions

View File

@ -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
}
}

View File

@ -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;
}
}