Exemple #1
0
        private void InitializeECS()
        {
            // Initialize ECS
            _world = new EcsWorld();

            _systems = new EcsSystems(_world);

            _renderingSystems = new EcsSystems(_world, "Rendering Systems");
            _renderingSystems.Add(new SpriteRenderingSystem(graphics, GraphicsDevice));


            _gameplaySystems = new EcsSystems(_world, "Gameplay Systems");
            _gameplaySystems.Add(_timingSystem = new TimingSystem());
            _gameplaySystems.Add(new StateSystem());
            _gameplaySystems.Add(new InputSystem());
            _gameplaySystems.Add(new PaddleMovementSystem());
            _gameplaySystems.Add(new MovementSystem());
            _gameplaySystems.Add(new CollisionSystem());
            _gameplaySystems.Add(new BrickBreakingSystem());
            _gameplaySystems.Add(new CameraShakeSystem());
            _gameplaySystems.Add(new BallBounceSystem());

            _systems.Add(_renderingSystems);
            _systems.Add(_gameplaySystems);

            _systems.Initialize();
        }
        private void GunshotWoundInit()
        {
            _ecsWorld = new EcsWorld();

            _mainConfig = EcsFilterSingle <MainConfig> .Create(_ecsWorld);

            LoadConfigsFromXml();

            _updateSystems = new EcsSystems(_ecsWorld);

            LastSystem = "AddNpcSystem";
            if (_mainConfig.NpcConfig.AddingPedRange > 1f)
            {
                _updateSystems
                .Add(new NpcSystem());
            }

            LastSystem = "AddPlayerSystem";
            if (_mainConfig.PlayerConfig.WoundedPlayerEnabled)
            {
                _updateSystems
                .Add(new PlayerSystem());
            }

            LastSystem = "AddAdrenalineSystem";
            if (_mainConfig.PlayerConfig.AdrenalineSlowMotion)
            {
                _updateSystems
                .Add(new AdrenalineSystem());
            }

            LastSystem = "AddOtherSystems";
            _updateSystems
            .Add(new InstantHealSystem())
            .AddHitSystems()
            .AddDamageSystems()
            .AddWoundSystems()
            .AddPainSystems()
            .Add(new HitCleanSystem())
            .Add(new HelmetRequestSystem())
            .Add(new DebugInfoSystem())
            .Add(new CheckSystem())
            .Add(new NotificationSystem())
            .Add(new ArmorSystem())
            .Add(new RagdollSystem())
            .Add(new SwitchAnimationSystem());

            LastSystem = "OnInit";
            _updateSystems.Initialize();

            Tick  += OnTick;
            KeyUp += OnKeyUp;

            Function.Call(Hash.SET_PLAYER_WEAPON_DAMAGE_MODIFIER, Game.Player, 0.00001f);
            Function.Call(Hash.SET_PLAYER_HEALTH_RECHARGE_MULTIPLIER, Game.Player, 0f);

            LastSystem      = "Stopwatch";
            _debugStopwatch = new Stopwatch();
        }
Exemple #3
0
 private void initEcs(EcsWorld ecsWorld)
 {
     systems = new EcsSystems(ecsWorld);
     systems.Add(new UnitVisualSystem());
     systems.Add(new ItemVisualSystem());
     systems.Add(new DesignationVisualSystem());
     systems.Init();
 }
Exemple #4
0
        public void Init(EcsSystems parentSystems)
        {
            _parentSystems = parentSystems;
            _parentSystems.Add(this);
            _parentSystems.Add(_internalSystems);

            if (!_isEnable)
            {
                Enable = _isEnable;
            }
        }
Exemple #5
0
        // Start is called before the first frame update
        void Start()
        {
            world  = new EcsWorld();
            system = new EcsSystems(world);

            system.Add(new GameInitSystem());
            system.Add(new PlayerInputSystem());
            system.Add(new PlayerMoveSystem());
            //system.Add(new AnimatadCharacterSystem());
            system.Add(new FollowSystem());

            system.Init();
        }
