Skip to content

Commit

Permalink
testdb added
Browse files Browse the repository at this point in the history
  • Loading branch information
SancezZ committed Jan 10, 2012
1 parent 551bfe6 commit 4bd1a72
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/de/fhb/projects/Twitchess/twitterbot/main/TwitterBot.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
import twitter4j.media.ImageUploadFactory;
import de.fhb.projects.Twitchess.controller.ManagerFactory;
import de.fhb.projects.Twitchess.controller.ManagerInterface;
import de.fhb.projects.Twitchess.exception.TokenNotFoundException;
import de.fhb.projects.Twitchess.games.chess.Fen;
import de.fhb.projects.Twitchess.image.GenerateImage;
import de.fhb.projects.Twitchess.twitterbot.commands.Command;
import de.fhb.projects.Twitchess.twitterbot.exceptions.TokenNotFoundException;
import de.fhb.projects.Twitchess.twitterbot.util.Serializer;
import de.fhb.projects.Twitchess.util.Serializer;

public class TwitterBot extends Observable {
public final String STANDARD_ACCOUNT = getString("Twitter.StandardAccount", "MatefulBot");
public class TwitterBot extends TwitterBotAbstract {


private Twitter twitter;
private TwitterStream twitterStream;
Expand Down
19 changes: 14 additions & 5 deletions src/de/fhb/projects/Twitchess/twitterbot/main/TwitterView.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@
import java.util.Observable;
import java.util.Observer;

import de.fhb.projects.Twitchess.exception.TokenNotFoundException;
import de.fhb.projects.Twitchess.twitterbot.commands.ExitCommand;
import de.fhb.projects.Twitchess.twitterbot.commands.FollowCommand;
import de.fhb.projects.Twitchess.twitterbot.commands.ToggleAnsweringCommand;
import de.fhb.projects.Twitchess.twitterbot.commands.UpdateStatusCommand;
import de.fhb.projects.Twitchess.twitterbot.exceptions.TokenNotFoundException;

public class TwitterView implements Runnable, Observer {
private TwitterBot twitterbot;
private TwitterBotAbstract twitterbot;
private Thread thread;
private BufferedReader inputReader;
private boolean running;

public TwitterView(TwitterBot controller) {
this.twitterbot = controller;
public TwitterView(TwitterBotAbstract tb) {
this.twitterbot = tb;
inputReader = new BufferedReader(new InputStreamReader(System.in));
twitterbot.addObserver(this);
login();
Expand Down Expand Up @@ -87,7 +87,7 @@ public void run() {
}
}

private void processInput(String input) {
protected void processInput(String input) {
switch (getCommandNumber(input)) {
case 0 :
twitterbot.receiveCommand(new ExitCommand());
Expand Down Expand Up @@ -161,4 +161,13 @@ public void update(Observable observable, Object argument) {
else if (argument instanceof String)
printMessage((String) argument);
}

public BufferedReader getInputReader() {
return inputReader;
}

public void setInputReader(BufferedReader inputReader) {
this.inputReader = inputReader;
}

}
Binary file added test-files/chess.db
Binary file not shown.

0 comments on commit 4bd1a72

Please sign in to comment.