From 23580f381d4c3f38416325b889c14862d4b00406 Mon Sep 17 00:00:00 2001 From: sebas77 Date: Mon, 12 Mar 2018 18:44:53 +0000 Subject: [PATCH] fixed a serious bug that sneaked in because I trust too much the refactoring tools that this time failed miserably --- .../TypeSafeFasterListForECS.cs | 2 +- Svelto.ECS/EnginesRootEntities.cs | 2 +- Svelto.ECS/EntityDescriptor.cs | 2 +- Svelto.ECS/MultiEntityViewsEngine.cs | 25 ++++++++----------- Svelto.ECS/Sequencer.cs | 2 +- 5 files changed, 14 insertions(+), 19 deletions(-) diff --git a/Svelto.ECS/DataStructures/TypeSafeFasterListForECS.cs b/Svelto.ECS/DataStructures/TypeSafeFasterListForECS.cs index 8175857..0fc8437 100644 --- a/Svelto.ECS/DataStructures/TypeSafeFasterListForECS.cs +++ b/Svelto.ECS/DataStructures/TypeSafeFasterListForECS.cs @@ -1,7 +1,7 @@ using System; using System.Collections; using System.Collections.Generic; -using DesignByContract; +using DBC; using Svelto.DataStructures; namespace Svelto.ECS.Internal diff --git a/Svelto.ECS/EnginesRootEntities.cs b/Svelto.ECS/EnginesRootEntities.cs index 0a50abf..0b11704 100644 --- a/Svelto.ECS/EnginesRootEntities.cs +++ b/Svelto.ECS/EnginesRootEntities.cs @@ -1,6 +1,6 @@ using System; using System.Collections.Generic; -using DesignByContract; +using DBC; using Svelto.DataStructures; using Svelto.ECS.Internal; diff --git a/Svelto.ECS/EntityDescriptor.cs b/Svelto.ECS/EntityDescriptor.cs index 130d543..1c71dce 100644 --- a/Svelto.ECS/EntityDescriptor.cs +++ b/Svelto.ECS/EntityDescriptor.cs @@ -1,5 +1,5 @@ using System; -using DesignByContract; +using DBC; using Svelto.DataStructures; using Svelto.ECS.Internal; diff --git a/Svelto.ECS/MultiEntityViewsEngine.cs b/Svelto.ECS/MultiEntityViewsEngine.cs index 7ac67e2..3810f10 100644 --- a/Svelto.ECS/MultiEntityViewsEngine.cs +++ b/Svelto.ECS/MultiEntityViewsEngine.cs @@ -29,9 +29,8 @@ namespace Svelto.ECS public override void Add(IEntityView entityView) { - var castedEntityView = (U) entityView; - if (castedEntityView != null) - Add(castedEntityView); + if (entityView is U) + Add((U) entityView); else base.Add(entityView); } @@ -53,18 +52,16 @@ namespace Svelto.ECS public override void Add(IEntityView entityView) { - var castedEntityView = (V) entityView; - if (castedEntityView != null) - Add(castedEntityView); + if (entityView is V) + Add((V) entityView); else base.Add(entityView); } public override void Remove(IEntityView entityView) { - var castedEntityView = (V) entityView; - if (castedEntityView != null) - Remove(castedEntityView); + if (entityView is V) + Remove((V) entityView); else base.Remove(entityView); } @@ -83,18 +80,16 @@ namespace Svelto.ECS public override void Add(IEntityView entityView) { - var castedEntityView = (W) entityView; - if (castedEntityView != null) - Add(castedEntityView); + if (entityView is W) + Add((W) entityView); else base.Add(entityView); } public override void Remove(IEntityView entityView) { - var castedEntityView = (W) entityView; - if (castedEntityView != null) - Remove(castedEntityView); + if (entityView is W) + Remove((W) entityView); else base.Remove(entityView); } diff --git a/Svelto.ECS/Sequencer.cs b/Svelto.ECS/Sequencer.cs index 76bce9a..199d089 100644 --- a/Svelto.ECS/Sequencer.cs +++ b/Svelto.ECS/Sequencer.cs @@ -42,7 +42,7 @@ namespace Svelto.ECS public void Next(IEngine engine, ref T param) { - Next(engine, ref param, Condition.Always); + Next(engine, ref param, Condition.Always); } public void Next(IEngine engine, ref T param, int condition)