Exemple #6
0
        void Start()
        {
            // void can be switched to IEnumerator for support coroutines.

            _world   = new EcsWorld();
            _systems = new EcsSystems(_world);
#if UNITY_EDITOR
            Leopotam.Ecs.UnityIntegration.EcsWorldObserver.Create(_world);
            Leopotam.Ecs.UnityIntegration.EcsSystemsObserver.Create(_systems);
#endif
            _systems
            .Add(new InputSystem())

            .Add(LogicSystems())
            .Add(ViewSystems())

            .Add(new DestroySystem())

            // register one-frame components (order is important):
            .OneFrame <PositionUpdatedFlag>()
            .OneFrame <Ecs.Input>()
            .OneFrame <Drag>()
            .OneFrame <PlaceItemFlag>()
            //.OneFrame<ThreadChunk>()
            .OneFrame <DestroyedFlag>()

            // inject service instances here (order doesn't important):
            .Inject(GetComponent <IInputService>())
            .Inject(GetComponent <IViewService>())
            .Inject(GetComponent <IInventoryService>())
            .Inject(new GameWorld())
            .Inject(new Random())

            .Init();
        }
Exemple #7
0
    public void Init()
    {
        systems = new EcsSystems(world);

        systems
        .Add(new StartGameSystem())
        .Add(new ClearLevelSystem())
        .Add(new LevelGenerationSystem())
        .Add(new EndGameSystem())
        .Add(new DoomSystem())
        .Add(new LevelTimerSystem())
        .Add(new EndGameTimerUpdaterSystem())
        .Add(new CameraControllerSystem())
        .Add(new MapsExploringSystem())
        .Add(new DebugLogErrorsSystem())
        .Add(new ChangeDebugUIState())
        .Add(new MapObjectsExploringSystem())
        .Add(new WallsExploringSystem())
        .Add(new WallDestroyingSystem())
        .Add(new LookToCameraSystem())
        .Add(new DirectionArrowsSystem())
        .Add(new ObjectsRotationSystem())
        .Add(new ObjectMovingSystem())
        .Add(new CameraZoomSystem())

        .Inject(gameData)
        .Inject(levelData)
        .Inject(runtimeData)

        .OneFrame <MessageComponent>()
        .OneFrame <ExploreComponent>()
        .Init();
    }
Exemple #8
0
    public void Init()
    {
        systems = new EcsSystems(world);

        systems
        .Add(new PlayerSpawnSystem())
        .Add(new PlayerTargetSystem())
        .Add(new PlayerMiningSystem())
        .Add(new PlayerMovingSystem())
        .Add(new PlayerStopMiningSystem())
        .Add(new PlayerStopMovingSystem())
        .Add(new SpawnEscapedPlayersSystem())
        .Add(new PlayerExitSystem())
        .Add(new HeadSizeChangingSystem())
        .Add(new PlayerMiningCompleteSystem())
        .Add(new PlayerMovingCompleteSystem())
        .Add(new MinigProgressSystem())
        .Add(new SkinColorChangingSystem())
        .Add(new PlayerRemovingSystem())
        .Add(new EnableNavmeshAgentDelaySystem())
        .Add(new PlayerHudRemovingSystem())
        .Add(new LeaderBoardSystem())
        .Add(new PlayerUsingSystem())
        .Add(new ChangeHatSystem())
        .Add(new SavePlayersSystem())
        .Add(new LoadPlayersSystem())

        .Inject(gameData)
        .Inject(levelData)
        .Inject(runtimeData);

        systems.Init();
    }
Exemple #9
0
    public void Init()
    {
        systems = new EcsSystems(world);

        systems
        .Add(new PlayerEnterSystem())
        .Add(new DirectionCommandsSystem())
        .Add(new StatsMessagesSystem())
        .Add(new HelpMessagesSystem())
        .Add(new ColorCommandSystem())
        .Add(new HeadSizeCommandSystem())
        .Add(new ExitCommandSystem())
        .Add(new UpgradeSystem())
        .Add(new TasksBreakSystem())
        .Add(new TaskCompleteSystems())
        .Add(new UseCommandSystem())
        .Add(new HatCommandSystem())

        .Inject(gameData.TwitchCommands)
        .Inject(runtimeData)
        .Inject(gameData)

        .OneFrame <MessageComponent>()

        .Init();
    }
