Skip to content

Commit

Permalink
Updated to latest EcsRx version 4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
grofit committed Apr 30, 2021
1 parent dc3d185 commit dda6b70
Show file tree
Hide file tree
Showing 60 changed files with 246 additions and 1,163 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,5 @@ sysinfo.txt
# Crashlytics generated file
crashlytics-build.properties


.idea/
Empty file removed .idea/.gitignore
Empty file.
2 changes: 0 additions & 2 deletions .idea/.idea.ecsrx.roguelike2d/.idea/.gitignore

This file was deleted.

928 changes: 0 additions & 928 deletions .idea/.idea.ecsrx.roguelike2d/.idea/contentModel.xml

This file was deleted.

17 changes: 0 additions & 17 deletions .idea/.idea.ecsrx.roguelike2d/.idea/indexLayout.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/.idea.ecsrx.roguelike2d/.idea/modules.xml

This file was deleted.

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/.idea.ecsrx.roguelike2d/.idea/vcs.xml

This file was deleted.

7 changes: 0 additions & 7 deletions .idea/.idea.ecsrx.roguelike2d/riderModule.iml

This file was deleted.

Binary file modified Assets/EcsRx/EcsRx.Infrastructure.dll
Binary file not shown.
Binary file modified Assets/EcsRx/EcsRx.MicroRx.dll
Binary file not shown.
Binary file modified Assets/EcsRx/EcsRx.Plugins.Batching.dll
Binary file not shown.
Binary file modified Assets/EcsRx/EcsRx.Plugins.Computeds.dll
Binary file not shown.
Binary file modified Assets/EcsRx/EcsRx.Plugins.ReactiveSystems.dll
Binary file not shown.
Binary file modified Assets/EcsRx/EcsRx.Plugins.Views.dll
Binary file not shown.
Binary file modified Assets/EcsRx/EcsRx.dll
Binary file not shown.
Binary file added Assets/EcsRx/SystemsRx.Infrastructure.dll
Binary file not shown.
33 changes: 33 additions & 0 deletions Assets/EcsRx/SystemsRx.Infrastructure.dll.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Assets/EcsRx/SystemsRx.dll
Binary file not shown.
33 changes: 33 additions & 0 deletions Assets/EcsRx/SystemsRx.dll.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Assets/EcsRx/Unity/Extensions/ISystemExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using SystemsRx.Systems;
using EcsRx.Systems;
using UniRx;

Expand Down
6 changes: 3 additions & 3 deletions Assets/EcsRx/Unity/Modules/UnityOverrideModule.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using EcsRx.Infrastructure.Dependencies;
using EcsRx.Infrastructure.Extensions;
using EcsRx.Scheduling;
using SystemsRx.Infrastructure.Dependencies;
using SystemsRx.Infrastructure.Extensions;
using SystemsRx.Scheduling;
using EcsRx.Unity.Scheduling;

namespace EcsRx.Unity.Modules
Expand Down
3 changes: 2 additions & 1 deletion Assets/EcsRx/Unity/MonoBehaviours/InjectableMonoBehaviour.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using EcsRx.Events;
using SystemsRx.Events;
using EcsRx.Events;
using EcsRx.Unity.Dependencies;
using UnityEngine;
using Zenject;
Expand Down
2 changes: 1 addition & 1 deletion Assets/EcsRx/Unity/Scheduling/UnityUpdateScheduler.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System;
using EcsRx.Scheduling;
using SystemsRx.Scheduling;
using UniRx;
using UnityEngine;

