aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core/material/Ion.java
blob: 2b5b113b9213d8e5ec533079d26f5843e760b7fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package gtPlusPlus.core.material;

public class Ion {

	private final Material mElement;
	private final boolean mContainsPositiveCharge;
	private final int mTotalIonization;

	public Ion(Material aMat, int chargeAmount) {
		mElement = aMat;
		mContainsPositiveCharge = (chargeAmount >= 0);
		mTotalIonization = chargeAmount;
	}	
	
	public synchronized final Material getElement() {
		return mElement;
	}

	public synchronized final boolean containsPositiveCharge() {
		return mContainsPositiveCharge;
	}

	public synchronized final int getTotalIonization() {
		return mTotalIonization;
	}
	
	public final boolean isNeutral() {
		return mTotalIonization == 0;
	}
}