package org.pfaa.chemica.model;

import java.awt.Color;

public class ChemicalPhaseProperties extends PhaseProperties {
	public final Thermo thermo;
	
	public ChemicalPhaseProperties(Color color, double density, Hazard hazard, Thermo thermo) {
		super(color, density, hazard);
		this.thermo = thermo;
	}
	
	public static class Solid extends ChemicalPhaseProperties {
		public Solid(Color color, double density, Thermo thermo, Hazard hazard)
		{
			super(color, density, hazard, thermo);
		}
		public Solid(Color color, double density, Thermo thermo)
		{
			this(color, density, thermo, new Hazard());
		}
		public Solid(double density, Thermo thermo, Hazard hazard)
		{
			super(Color.WHITE, density, hazard, thermo);
		}
	}
	
	public static class Liquid extends ChemicalPhaseProperties {
		public Liquid(Color color, double density, Thermo thermo, Hazard hazard)
		{
			super(color, density, hazard, thermo);
		}
		public Liquid(Color color, double density, Thermo thermo)
		{
			this(color, density, thermo, new Hazard());
		}
		public Liquid(double density, Thermo thermo, Hazard hazard)
		{
			super(Color.BLUE, density, hazard, thermo);
		}
	}
	
	public static class Gas extends ChemicalPhaseProperties {
		public Gas(Color color, Thermo thermo, Hazard hazard)
		{
			super(color, Double.NaN, hazard, thermo);
		}
		public Gas(Thermo thermo, Hazard hazard)
		{
			super(Color.WHITE, Double.NaN, hazard, thermo);
		}
		public Gas(Thermo thermo)
		{
			this(thermo, new Hazard());
		}
		
		public static double getDensity(double molarMass, double temperature, double pressure) {
			return (molarMass * pressure) / (Constants.R * temperature);
		}
	}
}
@@ -209,36 +209,36 @@
 ty, 
-Hazard hazard, Thermo thermo
+Thermo thermo, Hazard hazard
 ) %7B%0A
@@ -459,38 +459,38 @@
 r, density, 
-hazard, thermo
+thermo, hazard
 );%0A%09%09%7D%0A%09%09pub
@@ -658,37 +658,36 @@
  hazard)%0A%09%09%7B%0A%09%09%09
-super
+this
 (Color.WHITE, de
@@ -689,38 +689,132 @@
 E, density, 
-hazard, thermo
+thermo, hazard);%0A%09%09%7D%0A%09%09public Solid(double density, Thermo thermo)%0A%09%09%7B%0A%09%09%09this(density, thermo, new Hazard()
 );%0A%09%09%7D%0A%09%7D%0A%09%0A
@@ -975,38 +975,38 @@
 r, density, 
-hazard, thermo
+thermo, hazard
 );%0A%09%09%7D%0A%09%09pub
@@ -1012,37 +1012,24 @@
 blic Liquid(
-Color color, 
 double densi
@@ -1037,32 +1037,47 @@
 y, Thermo thermo
+, Hazard hazard
 )%0A%09%09%7B%0A%09%09%09this(co
@@ -1066,37 +1066,36 @@
 rd)%0A%09%09%7B%0A%09%09%09this(
-color
+null
 , density, therm
@@ -1093,36 +1093,30 @@
 ty, thermo, 
-new H
+h
 azard
-()
 );%0A%09%09%7D%0A%09%09pub
@@ -1159,73 +1159,158 @@
 ermo
-, Hazard hazard)%0A%09%09%7B%0A%09%09%09super(Color.BLUE, density, hazard, thermo
+)%0A%09%09%7B%0A%09%09%09this(density, thermo, new Hazard());%0A%09%09%7D%0A%09%09public Liquid(Thermo thermo)%0A%09%09%7B%0A%09%09%09this(Double.NaN, thermo);%0A%09%09%7D%0A%09%09public Liquid() %7B%0A%09%09%09this(null
 );%0A%09
@@ -1460,38 +1460,38 @@
 Double.NaN, 
-hazard, thermo
+thermo, hazard
 );%0A%09%09%7D%0A%09%09pub
@@ -1535,21 +1535,20 @@
 %0A%09%09%7B%0A%09%09%09
-super
+this
 (Color.W
@@ -1557,34 +1557,22 @@
 TE, 
-Double.NaN, hazard, thermo
+thermo, hazard
 );%0A%09
@@ -1641,16 +1641,54 @@
 ));%0A%09%09%7D%0A
+%09%09public Gas()%0A%09%09%7B%0A%09%09%09this(null);%0A%09%09%7D%0A
 %09%09%0A%09%09pub

refactor the ChemicalPhaseProperty constructors again in the never-ending effort to make the properties easier to define