Example #1
0
        /// <summary>
        /// Get the instance of a <see cref="IEditorGameService"/> type.
        /// </summary>
        /// <param name="serviceIdentifier">The identifier for a service</param>
        /// <returns>Return the instance of the given <see cref="IEditorGameService"/> type if it has been registered.</returns>
        public IEditorGameService GetEditorGameService <TIdentifier>()
            where TIdentifier : struct, IEditorGameServiceIdentifier
        {
            IEditorGameService output = null;

            var serviceIdentifier = new TIdentifier();

            if (Services.ContainsKey(serviceIdentifier.GetKey()))
            {
                output = Services[serviceIdentifier.GetKey()];
            }

            return(output);
        }