Exemple #10
0
        void Start()
        {
            // void can be switched to IEnumerator for support coroutines.

            _world   = new EcsWorld();
            _systems = new EcsSystems(_world);
#if UNITY_EDITOR
            Leopotam.Ecs.UnityIntegration.EcsWorldObserver.Create(_world);
            Leopotam.Ecs.UnityIntegration.EcsSystemsObserver.Create(_systems);
#endif
            var gameState = new GameState();
            _systems
            // register your systems here:
            .Add(new InitializeFieldSystem())
            .Add(new CreateCellViewSystem())
            .Add(new SetCameraSystem())
            .Add(new ControlSystem())
            .Add(new AnalyzeClickSystem())
            .Add(new CreateTakenViewSystem())

            //»спользует компоент 1 кадр, после чего удал¤ет компонент
            .OneFrame <UpdateCameraEvent> ()
            .OneFrame <Clicked> ()
            // .OneFrame<TestComponent2> ()

            // внедрение внешних данных
            .Inject(Configuration)
            .Inject(SceneData)
            .Inject(gameState)
            // .Inject (new NavMeshSupport ())
            .Init();
        }
Exemple #11
0
        void Start()
        {
            // void can be switched to IEnumerator for support coroutines.
            _world   = new EcsWorld();
            _systems = new EcsSystems(_world);
#if UNITY_EDITOR
            Leopotam.Ecs.UnityIntegration.EcsWorldObserver.Create(_world);
            Leopotam.Ecs.UnityIntegration.EcsSystemsObserver.Create(_systems);
#endif
            _systems
            .Add(new ResourceSystem())
            .Add(new StructureInitSystem())
            .Add(new StructureRunSystem())
            .Add(new BuildingMenuSystem())
            .Add(new ClickManagerSystem())
            .Add(new StabilitySystem())
            .Add(new DangerSystem())
            .Add(new ActionSystem())
            .InjectUi(_uiEmitter)


            // register one-frame components (order is important), for example:
            // .OneFrame<TestComponent1> ()
            // .OneFrame<TestComponent2> ()

            // inject service instances here (order doesn't important), for example:
            // .Inject (new CameraService ())
            // .Inject (new NavMeshSupport ())
            .Init();
        }
        private void OnEnable()
        {
            ecsWorld     = new EcsWorld();
            systems      = new EcsSystems(ecsWorld);
            fixedSystems = new EcsSystems(ecsWorld);
            gameState    = new GameState();
            unitsPool    = gameObject.GetComponent <UnitsPool>();
            unitsPool.Prewarm(1000, configuration.unitView);

#if UNITY_EDITOR
            Leopotam.Ecs.UnityIntegration.EcsWorldObserver.Create(ecsWorld);
            Leopotam.Ecs.UnityIntegration.EcsSystemsObserver.Create(systems);
#endif

            systems
            .Add(new UnitsInitSystem())
            .Add(new ClickMoveSystem())
            .Add(new UnitSelectionSystem())
            .Add(new DebugInputsSystem())
            .Add(new DynamicNavSystem())
            .Inject(gameState)
            .Inject(configuration)
            .Inject(unitsPool)
            .Init();

            fixedSystems
            .Add(new SpawnCommandSystem())
            .Add(new MoveCommandSystem())
            .Inject(gameState)
            .Inject(configuration)
            .Inject(unitsPool)
            .Init();
        }
