Beispiel #1
0
 /// <summary>
 /// Creates a client that is connected to a dummy connection.
 /// </summary>
 public static ITenhouReceiver CreateDummyClient()
 {
     var logger = new ConsoleLogger();
       var connection = new DummyTenhouConnection(logger);
       var logOnInformation = new LogOnInformation("ID0160262B-SG8PcR2h", "M", 0);
       var sender = new TenhouSender(connection, logOnInformation);
       var ai = new TsumokiriAI(sender);
       var lobbyClient = new AutoJoinLobbyClient(sender);
       var receiver = new TenhouReceiver(connection, sender, lobbyClient, ai);
       connection.Connect();
       return receiver;
 }
Beispiel #2
0
 /// <summary>
 /// Creates a local match.
 /// </summary>
 public static IEnumerable<ITenhouReceiver> CreateLocalMatch()
 {
     var server = new LocalLobbyServer(new SeedGenerator());
       for (var i = 0; i < 4; ++i)
       {
     var connection = new LocalConnection(server);
     var sender = new TenhouSender(connection, new LogOnInformation("AccountId" + i, "M", 0));
     var client = new AutoJoinLobbyClient(sender);
     var ai = new TsumokiriAI(sender);
     var receiver = new TenhouReceiver(connection, sender, client, ai);
     connection.Connect();
     yield return receiver;
       }
 }
Beispiel #3
0
 /// <summary>
 /// Creates a new instance of TsumokiriAI.
 /// </summary>
 /// <param name="sender">Used to send messages to the server.</param>
 internal TsumokiriAI(TenhouSender sender)
 {
     _sender = sender;
 }