using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;

public class PowderMonkeyJob : Job
{
	public enum JobState
	{
		GettingAmmo = 1,
		FiringCannon
	}

	private JobState jobState = JobState.GettingAmmo;
	private AmmoType ammoType;

	private GameController gameController;

	void Awake ()
	{
		var gameControllerGO = GameObject.FindGameObjectWithTag ("GameController");
		if (gameControllerGO != null)
			gameController = gameControllerGO.GetComponent<GameController> ();		
	}

	public override IEnumerator DoWork ()
	{
		StopJob = false;

		while (!StopJob) {
			switch (jobState) {
			case JobState.GettingAmmo:
				GetAmmo ();
				jobState = JobState.FiringCannon;
				break;
			case JobState.FiringCannon:
				FireCannon ();
				jobState = JobState.GettingAmmo;
				break;
			}
			yield return new WaitForSeconds (0.1f);
		}
		base.DoWork ();
	}

	public void ChangeShot (AmmoType newAmmoType)
	{
		ammoType = newAmmoType;
	}

	private void GetAmmo ()
	{
	}

	private void FireCannon ()
	{
		//DeckRoom.Instance.DoWork ();
	}
}
