using System;
using SlatedGameToolkit.Tools.CommandSystem.Exceptions;

namespace SlatedGameToolkit.Tools.CommandSystem.Interaction
{
    public class SingleConsoleInteraction : IInteractable
    {
        private bool interacted;
        private string oneTime;
        public SingleConsoleInteraction(string oneTime) {
            this.oneTime = oneTime;
        }

        public bool Listening => false;

        public string Listen()
        {
            if (interacted) throw new FatalUsageException("Command attempted to request for more information. This generally occurs if the command being ran requires more user input.");
            interacted = true;
            return oneTime;
        }

        public void Separate()
        {
            Console.WriteLine();
        }

        public void Tell(string message)
        {
            Console.WriteLine(message);
        }
    }
}