Expand Down
5 changes: 2 additions & 3 deletions Assets/EcsRx/Unity/Systems/DynamicViewResolverSystem.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
using EcsRx.Unity.Dependencies;
using EcsRx.Collections;
using SystemsRx.Events;
using EcsRx.Unity.Dependencies;
using EcsRx.Collections.Database;
using EcsRx.Entities;
using EcsRx.Events;
using EcsRx.Extensions;
using EcsRx.Groups;
using EcsRx.Plugins.ReactiveSystems.Systems;
Expand Down
3 changes: 1 addition & 2 deletions Assets/EcsRx/Unity/Systems/PooledPrefabViewResolverSystem.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using EcsRx.Collections;
using SystemsRx.Events;
using EcsRx.Collections.Database;
using EcsRx.Entities;
using EcsRx.Events;
using EcsRx.Extensions;
using EcsRx.Plugins.Views.Pooling;
using EcsRx.Plugins.Views.Systems;
Expand Down
3 changes: 1 addition & 2 deletions Assets/EcsRx/Unity/Systems/PrefabViewResolverSystem.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using EcsRx.Collections;
using SystemsRx.Events;
using EcsRx.Collections.Database;
using EcsRx.Entities;
using EcsRx.Events;
using EcsRx.Extensions;
using EcsRx.Unity.Dependencies;
using EcsRx.Unity.Handlers;
Expand Down
22 changes: 12 additions & 10 deletions Assets/EcsRx/Unity/UnityEcsRxApplicationBehaviour.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
using System.Collections.Generic;
using System.Linq;
using SystemsRx.Events;
using SystemsRx.Executor;
using SystemsRx.Extensions;
using SystemsRx.Infrastructure.Dependencies;
using SystemsRx.Infrastructure.Extensions;
using SystemsRx.Infrastructure.Modules;
using SystemsRx.Infrastructure.Plugins;
using SystemsRx.Systems;
using EcsRx.Collections;
using EcsRx.Collections.Database;
using EcsRx.Events;
using EcsRx.Executor;
using EcsRx.Extensions;
using EcsRx.Infrastructure;
using EcsRx.Infrastructure.Dependencies;
using EcsRx.Infrastructure.Extensions;
using EcsRx.Infrastructure.Modules;
using EcsRx.Infrastructure.Plugins;
using EcsRx.Plugins.Batching;
using EcsRx.Plugins.Computeds;
using EcsRx.Plugins.ReactiveSystems;
using EcsRx.Plugins.Views;
using EcsRx.Systems;
using EcsRx.Unity.Modules;
using UnityEngine;

Expand All @@ -29,9 +30,9 @@ public abstract class UnityEcsRxApplicationBehaviour : MonoBehaviour, IEcsRxAppl
public IEventSystem EventSystem { get; private set; }
public IEntityDatabase EntityDatabase { get; private set; }
public IObservableGroupManager ObservableGroupManager { get; private set; }
public IEnumerable<IEcsRxPlugin> Plugins => _plugins;
public IEnumerable<ISystemsRxPlugin> Plugins => _plugins;

protected List<IEcsRxPlugin> _plugins { get; } = new List<IEcsRxPlugin>();
protected List<ISystemsRxPlugin> _plugins { get; } = new List<ISystemsRxPlugin>();

protected abstract void ApplicationStarted();

Expand Down Expand Up @@ -72,6 +73,7 @@ protected virtual void LoadPlugins()
protected virtual void LoadModules()
{
Container.LoadModule<FrameworkModule>();
Container.LoadModule<EcsRxInfrastructureModule>();
Container.LoadModule<UnityOverrideModule>();
}

Expand Down Expand Up @@ -117,7 +119,7 @@ protected virtual void StartPluginSystems()
.ForEachRun(x => SystemExecutor.AddSystem(x));
}

protected void RegisterPlugin(IEcsRxPlugin plugin)
protected void RegisterPlugin(ISystemsRxPlugin plugin)
{ _plugins.Add(plugin); }
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using EcsRx.Executor;
using SystemsRx.Executor;
using UnityEngine;
using Zenject;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Collections;
using System.Linq;
using EcsRx.Infrastructure.Dependencies;
using SystemsRx.Infrastructure.Dependencies;
using EcsRx.Unity.Dependencies;
using EcsRx.Zenject.Extensions;
using UnityEngine;
Expand Down
17 changes: 0 additions & 17 deletions Assets/EcsRx/Zenject/EcsRxApplicationBehaviour.cs
Original file line number Diff line number Diff line change
@@ -1,23 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using EcsRx.Collections;
using EcsRx.Collections.Database;
using EcsRx.Events;
using EcsRx.Executor;
using EcsRx.Extensions;
using EcsRx.Infrastructure;
using EcsRx.Infrastructure.Dependencies;
using EcsRx.Infrastructure.Extensions;
using EcsRx.Infrastructure.Modules;
using EcsRx.Infrastructure.Plugins;
using EcsRx.Plugins.Batching;
using EcsRx.Plugins.Computeds;
using EcsRx.Plugins.ReactiveSystems;
using EcsRx.Plugins.Views;
using EcsRx.Systems;
using EcsRx.Unity;
using EcsRx.Unity.Modules;
using EcsRx.Zenject.Dependencies;
using UnityEngine;
using Zenject;
Expand Down
2 changes: 1 addition & 1 deletion Assets/EcsRx/Zenject/Helpers/BindSystemsInNamespace.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using EcsRx.Systems;
using SystemsRx.Systems;
using ModestTree;
using Zenject;