Exemple #13
0
        private void Start()
        {
            var mainCamera     = Camera.main;
            var prefabProvider = FindObjectOfType <PrefabProvider>();
            var remotePlayerInstantiationProvider = FindObjectOfType <RemotePlayerInstantiationProvider>();
            var nicknameDisplay = FindObjectOfType <NicknameDisplay>();

            _world   = new EcsWorld();
            _systems = new EcsSystems(_world);
#if UNITY_EDITOR
            Leopotam.Ecs.UnityIntegration.EcsWorldObserver.Create(_world);
            Leopotam.Ecs.UnityIntegration.EcsSystemsObserver.Create(_systems);
#endif
            _systems
            .Add(new PlayerInstanceControlSystem())
            .Add(new CameraControlSystem())
            .Add(new UserInputSystem())
            .Add(new PlayerMovementSystem())
            .Add(new PlayerCooldownSystem())
            .Add(new PlayerShootSystem())
            .Add(new NicknameDisplaySystem())
            .Add(new GameStartSystem())
            .Add(new ScoreboardSystem())

            .OneFrame <PlayerInput>()
            .OneFrame <PlayerAddedEvent>()

            .Inject(mainCamera)
            .Inject(prefabProvider)
            .Inject(remotePlayerInstantiationProvider)
            .Inject(nicknameDisplay)

            .Init();
        }
Exemple #14
0
    private void OnEnable()
    {
        _world   = new EcsWorld();
        _systems = new EcsSystems(_world);

#if UNITY_EDITOR
        Leopotam.Ecs.UnityIntegration.EcsWorldObserver.Create(_world);
        Leopotam.Ecs.UnityIntegration.EcsSystemsObserver.Create(_systems);
#endif

        _systems
        .Add(new WorldInitSystem())
        .Add(new PlayerInitSystem())
        .Add(new GhostInitSystem())
        .Add(new WallInitSystem())
        .Add(new PortalInitSystem())
        .Add(new FoodInitSystem())
        .Add(new ScoreTableInitSystem())
        .Add(new GameStateInitSystem())
        .Add(new PlayerInputSystem())
        .Add(new GhostSystem())
        .Add(new UpdateDirectionSystem())
        .Add(new MoveSystem())
        .Add(new ItemSystem())
        .Add(new FoodSystem())
        .Add(new EnergizerSystem())
        .Add(new GhostFearStateSystem())
        .Add(new DeathSystem())
        .Add(new PortalSystem())
        .Add(new TeleportSystem())
        .Add(new WorldSystem())
        .Add(new ScoreTableSystem())
        .Add(new GameStateSystem())
        .Initialize();
    }
Exemple #15
0
        void Start()
        {
            _world = new EcsWorld();
#if UNITY_EDITOR
            UnityIntegration.EcsWorldObserver.Create(_world);
#endif
            _systems = new EcsSystems(_world);
            _systems
#if !LEOECS_DISABLE_INJECT
            .Add(_uiEmitter)
            .Add(new TestUiClickEventSystem())
            .Add(new TestUiDragEventSystem())
            .Add(new TestUiEnterExitEventSystem())
            .Add(new TestUiInputEventSystem())
            .Add(new TestUiScrollViewEventSystem())
#else
            .Add(_uiEmitter.SetWorld(_world))
            .Add(new TestUiClickEventSystem(_world))
            .Add(new TestUiDragEventSystem(_world))
            .Add(new TestUiEnterExitEventSystem(_world))
            .Add(new TestUiInputEventSystem(_world))
            .Add(new TestUiScrollViewEventSystem(_world))
#endif
            .Initialize();
#if UNITY_EDITOR
            UnityIntegration.EcsSystemsObserver.Create(_systems);
#endif
        }
