示例#1
0
        public CollisionCheckSystem()
        {
            TemplateFilter <CollisionCheckForwardTemplate> .Setup();

            _list = EntityController.GetTemplateList <CollisionCheckForwardTemplate>();
            _del  = RunUpdate;
        }
示例#2
0
        public FlightPhysicsSystem()
        {
            TemplateFilter <FlyingTemplate> .Setup();

            _flyingList = EntityController.GetTemplateList <FlyingTemplate>();
            _del        = UpdateNode;
        }
示例#3
0
        public MapSystem()
        {
            TemplateFilter <UnitOccupyingCellTemplate> .Setup();

            _templateList = EntityController.GetTemplateList <UnitOccupyingCellTemplate>();
            _del          = UpdateNode;
        }
示例#4
0
        public PlayerRaycastTargetSystem()
        {
            TemplateFilter <PlayerRaycastTargetTemplate> .Setup();

            _list = EntityController.GetTemplateList <PlayerRaycastTargetTemplate>();
            _del  = Update;
        }
示例#5
0
        private void RegisterRuleTemplates()
        {
            TemplateFilter <ApplyModifierRuleTemplate> .Setup();

            TemplateFilter <ApplyTagRuleTemplate> .Setup();

            TemplateFilter <BlockDamageRuleTemplate> .Setup();

            TemplateFilter <ConvertVitalRuleTemplate> .Setup();

            TemplateFilter <DamageRuleTemplate> .Setup();

            TemplateFilter <HealRuleTemplate> .Setup();

            TemplateFilter <InstantKillRuleTemplate> .Setup();

            TemplateFilter <RaiseDeadRuleTemplate> .Setup();

            TemplateFilter <RollInitiativeRuleTemplate> .Setup();

            TemplateFilter <ModifyMoveSpeedRuleTemplate> .Setup();

            TemplateFilter <AttackRollTemplate> .Setup();

            TemplateFilter <DefendRollTemplate> .Setup();
        }
示例#6
0
        public TurnBasedSystem()
        {
            TemplateFilter <TurnBasedCharacterTemplate> .Setup();

            _turnTemplates      = EntityController.GetTemplateList <TurnBasedCharacterTemplate>();
            _findCurrentFastest = FindCurrent;
            _setupUnitTurns     = SetupUnitTurn;
        }
示例#7
0
        public EquipmentSystem()
        {
            TemplateFilter <EquipmentTemplate> .Setup();

            EntityController.RegisterReceiver(new EventReceiverFilter(this, new[] {
                typeof(Equipment)
            }));
        }
示例#8
0
        public ActionSystem()
        {
            TemplateFilter <ActionUsingTemplate> .Setup();

            TemplateFilter <ActionTemplate> .Setup();

            TemplateFilter <BaseActionTemplate> .Setup();
        }
        public FirstPersonAnimationSystem()
        {
            TemplateFilter <FirstPersonAnimationTemplate> .Setup();

            _animTemplates = EntityController.GetTemplateList <FirstPersonAnimationTemplate>();
            EntityController.RegisterReceiver(new EventReceiverFilter(this, new [] {
                typeof(WeaponModelComponent),
                typeof(PoseAnimatorComponent)
            }));
        }
示例#10
0
        public SensorSystem()
        {
            _sensorDel      = RunUpdate;
            _unitySensorDel = RunUpdate;
            TemplateFilter <SensorDetectingTemplate> .Setup();

            _sensorTemplates = EntityController.GetTemplateList <SensorDetectingTemplate>();
            TemplateFilter <UnitySensorTemplate> .Setup();

            _unitySensorTemplates = EntityController.GetTemplateList <UnitySensorTemplate>();
            EntityController.RegisterReceiver(new EventReceiverFilter(this, new[] {
                typeof(SensorTargetsComponent)
            }));
        }
