示例#1
0
        public void DebugClass <T>()
        {
            AbstractClass abstractClass = Registry.DirectClassSearch <T>();
            var           wrappers      = _containers[abstractClass.HashCode];

            for (int i = 0; i < wrappers.Length; i++)
            {
                Console.WriteLine(wrappers[i]);
            }
        }
示例#2
0
        /// <summary>
        /// Adds a new instance of a class and pushes it onto the end of
        /// the stack
        /// </summary>
        /// <typeparam name="T"></typeparam>
        public void CreateEntity <T>()
        {
            AbstractClass abstractClass = Registry.DirectClassSearch <T>();
            var           wrappers      = _containers[abstractClass.HashCode];

            for (int i = 0; i < wrappers.Length; i++)
            {
                wrappers[i].Add();
            }

            Console.WriteLine($"EcsTable::Created\t::{abstractClass.ClassType.Name} from {typeof(T).Name}");
        }
示例#3
0
        public ContainerIterator Restrict <T>()
        {
            uint            id          = Registry.DirectClassSearch <T>().HashCode;
            List <RefArray> classArrays = new List <RefArray>();

            for (var i = 0; i < _SOAs.Length; i++)
            {
                // check component hashcode against restriction
                if (_SOAs[i].HashCode == id)
                {
                    classArrays.AddRange(_SOAs[i].ComponentArrays);
                    break;
                }
            }

            return(new ContainerIterator(new [] { classArrays.ToArray() }));
        }