Exemple #16
0
        private void Awake()
        {
            Instance = this;
            _systems = new EcsSystems(World);

            _systems
            .Add(new ViewObjectsInitSystem())
            .Add(new CoinSpawningInitSystem())
            .Add(new FindingDirectionSystem())
            .Add(new InputSystem())
            .Add(new MovementSystem())
            .Add(new DamageSystem())
            .Add(new CoinSystem())
            .Add(new GameStateSystem())
            .Add(new UiSystem())
            .OneFrame <CollisionEvent>()
            .OneFrame <GameStateChangedEvent>()
            .Inject(new RaycastService(_rotationPoints))
            .Inject(new CoinSpawningService(_coinObject))
            .InjectUi(_uiEmitter)
            .Init();

#if UNITY_EDITOR
            Leopotam.Ecs.UnityIntegration.EcsWorldObserver.Create(World);
            Leopotam.Ecs.UnityIntegration.EcsSystemsObserver.Create(_systems);
#endif
        }
Exemple #17
0
        private void PrepareUpdateSystems()
        {
            _update
            // register systems
            .Add(new PlayerInitSystem())
            .Add(new InputSystem())
            .Add(new JumpSystem())
            .Add(new SlerpRotateSystem())
            .Add(new AnimatorLandingSystem())
            .Add(new AnimatorWalkingSystem())
            .Add(new StaminaSpendSystem())
            .Add(new StaminaRestorationSystem())
            .Add(new StaminaHideSystem())
            .Add(new TargetSpeedPercentChangeSystem())

            // register one-frame components
            .OneFrame <JumpQueryTag>()
            .OneFrame <LandedTag>()
            .OneFrame <TargetSpeedPercentChangedTag>()

            // inject
            .Inject(_gravityLayer)
            .Inject(_staminaModel)
            .Inject(_healthModel)
            .Inject(_injectData)
            .Inject(_player)
            .Inject(_inputs);
        }
Exemple #18
0
        private void OnEnable()
        {
            _ecsWorld  = new EcsWorld();
            _systems   = new EcsSystems(_ecsWorld);
            _gameState = new GameState();

            _tilesPool = gameObject.GetComponentInChildren <TilesPool>();
            _tilesPool.Prewarm(20, configuration.tileView);

            _audioSource = GetComponent <AudioSource>();

#if UNITY_EDITOR
            Leopotam.Ecs.UnityIntegration.EcsWorldObserver.Create(_ecsWorld);
            Leopotam.Ecs.UnityIntegration.EcsSystemsObserver.Create(_systems);
#endif

            _systems
            .Add(new TempoEmitSystem())
            .Add(new TempoTileSpawnerSystem())
            .Add(new TempoTilesMoveSystem())
            .Add(new TempoHitSystem())

            .Inject(_gameState)
            .Inject(configuration)
            .Inject(_tilesPool)
            .Inject(_audioSource)

            .OneFrame <TempoEvent>()
            .OneFrame <TempoHitEvent>()

            .Init();
        }
        private void Start()
        {
            _world   = new EcsWorld();         // Инициализация окружения _world
            _systems = new EcsSystems(_world); // Инициализация систем окружения _systems

            //Добавление систем к инициализации в окружении
            _systems
            .Add(new GameInitSystem())
            .Add(new EnemyInitSystem())
            .Add(new PlayerInputSystem())
            .Add(new MoveSystem())
            .Add(new CameraSystem())
            .Add(new ShotSystem())
            .Add(new BonusInitSystem())

            //Внедрение зависимостей со сцены во все системы
            //Отлов зависимостей внутри систем => ECSFilter<T>, where T [anyAllowed]Component
            .Inject(playerStartPoint)
            .Inject(weaponController)
            .Inject(startButton)
            .Inject(waypoints)
            .Inject(spawnerContainer)

            /*
             * .Inject(levelSpawners)*/;


            //Инициализация систем
            _systems.Init();
        }
Exemple #20
0
        void Start()
        {
            _world   = new EcsWorld();
            _systems = new EcsSystems(_world);
#if UNITY_EDITOR
            Leopotam.Ecs.UnityIntegration.EcsWorldObserver.Create(_world);
            Leopotam.Ecs.UnityIntegration.EcsSystemsObserver.Create(_systems);
#endif
            var _runtime = new RuntimeData();
            Service <RuntimeData> .Set(_runtime);

            UI _ui = GetOrSetUI(_config);

            Service <EcsWorld> .Set(_world);

            Service <StaticData> .Set(_config);

            Service <SceneData> .Set(_scene);

            _systems
            .Add(new InitializeSystem())
            .Add(new ChangeGameStateSystem())

            .Add(new WinSystem())
            .Add(new LoseSystem())


            .Inject(_runtime)
            .Inject(_config)
            .Inject(_scene)
            .Inject(_ui)
            .Init();
        }
