Пример #1
0
        /// <summary>
        ///     Checks if the system is already containing a command with the same command keys
        /// </summary>
        /// <param name="cmd">The Command</param>
        /// <returns>Returns true when interfering with other commands.</returns>
        private bool _IsInterfering(AbstractCommand cmd)
        {
            for (int i = 0; i < Commands.Count; i++)
            {
                if (cmd.IsInterfering(Commands[i]))
                {
                    return(true);
                }
            }

            return(false);
        }
Пример #2
0
        public bool IsInterfering(AbstractCommand other)
        {
            for (int i = 0; i < CommandKeys.Length; i++)
            {
                if (other.CommandKeys.Contains(CommandKeys[i]))
                {
                    return(true);
                }
            }

            return(false);
        }
Пример #3
0
        /// <summary>
        ///     Adds a Single Command to the System.
        /// </summary>
        /// <param name="cmd"></param>
        public void _AddCommand(AbstractCommand cmd)
        {
            Logger.Log(LogType.Log, "Adding Command: " + cmd.GetType().FullName, 2);
            if (_IsInterfering(cmd))
            {
                Logger.Log(
                    LogType.Log,
                    "Command:" + cmd.GetType().FullName + " is interfering with other Commands.",
                    1
                    );
            }

            Commands.Add(cmd);
        }
Пример #4
0
 public static void AddCommand(AbstractCommand cmd)
 {
     instance._AddCommand(cmd);
 }
Пример #5
0
 public static bool IsInterfering(AbstractCommand cmd)
 {
     return(instance._IsInterfering(cmd));
 }