Exemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="componentId"></param>
        /// <returns></returns>
        public T GetComponent <T>(ComponentId componentId) where T : class, IComponent
        {
            IComponent returnValue = null;

            m_ComponentDictionary.TryGetValue(componentId, out returnValue);

            return(returnValue as T);
        }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="componentMessage"></param>
        public void SubScribeComponentMessage(ComponentId componentId, ComponentMessage componentMessage)
        {
            IComponent outComponent = null;

            if (m_ComponentDictionary.TryGetValue(componentId, out outComponent) == true)
            {
                m_MessageMultiDictionary.Add(componentMessage, outComponent);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="componentId"></param>
        /// <param name="component"></param>
        public void RegisterComponent <T>(ComponentId componentId, T component) where T : class, IComponent
        {
            if (component == null)
            {
                throw new Exception("ComponentHandler.RegisterComponent(...) - component == null error!");
            }

            m_ComponentDictionary.Add(componentId, component);
        }