using UnityEngine;
using System.Collections;

public class VoteManager : MonoBehaviour {

    TwitchVoting twitchVoting;
    string[] currentTypes;

	// Use this for initialization
	void Start () {
        twitchVoting = GetComponent<TwitchVoting>();
	}
	
	// Update is called once per frame
	void Update () {
	    
	}

    public void StartVote(string[] types)
    {
        currentTypes = types;
        twitchVoting.StartVote(currentTypes);
    }

    public string GetVoteResult()
    {
        string result = twitchVoting.GetVoteResult();
        if(result == "none")
        {
            int rand = Random.Range(0, currentTypes.Length);
            return currentTypes[rand];
        }
        return result;
    }

    public void StopVote()
    {
        twitchVoting.StopVote();
    }
}