Expand Down
4 changes: 1 addition & 3 deletions Assets/Game/Application.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
using System;
using EcsRx.Collections;
using SystemsRx.Infrastructure.Extensions;
using EcsRx.Collections.Entity;
using EcsRx.Extensions;
using EcsRx.Unity.Extensions;
using EcsRx.Infrastructure.Extensions;
using EcsRx.Plugins.Views.Components;
using EcsRx.Zenject;
using Game.Blueprints;
Expand Down
4 changes: 2 additions & 2 deletions Assets/Game/Modules/ComputedModule.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using EcsRx.Infrastructure.Dependencies;
using SystemsRx.Infrastructure.Dependencies;
using SystemsRx.Infrastructure.Extensions;
using EcsRx.Infrastructure.Extensions;
using Game.Components;
using Game.Computeds;
using Game.Configuration;

namespace Game.Installers
{
Expand Down
5 changes: 2 additions & 3 deletions Assets/Game/Modules/GameModule.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using EcsRx.Infrastructure.Dependencies;
using EcsRx.Infrastructure.Extensions;

using SystemsRx.Infrastructure.Dependencies;
using SystemsRx.Infrastructure.Extensions;
using Game.Configuration;

namespace Game.Installers
Expand Down
5 changes: 2 additions & 3 deletions Assets/Game/Modules/SceneCollectionsModule.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using EcsRx.Infrastructure.Dependencies;
using EcsRx.Infrastructure.Extensions;
using SystemsRx.Infrastructure.Dependencies;
using SystemsRx.Infrastructure.Extensions;
using Game.SceneCollections;
using Zenject;

namespace Game.Installers
{
Expand Down
10 changes: 4 additions & 6 deletions Assets/Game/Systems/EnemyAttackedSystem.cs
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
using EcsRx.Collections;
using SystemsRx.Systems.Conventional;
using EcsRx.Collections.Database;
using EcsRx.Events;
using EcsRx.Extensions;
using EcsRx.Plugins.ReactiveSystems.Custom;
using EcsRx.Unity.Extensions;
using Game.Components;
using Game.Events;
using UnityEngine;

namespace Game.Systems
{
public class EnemyAttackedSystem : EventReactionSystem<EnemyHitEvent>
public class EnemyAttackedSystem : IReactToEventSystem<EnemyHitEvent>
{
private readonly IEntityDatabase _entityDatabase;

public EnemyAttackedSystem(IEventSystem eventSystem, IEntityDatabase entityDatabase) : base(eventSystem)
public EnemyAttackedSystem(IEntityDatabase entityDatabase)
{ _entityDatabase = entityDatabase; }

public override void EventTriggered(EnemyHitEvent eventData)
public void Process(EnemyHitEvent eventData)
{
var enemyComponent = eventData.Enemy.GetComponent<EnemyComponent>();
enemyComponent.Health.Value--;
Expand Down
10 changes: 4 additions & 6 deletions Assets/Game/Systems/EnemyMovementSystem.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using EcsRx.Events;
using SystemsRx.Systems.Conventional;
using EcsRx.Extensions;
using EcsRx.Plugins.ReactiveSystems.Custom;
using EcsRx.Unity.Extensions;
using Game.Components;
using Game.Computeds;
Expand All @@ -9,17 +8,16 @@

namespace Game.Systems
{
public class EnemyMovementSystem : EventReactionSystem<EnemyTurnEvent>
public class EnemyMovementSystem : IReactToEventSystem<EnemyTurnEvent>
{
private readonly IComputedPlayerPosition _computedPlayerPosition;

public EnemyMovementSystem(IEventSystem eventSystem, IComputedPlayerPosition computedPlayerPosition)
: base(eventSystem)
public EnemyMovementSystem(IComputedPlayerPosition computedPlayerPosition)
{
_computedPlayerPosition = computedPlayerPosition;
}

public override void EventTriggered(EnemyTurnEvent eventData)
public void Process(EnemyTurnEvent eventData)
{
var movementComponent = eventData.Enemy.GetComponent<MovementComponent>();
if(movementComponent.Movement.Value != Vector2.zero) { return; }
Expand Down
Loading

0 comments on commit dda6b70

Please sign in to comment.