Exemplo n.º 1
0
        public static Tuple <List <CustomLine>, Tuple <Point, bool> > Load(string path)
        {
            var loadedObject = SavedGame.Load(path);

            var objects = loadedObject.Load();

            List <CustomLine> list = new List <CustomLine>();

            foreach (var o in objects)
            {
                if (o is CustomGroup)
                {
                    list.AddRange((o as CustomGroup).GetShapes().Cast <CustomLine>());
                }
                if (o is CustomLine)
                {
                    list.Add((o as CustomLine));
                }
            }

            return(new Tuple <List <CustomLine>, Tuple <Point, bool> >(list, new Tuple <Point, bool>(loadedObject.CordSystemCenter, loadedObject.isCordShown)));
        }
Exemplo n.º 2
0
        public static string Save(string path, IEnumerable <CustomLine> objects, Point cordSystemCenter, bool isCordShown)
        {
            var savedGame = new SavedGame(objects, cordSystemCenter, isCordShown);

            return(savedGame.Save(path));
        }