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

[System.Serializable]
public class Word 
{
	public string word;
	public int wordIndex;
	public int typeIndex;

	WordDisplay display;

	public Word(string _word, WordDisplay _display)
	{
		word = _word;
		typeIndex = 0;

		display = _display;
		display.SetWord(word);
	}
	public char GetNextletter()
	{
		return word[typeIndex];
	}
	public void TypeLetter()
	{
		typeIndex++;
		display.RemoveLetter();
	}

	public bool WordTyped()
	{
		bool wordTyped = false;
		if (typeIndex >= word.Length)
		{
			wordTyped = true;
		}
		if (wordTyped)
		{
			
			display.RemoveWord();
			//remove the word on screen
		}
		return wordTyped;
	}
}