Exemple #21
0
        void Start()
        {
            // void can be switched to IEnumerator for support coroutines.

            _world   = new EcsWorld();
            _systems = new EcsSystems(_world);
#if UNITY_EDITOR
            Leopotam.Ecs.UnityIntegration.EcsWorldObserver.Create(_world);
            Leopotam.Ecs.UnityIntegration.EcsSystemsObserver.Create(_systems);
#endif
            _systems
            // register your systems here, for example:
            .Add(new GameInitSystems())
            .Add(new InputSystem())
            .Add(new MoveObjectSystem())

            .Add(new CreateViewSystem())
            .Add(new MoveViewSystem())

            // register one-frame components (order is important), for example:
            .OneFrame <EcsInput>()
            .OneFrame <UpdatePositionFlag>()

            // inject service instances here (order doesn't important), for example:
            .Inject(GetComponent <IViewService>())
            .Inject(GetComponent <IInputService>())
            .Inject(new Rnd(0))
            .Init();
        }
Exemple #22
0
    void Awake()
    {
        world   = new EcsWorld();
        systems = new EcsSystems(world);

        var random      = new Random();
        var resourceIds = configuration.resourceElementDefinitions.Select(o => o.uid).ToArray();

        dependencyContainer = new DependencyContainer
        {
            Random                  = random,
            Configuration           = configuration,
            ServerStubConfiguration = serverStubConfiguration,
            ResourceIds             = resourceIds,
            Server                  = new ServerStub(serverStubConfiguration, random, resourceIds)
        };

        systems.Add(new InitializeResourcesProcessing(world, dependencyContainer))
        .Add(new UserInputProcessing(world, dependencyContainer))
        .Add(new PlayerMovementProcessing(dependencyContainer))
        .Add(new ResourceItemSpawnProcessing(world, dependencyContainer))
        .Add(new ServerResourceChangedEventProcessing(world, dependencyContainer))
        .Add(new UpdateResourcesProcessing())
        .OneFrame <ResourceAmountChangedEventComponent>()
        .Inject(dependencyContainer)
        .Init();
    }
Exemple #23
0
    void Start()
    {
        _world   = new EcsWorld();
        _systems = new EcsSystems(_world);

#if UNITY_EDITOR
        Leopotam.Ecs.UnityIntegration.EcsWorldObserver.Create(_world);
        Leopotam.Ecs.UnityIntegration.EcsSystemsObserver.Create(_systems);
#endif
        _systems
        .Add(new GameInitSystems())

        .Add(new InputSystem())
        .Add(new UpdatePlayerMoveTimerSystem())
        .Add(new MovePlayerSystem())

        .Add(new CreateViewSystem())
        .Add(new MoveViewSystem())

        .OneFrame <Ecs.Input>()
        .OneFrame <UpdatePositionFlag>()

        .Inject(GetComponent <IViewService>())
        .Inject(GetComponent <IInputService>())
        .Init();
    }
        void Start()
        {
            // void can be switched to IEnumerator for support coroutines.

            _world   = new EcsWorld();
            _systems = new EcsSystems(_world);
#if UNITY_EDITOR
            Leopotam.Ecs.UnityIntegration.EcsWorldObserver.Create(_world);
            Leopotam.Ecs.UnityIntegration.EcsSystemsObserver.Create(_systems);
#endif
            _systems
            // register your systems here, for example:
            .Add(new GameInitSystem())

            .Add(new CarInputSystem())
            .Add(new MoveCarSystem())
            .Add(new DragSystem())
            .Add(new VictimDamaginSystem())
            .Add(new VictimAISystem())

            // register one-frame components (order is important), for example:
            // .OneFrame<TestComponent1> ()
            // .OneFrame<TestComponent2> ()

            // inject service instances here (order doesn't important), for example:
            .Inject(_gameData)
            .Init();
        }
        void Start()
        {
            _world   = new EcsWorld();
            _systems = new EcsSystems(_world);
#if UNITY_EDITOR
            Leopotam.Ecs.UnityIntegration.EcsWorldObserver.Create(_world);
            Leopotam.Ecs.UnityIntegration.EcsSystemsObserver.Create(_systems);
#endif
            _systems
            .Add(new GameInitSystem())
            .Add(new GridViewSystem())
            .Add(new GamePauseSystem())
            .Add(new SnakeViewSystem())
            .Add(new InputSystem())
            .Add(new MoveSystem())
            .Add(new SnakeTailSystem())
            .Add(new FoodSystem())
            .Add(new LevelProgresSystem())
            .Add(new ColorPaletteSystem())
            .Add(new GameOverSystem())
            .Add(new UISystem())
            .Add(new CameraPositionSystem())

            .OneFrame <TailComponent>()
            .OneFrame <LevelProgressEvent>()
            .OneFrame <ColorUpdateComponent>()

            .Inject(new LevelProgress())
            .Inject(Configuration)
            .Inject(SceneData)
            .Inject(UIData)
            .Inject(UIDataStart)
            .Init();
        }
