public static void Write(this IBotInterface bot, Move move)
        {
            if (bot == null)
            {
                throw new ArgumentNullException(nameof(bot));
            }
            if (move == null)
            {
                throw new ArgumentNullException(nameof(move));
            }

            var message = new Message
            {
                Type        = move is PassMove ? MessageType.Pass : MessageType.MovePiece,
                JsonPayload = JsonConvert.SerializeObject(move),
            };

            var data = JsonConvert.SerializeObject(message);

            bot.WriteLine(data);
        }
Exemple #2
0
 public void WriteLine(string input)
 {
     _botInterface.WriteLine(input);
 }