/.metadata/.plugins/org.eclipse.core.resources/.history/ef/609ac07280a3001e1dff9ae635b3e1ee

https://bitbucket.org/fixpoint/connexion · #! · 50 lines · 40 code · 10 blank · 0 comment · 0 complexity · ba00eee579d5215f71c2108d2349d89d MD5 · raw file

  1. package info.reflectionsofmind.connexion.platform.cli;
  2. import info.reflectionsofmind.connexion.platform.control.IRoot;
  3. import info.reflectionsofmind.connexion.platform.control.ServerInfo;
  4. import info.reflectionsofmind.connexion.platform.control.control.IConnectControl;
  5. import info.reflectionsofmind.connexion.platform.control.control.IJoinControl;
  6. import info.reflectionsofmind.connexion.platform.game.IGame;
  7. import info.reflectionsofmind.connexion.transport.ITransport;
  8. import info.reflectionsofmind.connexion.transport.ITransport.INode;
  9. import java.util.concurrent.Future;
  10. public class ConnectInterpreter implements IConnectControl, IInterpreter
  11. {
  12. private final IGame game;
  13. private final IRoot root;
  14. public ConnectInterpreter(final IRoot root, final IGame game)
  15. {
  16. this.game = game;
  17. this.root = root;
  18. }
  19. public Future<IJoinControl> connect(final String name, final INode server)
  20. {
  21. return null;
  22. }
  23. public IGame getGame()
  24. {
  25. return this.game;
  26. }
  27. public IRoot getRoot()
  28. {
  29. return this.root;
  30. }
  31. public void interpret(final String command)
  32. {
  33. if (command.equals("connect"))
  34. {
  35. final ServerInfo info = this.root.getConfiguration().getServers().get(0);
  36. final ITransport transport = info.getFactory().createTransport(info.getParameters());
  37. connect("Player", info)
  38. }
  39. }
  40. }