Пример #1
0
        public void AddSystem(ISystem system)
        {
            systems.Add(system);

            var systemType   = system.GetType();
            var messageTypes = system.HearsMessages();

            messageTypes.ForEach(t => MessageHub.Register(systemType, t));

            var requiredTypes = system.RequiredTypes();

            FamilyManager.Register(requiredTypes);

            var nodeType = system.NodeType();

            if (nodeType != null)
            {
                FamilyManager.RegisterNodeFamily(nodeType);
            }


            if (system is IKnowsEngine)
            {
                (system as IKnowsEngine).Engine = this;
            }
        }