Esempio n. 1
0
        public void SendCommands(IEnumerable <AICommand> commandsToSend)
        {
            var message = new AICommandsMessage {
                Commands = commandsToSend
            };
            var serialized = Serializer.SerializeAICommandsMessage(message);

            if (commandsToSend.Count() > 0)
            {
                Console.WriteLine("Writing commands to server: " + serialized);
            }
            Writer.Write(serialized);
            Writer.Flush();
        }
Esempio n. 2
0
 public string SerializeAICommandsMessage(AICommandsMessage message)
 {
     return(JsonConvert.SerializeObject(message, settings) + "\n");
 }