예제 #1
0
파일: Entity.cs 프로젝트: Setoville/Engine
        /// <summary>
        /// Attempts to add the component to the object.
        /// It should work fine if there aren't any conflicting component Ids.
        /// You can't add a type of component more than once.
        /// </summary>
        /// <param name="Component"> The Component to add. </param>
        /// <returns> Whether the operation succeded. </returns>
        public bool AddComponent(IEntityComponent Component)
        {
            uint key = Component.GetID();

            Component.OnCreate(this);
            return(Components.TryAdd(key, Component));
        }