Esempio n. 1
0
 public static void Load(string path)
 {
     ContentPath = path;
     Fonts       = new Fonts();
     Textures    = new Textures();
     Sprites     = new Sprites();
     Polygones   = new Polygones();
 }
Esempio n. 2
0
        public List <Polygone> LoadFromFile()
        {
            if (Loader.NoPolygone.Where(x => x == FileName).Any())
            {
                return(Polygones);
            }
            Console.WriteLine($"Reading file {FileName}");
            try
            {
                StreamReader file = new StreamReader(Path + FileName);
                while (!file.EndOfStream)
                {
                    var strline = file.ReadLine();
                    strline = strline.CleanSpace();
                    var ret = DecryptLine(strline);
                    if (ret.Any())
                    {
                        Polygones.AddRange(ret);
                    }
                }
                //Adding the new element to the main base
                // save only small sized elements, large ones take more time to be cloned
                if ((IsPart) && (Polygones.Count < 5000))
                {
                    DatPart dtobj = new DatPart();
                    Console.WriteLine($"Adding {FileName} to saved list");
                    dtobj.AddPolygones(Polygones.DeepClone <List <Polygone> >());
                    dtobj.Name = FileName;
                    Loader.DatObj.Add(dtobj);
                }
                if (!Polygones.Any())
                {
                    Loader.NoPolygone.Add(FileName);
                }

                file.Close();
                file.Dispose();
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }
            return(Polygones);
        }
Esempio n. 3
0
 public void Add_Last(Point _point)
 {
     Polygones.Last().Points.Add(_point);
 }
Esempio n. 4
0
 public void Change_Last(Point _point)
 {
     Polygones.Last().Points[Count_Last - 1] = _point;
 }
Esempio n. 5
0
 public void Add(Polygon _polygon)
 {
     Polygones.Add(_polygon);
 }