From c24052cfa71d8ebc56710fd052be230ada2a5d43 Mon Sep 17 00:00:00 2001 From: copygirl Date: Fri, 20 Jan 2023 19:01:37 +0100 Subject: [PATCH] Move EntityNotFoundException out of World class --- src/gaemstone.ECS/EntityPath.cs | 2 +- src/gaemstone.ECS/World+Lookup.cs | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/gaemstone.ECS/EntityPath.cs b/src/gaemstone.ECS/EntityPath.cs index bcbd57d..1de24a3 100644 --- a/src/gaemstone.ECS/EntityPath.cs +++ b/src/gaemstone.ECS/EntityPath.cs @@ -149,7 +149,7 @@ public class EntityPath if (!throwOnNotFound) return Entity.None; var startStr = EntityRef.CreateOrNull(world, start)?.GetFullPath().ToString() ?? start.ToString(); - throw new World.EntityNotFoundException( + throw new EntityNotFoundException( start.IsNone ? $"Entity at '{path}' not found" : (start == parent) ? $"Child entity of '{startStr}' at '{path}' not found" : $"Entity at scope '{startStr}' at '{path}' not found"); diff --git a/src/gaemstone.ECS/World+Lookup.cs b/src/gaemstone.ECS/World+Lookup.cs index 5b2952a..1086aea 100644 --- a/src/gaemstone.ECS/World+Lookup.cs +++ b/src/gaemstone.ECS/World+Lookup.cs @@ -32,8 +32,7 @@ public unsafe partial class World public EntityRef LookupBySymbolOrThrow(string symbol) => LookupBySymbol(symbol) ?? throw new EntityNotFoundException( $"Entity with symbol '{symbol}' not found"); - - - public class EntityNotFoundException : Exception - { public EntityNotFoundException(string message) : base(message) { } } } + +public class EntityNotFoundException : Exception + { public EntityNotFoundException(string message) : base(message) { } }