Exemple #26
0
        public void Start()
        {
            var services = CreateAllSharedState(_options);
            var worldCfg = new EcsWorldConfig()
            {
                ComponentsCount = _options.EntitiesMax,
                EntitiesCount   = _options.EntitiesMax,
            };

            _worlds = new EcsWorlds(services);
            _world  = _worlds.Create(cfg: worldCfg);
            _world
            .Register <Actor>()
            .Register <Bullet>()
            .Register <Deleted>()
            .Register <DesiredVelocity>()
            .Register <Position>()
            .Register <Rotation>()
            .Register <Weapon>()
            ;

            _systems = new EcsSystems();
            _systems
            .Add(new InitSystem())
            .Add(new TimeSystem())
            .Add(new ShootSystem())
            .Add(new BulletSystem())
            .Add(new MoveSystem())
            ;

            AddActorTypeSystemsByTypeCount();

            if (_options.IsRendering)
            {
                _systems
                .Add(new ActorViewUpdateSystem())
                .Add(new BulletViewDeleteSystem())
                .Add(new BulletViewUpdateSystem())
                ;
            }

            _systems.Add(new BulletDeleteSystem());

            _worlds.Init();
            _systems.Init(_worlds);
            _world = null;
        }
Exemple #27
0
 public static EcsSystems AddUiSystems(this EcsSystems systems)
 {
     return(systems
            .Add(new GameStateSystem())
            .OneFrame <GameStateSwitchRequest>()
            .Add(new ScoreTableSystem())
            .OneFrame <PlayerScoreChangedEvent>());
 }
Exemple #28
0
 public void Initialize()
 {
     World   = new EcsWorld();
     Systems = new EcsSystems(World);
     Systems.Add <CreatePlayerSystem>().Add <MovementSystem>().Add <MovementPlayerSystem>();
     //Add<RotatePlayerSystem>();
     ;
 }
Exemple #29
0
 public Scene(string title)
 {
     Title          = title;
     Systems        = new EcsSystems(World, "MainEcsSystems");
     RuntimeSystems = new EcsSystems(World, "Runtime Systems");
     Systems
     .Add(new EventSystem(), "Event System")
     .Add(RuntimeSystems, "Runtime Systems");
 }
Exemple #30
0
 public Scene()
 {
     Title          = "Untitled";
     Systems        = new EcsSystems(World, "MainEcsSystems");
     RuntimeSystems = new EcsSystems(World, "Runtime Systems");
     Systems
     .Add(new EventSystem(), "Event System")
     .Add(RuntimeSystems, "Runtime Systems");
 }