From e34b64d888835c929f349fa51df195c81ba7144c Mon Sep 17 00:00:00 2001 From: andreakarasho Date: Fri, 29 Mar 2024 23:23:33 +0100 Subject: [PATCH] resource exists --- src/System.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/System.cs b/src/System.cs index 3b34cbe..6d16695 100644 --- a/src/System.cs +++ b/src/System.cs @@ -116,6 +116,8 @@ internal Scheduler AddSystemParam(T param) where T : ISystemParam return this; } + + internal bool ResourceExists() => _resources.ContainsKey(typeof(T)); } public interface IPlugin @@ -232,9 +234,10 @@ void ISystemParam.New(object arguments) } public void AddResource(T resource) - { - _scheduler?.AddResource(resource); - } + => _scheduler?.AddResource(resource); + + public bool ResourceExists() + => _scheduler.ResourceExists(); } public sealed class Res : ISystemParam