using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using UnityEngine;

namespace Cogwheel
{
    public interface ICommandsManager
    {
        public string CommandPattern { get; set; }
        public List<Assembly> Assemblies { get; set; }
        public Dictionary<string, Command> Commands { get; set; }
        public GameObject Context { get; set; }
        public Dictionary<Type, Func<string, object>> CustomParsers { get; }
        
        public (Command, List<object>)? GetCommandAndArgsFromString(string input);
        public bool RunCommand(string input);
        public string GetCommandUsage(Command command);
        public bool ExecuteCommand(object obj, (Command command, List<object> args) command);
        public bool TryParseParameter(Type parameterType, string parameterString, out object parsedValue);
        public bool IsCommandContextValid(Command command);
        public Command GetCommandByName(string commandName);
        public void SetContext(GameObject context);
        public void SetContext(string name);
        public GameObject SearchSceneForContext(string name);
    }
}