Exemplo n.º 1
0
        public IDictionary <string, string> GetArguments()
        {
            var arguments = new Dictionary <string, string>();

            arguments["max-size"]      = MaxSize.ToString();
            arguments["player-sort"]   = PlayerSort;
            arguments["initial-state"] = InitialState;
            arguments["fixed-pixels"]  = string.Join(string.Empty, FixedPixels.Select(p =>
                                                                                      CLIObject.ToString(p, "X", "Y")).ToArray()
                                                     );

            return(arguments);
        }
Exemplo n.º 2
0
        public void Load(XElement element)
        {
            MaxSize      = Convert.ToInt32(element.Element("maxSize").Value);
            PlayerSort   = element.Element("playerSort").Value;
            InitialState = element.Element("initialState").Value;

            var fixedPixelsElement = element.Element("fixedPixels");

            FixedPixels.Clear();

            if (fixedPixelsElement != null)
            {
                foreach (var pixelElement in fixedPixelsElement.Elements("pixel"))
                {
                    FixedPixels.Add(new Point(Convert.ToInt32(pixelElement.Element("x").Value),
                                              Convert.ToInt32(pixelElement.Element("y").Value))
                                    );
                }
            }
        }