示例#11
0
        public static void Setup()
        {
            IsSetup = true;
            if (Instance == null)
            {
                return;
            }
            TemplateFilter <VisibleTemplate> .Setup();

            TemplateFilter <CharacterTemplate> .Setup();

            TemplateFilter <CollidableTemplate> .Setup();

            Get <TurnBasedCommandSystem>();
            Get <CollisionCheckSystem>();
            Get <DespawnEntitySystem>();
            Get <DistanceSystem>();
            Get <FactionSystem>();
            Get <ItemSceneSystem>();
            Get <ModifierSystem>();
            Get <MoverSystem>();
            Get <PhysicsMoverSystem>();
            Get <CharacterRectSystem>();
            Get <SensorSystem>();
            Get <EntityUIPoolSystem>();

            var assemblies = AppDomain.CurrentDomain.GetAssemblies();

            for (int a = 0; a < assemblies.Length; a++)
            {
                var types = assemblies[a].GetTypes();
                for (int t = 0; t < types.Length; t++)
                {
                    var type = types[t];
                    if (type.IsDefined(typeof(AutoRegisterAttribute), false))
                    {
                        CreateSystem(type);
                    }
                    var actionAttribs = type.GetCustomAttributes(typeof(ActionProviderAttribute), false);
                    for (int i = 0; i < actionAttribs.Length; i++)
                    {
                        if (actionAttribs[i] is ActionProviderAttribute attrib)
                        {
                            ActionProviderSystem.Add(attrib.Action, Activator.CreateInstance(type) as IActionProvider);
                        }
                    }
                }
            }
        }
        public SpriteRenderingSystem()
        {
            TemplateFilter <SpriteRendererTemplate> .Setup();

            _rendererList = EntityController.GetTemplateList <SpriteRendererTemplate>();
            _rendererDel  = RunUpdate;

            TemplateFilter <SpriteRendererInstancedTemplate> .Setup();

            _rendererInstancedList = EntityController.GetTemplateList <SpriteRendererInstancedTemplate>();
            _rendererInstancedDel  = RunUpdate;

            _simpleRenderers   = EntityController.GetComponentArray <SpriteSimpleRendererComponent>();
            _simpleRendererDel = RunUpdate;

            ItemPool.LoadAsset <Material>(MaterialAddress, (m) => _material = m);
        }
示例#13
0
        private void RegisterRuleTemplates()
        {
            TemplateFilter <ApplyModifierRuleTemplate> .Setup();

            TemplateFilter <ApplyTagRuleTemplate> .Setup();

            TemplateFilter <BlockDamageRuleTemplate> .Setup();

            TemplateFilter <ConvertVitalRuleTemplate> .Setup();

            TemplateFilter <DamageRuleTemplate> .Setup();

            TemplateFilter <HealRuleTemplate> .Setup();

            TemplateFilter <InstantKillRuleTemplate> .Setup();

            TemplateFilter <RaiseDeadRuleTemplate> .Setup();
        }
示例#14
0
        public MoverSystem()
        {
            TemplateFilter <ForwardMoverTemplate> .Setup();

            _forwardMovers = EntityController.GetTemplateList <ForwardMoverTemplate>();
            _forwardDel    = HandleForwardMovement;
            TemplateFilter <RotateToTemplate> .Setup();

            _rotators  = EntityController.GetTemplateList <RotateToTemplate>();
            _rotateDel = HandleRotation;
            TemplateFilter <SimpleMoverTemplate> .Setup();

            _simpleMovers = EntityController.GetTemplateList <SimpleMoverTemplate>();
            _simpleDel    = HandleMoveSimple;
            TemplateFilter <ArcMoverTemplate> .Setup();

            _arcMovers = EntityController.GetTemplateList <ArcMoverTemplate>();
            _arcDel    = HandleArcMovement;
        }
示例#15
0
        public static void Setup()
        {
            IsSetup = true;
            if (Instance == null)
            {
                return;
            }
            TemplateFilter <VisibleTemplate> .Setup();

            TemplateFilter <CharacterTemplate> .Setup();

            TemplateFilter <CollidableTemplate> .Setup();

            Get <CommandSystem>();
            Get <CollisionCheckSystem>();
            Get <DespawnEntitySystem>();
            Get <DistanceSystem>();
            Get <FactionSystem>();
            Get <ItemSceneSystem>();
            Get <ModifierSystem>();
            Get <MoverSystem>();
            Get <PhysicsMoverSystem>();
            Get <CharacterRectSystem>();
            Get <SensorSystem>();
            Get <EntityUIPoolSystem>();

            var assemblies = AppDomain.CurrentDomain.GetAssemblies();

            for (int a = 0; a < assemblies.Length; a++)
            {
                var types = assemblies[a].GetTypes();
                for (int t = 0; t < types.Length; t++)
                {
                    var type = types[t];
                    if (type.IsDefined(typeof(AutoRegisterAttribute), false))
                    {
                        CreateSystem(type);
                    }
                }
            }
        }
示例#16
0
 public AnimationEventSystem()
 {
     TemplateFilter <AnimationEventTemplate> .Setup();
 }
示例#17
0
 public ProjectileSystem()
 {
     TemplateFilter <ProjectileTemplate> .Setup();
 }
示例#18
0
 public ContainerSystem()
 {
     TemplateFilter <ContainerItemTemplate> .Setup();
 }