Esempio n. 1
0
 public void SetZone(Zoning.Zone zone)
 {
     this.zone = zone;
     onZoneChanged?.Invoke(this);
 }
        private void LoadZones()
        {
            Database.MySqlCommand command = new PhoenixProject.Database.MySqlCommand(PhoenixProject.Database.MySqlCommandType.SELECT);
            command.Select("notavailablepaths").Where("mapid", ID);

            PhoenixProject.Database.MySqlReader reader = new PhoenixProject.Database.MySqlReader(command);
            while (reader.Read())
            {
                Zoning.Zone zone = new Zoning.Zone(
                    new Point() { X = reader.ReadInt32("Point1_X"), Y = reader.ReadInt32("Point1_Y") },
                    new Point() { X = reader.ReadInt32("Point2_X"), Y = reader.ReadInt32("Point2_Y") },
                    new Point() { X = reader.ReadInt32("Point3_X"), Y = reader.ReadInt32("Point3_Y") },
                    new Point() { X = reader.ReadInt32("Point4_X"), Y = reader.ReadInt32("Point4_Y") }
                    );
                Zones.Add(zone);
            }
            reader.Close();
            reader.Dispose();
        }