PageRenderTime 29ms CodeModel.GetById 17ms app.highlight 11ms RepoModel.GetById 0ms app.codeStats 0ms

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