示例#1
0
 public PlayerData(MyCities city)
 {
     cityID   = city.cityID;
     cityName = city.cityName;
     cityPop  = city.cityPop;
     cityArea = city.cityArea;
 }
示例#2
0
        public static void SaveMyCities(MyCities city)
        {
            BinaryFormatter formatter = new BinaryFormatter();
            string          path      = "D:/mycities.save";
            FileStream      stream    = new FileStream(path, FileMode.Create);

            PlayerData data = new PlayerData(city);

            formatter.Serialize(stream, data);
            stream.Close();
        }