コード例 #1
0
        public List <Component> GetAssociatedComponents(int entityID, EntityBits ComponentBits)
        {
            Matcher myMatcher = new Matcher();

            myMatcher.AddToOrSet(ComponentBits);
            List <Component> myComponents = new List <Component>();

            foreach (var A in _componentMappers)
            {
                if (myMatcher.Matches(A.Key))
                {
                    var Value = A.Value.Get(entityID);
                    myComponents.AddRange((IEnumerable <Component>)Value);
                }
            }
            return(myComponents);
        }