Example #1
0
        public void endGame(Board b, List <string> allColors)
        {
            XElement winners  = XMLEncoder.listOfColorsToXML(allColors);
            XElement xmlQuery = new XElement("end-game",
                                             XMLEncoder.boardToXML(b),
                                             winners);
            XElement response = sendQuery(xmlQuery);

            if (response.Name != "void")
            {
                throw new Exception("Expected void from network player end game call.");
            }
        }
Example #2
0
        public void initialize(string playerColor, List <string> allColors)
        {
            XElement listOfColors = XMLEncoder.listOfColorsToXML(allColors);
            XElement xmlQuery     = new XElement("initialize",
                                                 new XElement("color", playerColor),
                                                 listOfColors);
            //Expect to receive a void
            XElement response = sendQuery(xmlQuery);

            //check if return value is void
            if (response.Name != "void")
            {
                throw new Exception("Expected void from network player initialize call.");
            }
        }