コード例 #1
0
        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);
        }
コード例 #2
0
 public void WriteLine(string input)
 {
     _botInterface.WriteLine(input);
 }