Ejemplo n.º 1
0
 public static AtmospherePacket operator /(AtmospherePacket A, float c)
 {
     AtmospherePacket Ar = new AtmospherePacket();
     foreach (KeyValuePair<string, float> pair in A.gases)
         Ar.gases.Add(pair.Key, pair.Value/c);
     Ar.mass = A.mass/c;
     Ar.heat = A.heat/c;
     Ar.volume = A.volume/c;
     Ar.Recalculate();
     return Ar;
 }
Ejemplo n.º 2
0
 public static AtmospherePacket operator -(AtmospherePacket A1, AtmospherePacket A2)
 {
     AtmospherePacket Ar = new AtmospherePacket();
     foreach (KeyValuePair<string, float> pair in A1.gases)
         Ar.gases.Add(pair.Key, pair.Value);
     foreach (KeyValuePair<string, float> pair in A2.gases) {
         Ar.gases[pair.Key] -= pair.Value;
     }
     Ar.mass = A1.mass-A2.mass;
     Ar.heat = A1.heat-A2.heat;
     Ar.volume = A1.volume-A2.volume;
     Ar.Recalculate();
     return Ar;
 }