using UnityEngine;
using System.Collections;

[System.Serializable]
public class PolarityFavor {

	#region Private Variables
	[SerializeField]
	private Polarity _polarity;

	[SerializeField]
	private uint _positive;

	[SerializeField]
	private uint _negative;
	#endregion


	#region Getters and Setters
	public Polarity polarity {
		get {
			return _polarity;
		}
		private set {
			_polarity = value;
		}
	}

	public uint positive {
		get {
			return _positive;
		}
		private set {
			_positive = value;
		}
	}

	public uint negative {
		get {
			return _negative;
		}
		private set {
			_negative = value;
		}
	}
	#endregion


	#region Constructors
	public PolarityFavor (Polarity p) {

		polarity = p;
		positive = 0;
		negative = 0;

	}
	#endregion


	#region Methods
	public void Favor (int direction) {

		if (Mathf.Sign (direction) < 0) {

			negative++;
			
		} else {

			positive++;
			
		}

	}


	public void Reset (GameManager gm) {

		if (gm.GetType () != typeof (GameManager))
			return;

		positive = 0;
		negative = 0;

	}
	#endregion

}
