Move EntityNotFoundException out of World class

wip/no-type-lookup
copygirl 2 years ago
parent dc776ace1f
commit c24052cfa7
  1. 2
      src/gaemstone.ECS/EntityPath.cs
  2. 3
      src/gaemstone.ECS/World+Lookup.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");

@ -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) { } }
}

Loading…
Cancel
Save