- Refactor D3D12 backend and RenderGraph module - Update graphics RHI and core rendering components - Add Random.hlsl shader include - Regenerate API documentation and update user guides
1687 lines
49 KiB
HTML
1687 lines
49 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Class EntityManager | GhostEngine </title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta name="title" content="Class EntityManager | GhostEngine ">
|
|
|
|
<meta name="description" content="A manager for creating, destroying, and managing entities and their components.">
|
|
<link rel="icon" href="../favicon.ico">
|
|
<link rel="stylesheet" href="../public/docfx.min.css">
|
|
<link rel="stylesheet" href="../public/main.css">
|
|
<meta name="docfx:navrel" content="../toc.html">
|
|
<meta name="docfx:tocrel" content="toc.html">
|
|
|
|
<meta name="docfx:rel" content="../">
|
|
|
|
|
|
|
|
<meta name="loc:inThisArticle" content="In this article">
|
|
<meta name="loc:searchResultsCount" content="{count} results for "{query}"">
|
|
<meta name="loc:searchNoResults" content="No results for "{query}"">
|
|
<meta name="loc:tocFilter" content="Filter by title">
|
|
<meta name="loc:nextArticle" content="Next">
|
|
<meta name="loc:prevArticle" content="Previous">
|
|
<meta name="loc:themeLight" content="Light">
|
|
<meta name="loc:themeDark" content="Dark">
|
|
<meta name="loc:themeAuto" content="Auto">
|
|
<meta name="loc:changeTheme" content="Change theme">
|
|
<meta name="loc:copy" content="Copy">
|
|
<meta name="loc:downloadPdf" content="Download PDF">
|
|
|
|
<script type="module" src="./../public/docfx.min.js"></script>
|
|
|
|
<script>
|
|
const theme = localStorage.getItem('theme') || 'auto'
|
|
document.documentElement.setAttribute('data-bs-theme', theme === 'auto' ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') : theme)
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body class="tex2jax_ignore" data-layout="" data-yaml-mime="ManagedReference">
|
|
<header class="bg-body border-bottom">
|
|
<nav id="autocollapse" class="navbar navbar-expand-md" role="navigation">
|
|
<div class="container-xxl flex-nowrap">
|
|
<a class="navbar-brand" href="../index.html">
|
|
<img id="logo" class="svg" src="../logo.svg" alt="GhostEngine">
|
|
GhostEngine
|
|
</a>
|
|
<button class="btn btn-lg d-md-none border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navpanel" aria-controls="navpanel" aria-expanded="false" aria-label="Toggle navigation">
|
|
<i class="bi bi-three-dots"></i>
|
|
</button>
|
|
<div class="collapse navbar-collapse" id="navpanel">
|
|
<div id="navbar">
|
|
<form class="search" role="search" id="search">
|
|
<i class="bi bi-search"></i>
|
|
<input class="form-control" id="search-query" type="search" disabled placeholder="Search" autocomplete="off" aria-label="Search">
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
</header>
|
|
|
|
<main class="container-xxl">
|
|
<div class="toc-offcanvas">
|
|
<div class="offcanvas-md offcanvas-start" tabindex="-1" id="tocOffcanvas" aria-labelledby="tocOffcanvasLabel">
|
|
<div class="offcanvas-header">
|
|
<h5 class="offcanvas-title" id="tocOffcanvasLabel">Table of Contents</h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" data-bs-target="#tocOffcanvas" aria-label="Close"></button>
|
|
</div>
|
|
<div class="offcanvas-body">
|
|
<nav class="toc" id="toc"></nav>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="content">
|
|
<div class="actionbar">
|
|
<button class="btn btn-lg border-0 d-md-none" type="button" data-bs-toggle="offcanvas" data-bs-target="#tocOffcanvas" aria-controls="tocOffcanvas" aria-expanded="false" aria-label="Show table of contents">
|
|
<i class="bi bi-list"></i>
|
|
</button>
|
|
|
|
<nav id="breadcrumb"></nav>
|
|
</div>
|
|
|
|
<article data-uid="Ghost.Entities.EntityManager">
|
|
|
|
|
|
|
|
<h1 id="Ghost_Entities_EntityManager" data-uid="Ghost.Entities.EntityManager" class="text-break">
|
|
Class EntityManager
|
|
</h1>
|
|
|
|
<div class="facts text-secondary">
|
|
<dl><dt>Namespace</dt><dd><a class="xref" href="Ghost.html">Ghost</a>.<a class="xref" href="Ghost.Entities.html">Entities</a></dd></dl>
|
|
<dl><dt>Assembly</dt><dd>Ghost.Entities.dll</dd></dl>
|
|
</div>
|
|
|
|
<div class="markdown summary"><p>A manager for creating, destroying, and managing entities and their components.</p>
|
|
</div>
|
|
<div class="markdown conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public class EntityManager : IDisposable</code></pre>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<dl class="typelist inheritance">
|
|
<dt>Inheritance</dt>
|
|
<dd>
|
|
<div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
|
|
<div><span class="xref">EntityManager</span></div>
|
|
</dd>
|
|
</dl>
|
|
|
|
<dl class="typelist implements">
|
|
<dt>Implements</dt>
|
|
<dd>
|
|
<div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.idisposable">IDisposable</a></div>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
<dl class="typelist inheritedMembers">
|
|
<dt>Inherited Members</dt>
|
|
<dd>
|
|
<div>
|
|
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object)</a>
|
|
</div>
|
|
<div>
|
|
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object, object)</a>
|
|
</div>
|
|
<div>
|
|
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a>
|
|
</div>
|
|
<div>
|
|
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>
|
|
</div>
|
|
<div>
|
|
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone">object.MemberwiseClone()</a>
|
|
</div>
|
|
<div>
|
|
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object, object)</a>
|
|
</div>
|
|
<div>
|
|
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>
|
|
</div>
|
|
</dd></dl>
|
|
|
|
|
|
|
|
|
|
<h2 id="Ghost_Entities_EntityManager_remarks">Remarks</h2>
|
|
<div class="markdown level0 remarks"><p>All methods in this class are not thread-safe and all of them will cause structural changes if not mentioned otherwise.
|
|
Use <a class="xref" href="Ghost.Entities.EntityCommandBuffer.html">EntityCommandBuffer</a> to defer structural changes to a safe point.
|
|
Use <a class="xref" href="Ghost.Entities.World.html#Ghost_Entities_World_GetThreadLocalEntityCommandBuffer_System_Int32_">GetThreadLocalEntityCommandBuffer(int)</a> to get a thread-local command buffer for multithreaded scenarios.</p>
|
|
</div>
|
|
|
|
|
|
<h2 class="section" id="properties">Properties
|
|
</h2>
|
|
|
|
|
|
<a id="Ghost_Entities_EntityManager_World_" data-uid="Ghost.Entities.EntityManager.World*"></a>
|
|
|
|
<h3 id="Ghost_Entities_EntityManager_World" data-uid="Ghost.Entities.EntityManager.World">
|
|
World
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"></div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public World World { get; }</code></pre>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<h4 class="section">Property Value</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="Ghost.Entities.World.html">World</a></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h2 class="section" id="methods">Methods
|
|
</h2>
|
|
|
|
|
|
<a id="Ghost_Entities_EntityManager_AddComponent_" data-uid="Ghost.Entities.EntityManager.AddComponent*"></a>
|
|
|
|
<h3 id="Ghost_Entities_EntityManager_AddComponent_Ghost_Entities_Entity_Ghost_Core_Identifier_Ghost_Entities_IComponent__System_Void__" data-uid="Ghost.Entities.EntityManager.AddComponent(Ghost.Entities.Entity,Ghost.Core.Identifier{Ghost.Entities.IComponent},System.Void*)">
|
|
AddComponent(Entity, Identifier<IComponent>, void*)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Add a component to the specified entity.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public Error AddComponent(Entity entity, Identifier<IComponent> componentID, void* pComponent)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>entity</code> <a class="xref" href="Ghost.Entities.Entity.html">Entity</a></dt>
|
|
<dd><p>The entity to add the component to.</p>
|
|
</dd>
|
|
<dt><code>componentID</code> <span class="xref">Identifier</span><<a class="xref" href="Ghost.Entities.IComponent.html">IComponent</a>></dt>
|
|
<dd><p>The component space ID to add.</p>
|
|
</dd>
|
|
<dt><code>pComponent</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.void">void</a>*</dt>
|
|
<dd><p>Pointer to the component data.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><span class="xref">Error</span></dt>
|
|
<dd><p>The result status of the operation.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Ghost_Entities_EntityManager_AddComponent_" data-uid="Ghost.Entities.EntityManager.AddComponent*"></a>
|
|
|
|
<h3 id="Ghost_Entities_EntityManager_AddComponent__1_Ghost_Entities_Entity___0_" data-uid="Ghost.Entities.EntityManager.AddComponent``1(Ghost.Entities.Entity,``0)">
|
|
AddComponent<T>(Entity, T)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Add a component to the specified entity.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public Error AddComponent<T>(Entity entity, T component = default) where T : unmanaged, IComponent</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>entity</code> <a class="xref" href="Ghost.Entities.Entity.html">Entity</a></dt>
|
|
<dd><p>The entity to add the component to.</p>
|
|
</dd>
|
|
<dt><code>component</code> <span class="xref">T</span></dt>
|
|
<dd><p>The component data.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><span class="xref">Error</span></dt>
|
|
<dd><p>The result status of the operation.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Type Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>T</code></dt>
|
|
<dd><p>The component space.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Ghost_Entities_EntityManager_AddScriptComponent_" data-uid="Ghost.Entities.EntityManager.AddScriptComponent*"></a>
|
|
|
|
<h3 id="Ghost_Entities_EntityManager_AddScriptComponent__1_Ghost_Entities_Entity_" data-uid="Ghost.Entities.EntityManager.AddScriptComponent``1(Ghost.Entities.Entity)">
|
|
AddScriptComponent<T>(Entity)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Adds a ScriptComponent of space T to the given Entity.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public void AddScriptComponent<T>(Entity entity) where T : ScriptComponent, new()</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>entity</code> <a class="xref" href="Ghost.Entities.Entity.html">Entity</a></dt>
|
|
<dd><p>The Entity to add the ScriptComponent to.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
<h4 class="section">Type Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>T</code></dt>
|
|
<dd><p>The space of ScriptComponent to add.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Ghost_Entities_EntityManager_AddScriptComponent_" data-uid="Ghost.Entities.EntityManager.AddScriptComponent*"></a>
|
|
|
|
<h3 id="Ghost_Entities_EntityManager_AddScriptComponent__1_Ghost_Entities_ManagedEntity_Ghost_Entities_Entity_" data-uid="Ghost.Entities.EntityManager.AddScriptComponent``1(Ghost.Entities.ManagedEntity,Ghost.Entities.Entity)">
|
|
AddScriptComponent<T>(ManagedEntity, Entity)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"></div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public void AddScriptComponent<T>(ManagedEntity managedEntity, Entity entity) where T : ScriptComponent, new()</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>managedEntity</code> <a class="xref" href="Ghost.Entities.ManagedEntity.html">ManagedEntity</a></dt>
|
|
<dd></dd>
|
|
<dt><code>entity</code> <a class="xref" href="Ghost.Entities.Entity.html">Entity</a></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
|
|
<h4 class="section">Type Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>T</code></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Ghost_Entities_EntityManager_CreateEntities_" data-uid="Ghost.Entities.EntityManager.CreateEntities*"></a>
|
|
|
|
<h3 id="Ghost_Entities_EntityManager_CreateEntities_System_Int32_" data-uid="Ghost.Entities.EntityManager.CreateEntities(System.Int32)">
|
|
CreateEntities(int)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Create multiple entities with no components.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public void CreateEntities(int count)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>count</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
|
|
<dd><p>The number of entities to create.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Ghost_Entities_EntityManager_CreateEntities_" data-uid="Ghost.Entities.EntityManager.CreateEntities*"></a>
|
|
|
|
<h3 id="Ghost_Entities_EntityManager_CreateEntities_System_Int32_Ghost_Entities_ComponentSet_" data-uid="Ghost.Entities.EntityManager.CreateEntities(System.Int32,Ghost.Entities.ComponentSet)">
|
|
CreateEntities(int, ComponentSet)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Create multiple entities with specified components.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public void CreateEntities(int count, ComponentSet set)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>count</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
|
|
<dd><p>The number of entities to create.</p>
|
|
</dd>
|
|
<dt><code>set</code> <a class="xref" href="Ghost.Entities.ComponentSet.html">ComponentSet</a></dt>
|
|
<dd><p>A set of component space IDs to add to the entities.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Ghost_Entities_EntityManager_CreateEntities_" data-uid="Ghost.Entities.EntityManager.CreateEntities*"></a>
|
|
|
|
<h3 id="Ghost_Entities_EntityManager_CreateEntities_System_Span_Ghost_Entities_Entity__" data-uid="Ghost.Entities.EntityManager.CreateEntities(System.Span{Ghost.Entities.Entity})">
|
|
CreateEntities(Span<Entity>)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Create multiple entities with no components.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public void CreateEntities(Span<Entity> entities)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>entities</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.span-1">Span</a><<a class="xref" href="Ghost.Entities.Entity.html">Entity</a>></dt>
|
|
<dd><p>The span to store the created entities.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Ghost_Entities_EntityManager_CreateEntities_" data-uid="Ghost.Entities.EntityManager.CreateEntities*"></a>
|
|
|
|
<h3 id="Ghost_Entities_EntityManager_CreateEntities_System_Span_Ghost_Entities_Entity__Ghost_Entities_ComponentSet_" data-uid="Ghost.Entities.EntityManager.CreateEntities(System.Span{Ghost.Entities.Entity},Ghost.Entities.ComponentSet)">
|
|
CreateEntities(Span<Entity>, ComponentSet)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Create multiple entities with specified components.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public void CreateEntities(Span<Entity> entities, ComponentSet set)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>entities</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.span-1">Span</a><<a class="xref" href="Ghost.Entities.Entity.html">Entity</a>></dt>
|
|
<dd><p>The span to store the created entities.</p>
|
|
</dd>
|
|
<dt><code>set</code> <a class="xref" href="Ghost.Entities.ComponentSet.html">ComponentSet</a></dt>
|
|
<dd><p>A set of component space IDs to add to the entities.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Ghost_Entities_EntityManager_CreateEntity_" data-uid="Ghost.Entities.EntityManager.CreateEntity*"></a>
|
|
|
|
<h3 id="Ghost_Entities_EntityManager_CreateEntity" data-uid="Ghost.Entities.EntityManager.CreateEntity">
|
|
CreateEntity()
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Create an entity with no components.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public Entity CreateEntity()</code></pre>
|
|
</div>
|
|
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="Ghost.Entities.Entity.html">Entity</a></dt>
|
|
<dd><p>The created entity.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Ghost_Entities_EntityManager_CreateEntity_" data-uid="Ghost.Entities.EntityManager.CreateEntity*"></a>
|
|
|
|
<h3 id="Ghost_Entities_EntityManager_CreateEntity_Ghost_Entities_ComponentSet_" data-uid="Ghost.Entities.EntityManager.CreateEntity(Ghost.Entities.ComponentSet)">
|
|
CreateEntity(ComponentSet)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Create an entity with specified components.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public Entity CreateEntity(ComponentSet set)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>set</code> <a class="xref" href="Ghost.Entities.ComponentSet.html">ComponentSet</a></dt>
|
|
<dd><p>A set of component space IDs to add to the entities.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="Ghost.Entities.Entity.html">Entity</a></dt>
|
|
<dd><p>The created entity.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Ghost_Entities_EntityManager_CreateManagedEntity_" data-uid="Ghost.Entities.EntityManager.CreateManagedEntity*"></a>
|
|
|
|
<h3 id="Ghost_Entities_EntityManager_CreateManagedEntity" data-uid="Ghost.Entities.EntityManager.CreateManagedEntity">
|
|
CreateManagedEntity()
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Creates a new ManagedEntity.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public ManagedEntity CreateManagedEntity()</code></pre>
|
|
</div>
|
|
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="Ghost.Entities.ManagedEntity.html">ManagedEntity</a></dt>
|
|
<dd><p>The created ManagedEntity.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h4 class="section" id="Ghost_Entities_EntityManager_CreateManagedEntity_remarks">Remarks</h4>
|
|
<div class="markdown level1 remarks"><p>You must call this if you add <a class="xref" href="Ghost.Entities.ManagedEntityRef.html">ManagedEntityRef</a> manually to an entity.
|
|
Otherwise, use <a class="xref" href="Ghost.Entities.EntityManager.html#Ghost_Entities_EntityManager_CreateManagedEntity_Ghost_Entities_Entity_">CreateManagedEntity(Entity)</a>.</p>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<a id="Ghost_Entities_EntityManager_CreateManagedEntity_" data-uid="Ghost.Entities.EntityManager.CreateManagedEntity*"></a>
|
|
|
|
<h3 id="Ghost_Entities_EntityManager_CreateManagedEntity_Ghost_Entities_Entity_" data-uid="Ghost.Entities.EntityManager.CreateManagedEntity(Ghost.Entities.Entity)">
|
|
CreateManagedEntity(Entity)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Creates a new ManagedEntity and associates it with the given Entity.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public ManagedEntity CreateManagedEntity(Entity entity)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>entity</code> <a class="xref" href="Ghost.Entities.Entity.html">Entity</a></dt>
|
|
<dd><p>The Entity to associate with the ManagedEntity.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="Ghost.Entities.ManagedEntity.html">ManagedEntity</a></dt>
|
|
<dd><p>The created ManagedEntity.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Ghost_Entities_EntityManager_CreateSingleton_" data-uid="Ghost.Entities.EntityManager.CreateSingleton*"></a>
|
|
|
|
<h3 id="Ghost_Entities_EntityManager_CreateSingleton_Ghost_Core_Identifier_Ghost_Entities_IComponent__System_Void__" data-uid="Ghost.Entities.EntityManager.CreateSingleton(Ghost.Core.Identifier{Ghost.Entities.IComponent},System.Void*)">
|
|
CreateSingleton(Identifier<IComponent>, void*)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Create a singleton entity with the specified component.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public Error CreateSingleton(Identifier<IComponent> componentID, void* pComponent)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>componentID</code> <span class="xref">Identifier</span><<a class="xref" href="Ghost.Entities.IComponent.html">IComponent</a>></dt>
|
|
<dd><p>The component space ID of the singleton.</p>
|
|
</dd>
|
|
<dt><code>pComponent</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.void">void</a>*</dt>
|
|
<dd><p>Pointer to the component data.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><span class="xref">Error</span></dt>
|
|
<dd><p>The result status of the operation.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Ghost_Entities_EntityManager_CreateSingleton_" data-uid="Ghost.Entities.EntityManager.CreateSingleton*"></a>
|
|
|
|
<h3 id="Ghost_Entities_EntityManager_CreateSingleton__1___0_" data-uid="Ghost.Entities.EntityManager.CreateSingleton``1(``0)">
|
|
CreateSingleton<T>(T)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Create a singleton entity with the specified component.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public Error CreateSingleton<T>(T component = default) where T : unmanaged, IComponent</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>component</code> <span class="xref">T</span></dt>
|
|
<dd><p>The component data.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><span class="xref">Error</span></dt>
|
|
<dd><p>The result status of the operation.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Type Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>T</code></dt>
|
|
<dd><p>The component space.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Ghost_Entities_EntityManager_DestroyEntities_" data-uid="Ghost.Entities.EntityManager.DestroyEntities*"></a>
|
|
|
|
<h3 id="Ghost_Entities_EntityManager_DestroyEntities_System_ReadOnlySpan_Ghost_Entities_Entity__" data-uid="Ghost.Entities.EntityManager.DestroyEntities(System.ReadOnlySpan{Ghost.Entities.Entity})">
|
|
DestroyEntities(ReadOnlySpan<Entity>)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Destroy the specified entities.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public void DestroyEntities(ReadOnlySpan<Entity> entities)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>entities</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.readonlyspan-1">ReadOnlySpan</a><<a class="xref" href="Ghost.Entities.Entity.html">Entity</a>></dt>
|
|
<dd><p>The entities to destroy.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Ghost_Entities_EntityManager_DestroyEntity_" data-uid="Ghost.Entities.EntityManager.DestroyEntity*"></a>
|
|
|
|
<h3 id="Ghost_Entities_EntityManager_DestroyEntity_Ghost_Entities_Entity_" data-uid="Ghost.Entities.EntityManager.DestroyEntity(Ghost.Entities.Entity)">
|
|
DestroyEntity(Entity)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Destroy the specified entity.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public Error DestroyEntity(Entity entity)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>entity</code> <a class="xref" href="Ghost.Entities.Entity.html">Entity</a></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><span class="xref">Error</span></dt>
|
|
<dd><p>The result status of the operation.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Ghost_Entities_EntityManager_DestroyManagedEntity_" data-uid="Ghost.Entities.EntityManager.DestroyManagedEntity*"></a>
|
|
|
|
<h3 id="Ghost_Entities_EntityManager_DestroyManagedEntity_Ghost_Entities_ManagedEntity_" data-uid="Ghost.Entities.EntityManager.DestroyManagedEntity(Ghost.Entities.ManagedEntity)">
|
|
DestroyManagedEntity(ManagedEntity)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Destroys the given ManagedEntity and calls OnDestroy on all associated ScriptComponents.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public void DestroyManagedEntity(ManagedEntity managedEntity)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>managedEntity</code> <a class="xref" href="Ghost.Entities.ManagedEntity.html">ManagedEntity</a></dt>
|
|
<dd><p>The ManagedEntity to destroy.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Ghost_Entities_EntityManager_DestroyScriptComponent_" data-uid="Ghost.Entities.EntityManager.DestroyScriptComponent*"></a>
|
|
|
|
<h3 id="Ghost_Entities_EntityManager_DestroyScriptComponent__1_Ghost_Entities_ManagedEntity_" data-uid="Ghost.Entities.EntityManager.DestroyScriptComponent``1(Ghost.Entities.ManagedEntity)">
|
|
DestroyScriptComponent<T>(ManagedEntity)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"></div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public bool DestroyScriptComponent<T>(ManagedEntity managedEntity) where T : ScriptComponent</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>managedEntity</code> <a class="xref" href="Ghost.Entities.ManagedEntity.html">ManagedEntity</a></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Type Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>T</code></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Ghost_Entities_EntityManager_Dispose_" data-uid="Ghost.Entities.EntityManager.Dispose*"></a>
|
|
|
|
<h3 id="Ghost_Entities_EntityManager_Dispose" data-uid="Ghost.Entities.EntityManager.Dispose">
|
|
Dispose()
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public void Dispose()</code></pre>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Ghost_Entities_EntityManager_Exists_" data-uid="Ghost.Entities.EntityManager.Exists*"></a>
|
|
|
|
<h3 id="Ghost_Entities_EntityManager_Exists_Ghost_Entities_Entity_" data-uid="Ghost.Entities.EntityManager.Exists(Ghost.Entities.Entity)">
|
|
Exists(Entity)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Check if the specified entity exists.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public bool Exists(Entity entity)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>entity</code> <a class="xref" href="Ghost.Entities.Entity.html">Entity</a></dt>
|
|
<dd><p>The entity to check.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
|
|
<dd><p>True if the entity exists, false otherwise.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Ghost_Entities_EntityManager_Exists_" data-uid="Ghost.Entities.EntityManager.Exists*"></a>
|
|
|
|
<h3 id="Ghost_Entities_EntityManager_Exists_Ghost_Entities_ManagedEntity_" data-uid="Ghost.Entities.EntityManager.Exists(Ghost.Entities.ManagedEntity)">
|
|
Exists(ManagedEntity)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Checks if the given ManagedEntity exists.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public bool Exists(ManagedEntity managedEntity)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>managedEntity</code> <a class="xref" href="Ghost.Entities.ManagedEntity.html">ManagedEntity</a></dt>
|
|
<dd><p>The ManagedEntity to check.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
|
|
<dd><p>True if the ManagedEntity exists, false otherwise.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Ghost_Entities_EntityManager_Finalize_" data-uid="Ghost.Entities.EntityManager.Finalize*"></a>
|
|
|
|
<h3 id="Ghost_Entities_EntityManager_Finalize" data-uid="Ghost.Entities.EntityManager.Finalize">
|
|
~EntityManager()
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"></div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">protected ~EntityManager()</code></pre>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Ghost_Entities_EntityManager_GetComponent_" data-uid="Ghost.Entities.EntityManager.GetComponent*"></a>
|
|
|
|
<h3 id="Ghost_Entities_EntityManager_GetComponent_Ghost_Entities_Entity_Ghost_Core_Identifier_Ghost_Entities_IComponent__" data-uid="Ghost.Entities.EntityManager.GetComponent(Ghost.Entities.Entity,Ghost.Core.Identifier{Ghost.Entities.IComponent})">
|
|
GetComponent(Entity, Identifier<IComponent>)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Get a pointer to the component data for the specified entity.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public void* GetComponent(Entity entity, Identifier<IComponent> componentID)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>entity</code> <a class="xref" href="Ghost.Entities.Entity.html">Entity</a></dt>
|
|
<dd><p>The entity to get the component data for.</p>
|
|
</dd>
|
|
<dt><code>componentID</code> <span class="xref">Identifier</span><<a class="xref" href="Ghost.Entities.IComponent.html">IComponent</a>></dt>
|
|
<dd><p>The component space ID to get.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.void">void</a>*</dt>
|
|
<dd><p>Pointer to the component data, or null if not found.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Ghost_Entities_EntityManager_GetComponent_" data-uid="Ghost.Entities.EntityManager.GetComponent*"></a>
|
|
|
|
<h3 id="Ghost_Entities_EntityManager_GetComponent__1_Ghost_Entities_Entity_" data-uid="Ghost.Entities.EntityManager.GetComponent``1(Ghost.Entities.Entity)">
|
|
GetComponent<T>(Entity)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Get a reference to the component data for the specified entity.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public ref T GetComponent<T>(Entity entity) where T : unmanaged, IComponent</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>entity</code> <a class="xref" href="Ghost.Entities.Entity.html">Entity</a></dt>
|
|
<dd><p>The entity to get the component data for.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><span class="xref">T</span></dt>
|
|
<dd><p>Reference to the component data. null ref if not found.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Type Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>T</code></dt>
|
|
<dd><p>The component space.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Ghost_Entities_EntityManager_GetScriptComponent_" data-uid="Ghost.Entities.EntityManager.GetScriptComponent*"></a>
|
|
|
|
<h3 id="Ghost_Entities_EntityManager_GetScriptComponent__1_Ghost_Entities_ManagedEntity_" data-uid="Ghost.Entities.EntityManager.GetScriptComponent``1(Ghost.Entities.ManagedEntity)">
|
|
GetScriptComponent<T>(ManagedEntity)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"></div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public T GetScriptComponent<T>(ManagedEntity managedEntity) where T : ScriptComponent</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>managedEntity</code> <a class="xref" href="Ghost.Entities.ManagedEntity.html">ManagedEntity</a></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><span class="xref">T</span></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Type Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>T</code></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Ghost_Entities_EntityManager_GetScriptComponents_" data-uid="Ghost.Entities.EntityManager.GetScriptComponents*"></a>
|
|
|
|
<h3 id="Ghost_Entities_EntityManager_GetScriptComponents__1_Ghost_Entities_ManagedEntity_" data-uid="Ghost.Entities.EntityManager.GetScriptComponents``1(Ghost.Entities.ManagedEntity)">
|
|
GetScriptComponents<T>(ManagedEntity)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"></div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public List<T> GetScriptComponents<T>(ManagedEntity managedEntity) where T : ScriptComponent</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>managedEntity</code> <a class="xref" href="Ghost.Entities.ManagedEntity.html">ManagedEntity</a></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1">List</a><T></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Type Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>T</code></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Ghost_Entities_EntityManager_GetSingleton_" data-uid="Ghost.Entities.EntityManager.GetSingleton*"></a>
|
|
|
|
<h3 id="Ghost_Entities_EntityManager_GetSingleton_Ghost_Core_Identifier_Ghost_Entities_IComponent__" data-uid="Ghost.Entities.EntityManager.GetSingleton(Ghost.Core.Identifier{Ghost.Entities.IComponent})">
|
|
GetSingleton(Identifier<IComponent>)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Get a pointer to the singleton component data.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public void* GetSingleton(Identifier<IComponent> componentID)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>componentID</code> <span class="xref">Identifier</span><<a class="xref" href="Ghost.Entities.IComponent.html">IComponent</a>></dt>
|
|
<dd><p>The component space ID of the singleton.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.void">void</a>*</dt>
|
|
<dd><p>Pointer to the component data, or null if not found.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Ghost_Entities_EntityManager_GetSingleton_" data-uid="Ghost.Entities.EntityManager.GetSingleton*"></a>
|
|
|
|
<h3 id="Ghost_Entities_EntityManager_GetSingleton__1" data-uid="Ghost.Entities.EntityManager.GetSingleton``1">
|
|
GetSingleton<T>()
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Get a reference to the singleton component data.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public ref T GetSingleton<T>() where T : unmanaged, IComponent</code></pre>
|
|
</div>
|
|
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><span class="xref">T</span></dt>
|
|
<dd><p>Reference to the component data. null ref if not found.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Type Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>T</code></dt>
|
|
<dd><p>The component space.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Ghost_Entities_EntityManager_HasComponent_" data-uid="Ghost.Entities.EntityManager.HasComponent*"></a>
|
|
|
|
<h3 id="Ghost_Entities_EntityManager_HasComponent_Ghost_Entities_Entity_Ghost_Core_Identifier_Ghost_Entities_IComponent__" data-uid="Ghost.Entities.EntityManager.HasComponent(Ghost.Entities.Entity,Ghost.Core.Identifier{Ghost.Entities.IComponent})">
|
|
HasComponent(Entity, Identifier<IComponent>)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Check if the specified entity has the specified component.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public bool HasComponent(Entity entity, Identifier<IComponent> componentID)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>entity</code> <a class="xref" href="Ghost.Entities.Entity.html">Entity</a></dt>
|
|
<dd><p>The entity to check.</p>
|
|
</dd>
|
|
<dt><code>componentID</code> <span class="xref">Identifier</span><<a class="xref" href="Ghost.Entities.IComponent.html">IComponent</a>></dt>
|
|
<dd><p>The component space ID to check.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
|
|
<dd><p>True if the entity has the component, false otherwise.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Ghost_Entities_EntityManager_HasComponent_" data-uid="Ghost.Entities.EntityManager.HasComponent*"></a>
|
|
|
|
<h3 id="Ghost_Entities_EntityManager_HasComponent__1_Ghost_Entities_Entity_" data-uid="Ghost.Entities.EntityManager.HasComponent``1(Ghost.Entities.Entity)">
|
|
HasComponent<T>(Entity)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Check if the specified entity has the specified component.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public bool HasComponent<T>(Entity entity) where T : unmanaged, IComponent</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>entity</code> <a class="xref" href="Ghost.Entities.Entity.html">Entity</a></dt>
|
|
<dd><p>The entity to check.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
|
|
<dd><p>True if the entity has the component, false otherwise.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Type Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>T</code></dt>
|
|
<dd><p>The component space.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Ghost_Entities_EntityManager_HasScriptComponent_" data-uid="Ghost.Entities.EntityManager.HasScriptComponent*"></a>
|
|
|
|
<h3 id="Ghost_Entities_EntityManager_HasScriptComponent__1_Ghost_Entities_ManagedEntity_" data-uid="Ghost.Entities.EntityManager.HasScriptComponent``1(Ghost.Entities.ManagedEntity)">
|
|
HasScriptComponent<T>(ManagedEntity)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Checks if the given ManagedEntity has a ScriptComponent of space T.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public bool HasScriptComponent<T>(ManagedEntity managedEntity) where T : ScriptComponent</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>managedEntity</code> <a class="xref" href="Ghost.Entities.ManagedEntity.html">ManagedEntity</a></dt>
|
|
<dd><p>The ManagedEntity to check.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
|
|
<dd><p>True if the ManagedEntity has a ScriptComponent of space T, false</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Type Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>T</code></dt>
|
|
<dd><p>The space of ScriptComponent to check for.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Ghost_Entities_EntityManager_RemoveComponent_" data-uid="Ghost.Entities.EntityManager.RemoveComponent*"></a>
|
|
|
|
<h3 id="Ghost_Entities_EntityManager_RemoveComponent_Ghost_Entities_Entity_Ghost_Core_Identifier_Ghost_Entities_IComponent__" data-uid="Ghost.Entities.EntityManager.RemoveComponent(Ghost.Entities.Entity,Ghost.Core.Identifier{Ghost.Entities.IComponent})">
|
|
RemoveComponent(Entity, Identifier<IComponent>)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Remove a component from the specified entity.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public Error RemoveComponent(Entity entity, Identifier<IComponent> componentID)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>entity</code> <a class="xref" href="Ghost.Entities.Entity.html">Entity</a></dt>
|
|
<dd><p>The entity to remove the component from.</p>
|
|
</dd>
|
|
<dt><code>componentID</code> <span class="xref">Identifier</span><<a class="xref" href="Ghost.Entities.IComponent.html">IComponent</a>></dt>
|
|
<dd><p>The component space ID to remove.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><span class="xref">Error</span></dt>
|
|
<dd><p>The result status of the operation.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Ghost_Entities_EntityManager_RemoveComponent_" data-uid="Ghost.Entities.EntityManager.RemoveComponent*"></a>
|
|
|
|
<h3 id="Ghost_Entities_EntityManager_RemoveComponent__1_Ghost_Entities_Entity_" data-uid="Ghost.Entities.EntityManager.RemoveComponent``1(Ghost.Entities.Entity)">
|
|
RemoveComponent<T>(Entity)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Remove a component from the specified entity.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public Error RemoveComponent<T>(Entity entity) where T : unmanaged, IComponent</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>entity</code> <a class="xref" href="Ghost.Entities.Entity.html">Entity</a></dt>
|
|
<dd><p>The entity to remove the component from.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><span class="xref">Error</span></dt>
|
|
<dd><p>The result status of the operation.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Type Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>T</code></dt>
|
|
<dd><p>The component space.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Ghost_Entities_EntityManager_SetComponent_" data-uid="Ghost.Entities.EntityManager.SetComponent*"></a>
|
|
|
|
<h3 id="Ghost_Entities_EntityManager_SetComponent_Ghost_Entities_Entity_Ghost_Core_Identifier_Ghost_Entities_IComponent__System_Void__" data-uid="Ghost.Entities.EntityManager.SetComponent(Ghost.Entities.Entity,Ghost.Core.Identifier{Ghost.Entities.IComponent},System.Void*)">
|
|
SetComponent(Entity, Identifier<IComponent>, void*)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Set the component data for the specified entity.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public Error SetComponent(Entity entity, Identifier<IComponent> componentID, void* pComponent)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>entity</code> <a class="xref" href="Ghost.Entities.Entity.html">Entity</a></dt>
|
|
<dd><p>The entity to set the component data for.</p>
|
|
</dd>
|
|
<dt><code>componentID</code> <span class="xref">Identifier</span><<a class="xref" href="Ghost.Entities.IComponent.html">IComponent</a>></dt>
|
|
<dd><p>The component space ID to set.</p>
|
|
</dd>
|
|
<dt><code>pComponent</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.void">void</a>*</dt>
|
|
<dd><p>Pointer to the component data.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><span class="xref">Error</span></dt>
|
|
<dd><p>The result status of the operation.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Ghost_Entities_EntityManager_SetComponent_" data-uid="Ghost.Entities.EntityManager.SetComponent*"></a>
|
|
|
|
<h3 id="Ghost_Entities_EntityManager_SetComponent__1_Ghost_Entities_Entity___0_" data-uid="Ghost.Entities.EntityManager.SetComponent``1(Ghost.Entities.Entity,``0)">
|
|
SetComponent<T>(Entity, T)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Set the component data for the specified entity.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public Error SetComponent<T>(Entity entity, T component) where T : unmanaged, IComponent</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>entity</code> <a class="xref" href="Ghost.Entities.Entity.html">Entity</a></dt>
|
|
<dd><p>The entity to set the component data for.</p>
|
|
</dd>
|
|
<dt><code>component</code> <span class="xref">T</span></dt>
|
|
<dd><p>The component data.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><span class="xref">Error</span></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Type Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>T</code></dt>
|
|
<dd><p>The component space.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Ghost_Entities_EntityManager_SetEnabled_" data-uid="Ghost.Entities.EntityManager.SetEnabled*"></a>
|
|
|
|
<h3 id="Ghost_Entities_EntityManager_SetEnabled_Ghost_Entities_Entity_Ghost_Core_Identifier_Ghost_Entities_IComponent__System_Boolean_" data-uid="Ghost.Entities.EntityManager.SetEnabled(Ghost.Entities.Entity,Ghost.Core.Identifier{Ghost.Entities.IComponent},System.Boolean)">
|
|
SetEnabled(Entity, Identifier<IComponent>, bool)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"></div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public Error SetEnabled(Entity entity, Identifier<IComponent> componentID, bool enabled)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>entity</code> <a class="xref" href="Ghost.Entities.Entity.html">Entity</a></dt>
|
|
<dd></dd>
|
|
<dt><code>componentID</code> <span class="xref">Identifier</span><<a class="xref" href="Ghost.Entities.IComponent.html">IComponent</a>></dt>
|
|
<dd></dd>
|
|
<dt><code>enabled</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><span class="xref">Error</span></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Ghost_Entities_EntityManager_SetEnabled_" data-uid="Ghost.Entities.EntityManager.SetEnabled*"></a>
|
|
|
|
<h3 id="Ghost_Entities_EntityManager_SetEnabled__1_Ghost_Entities_Entity_System_Boolean_" data-uid="Ghost.Entities.EntityManager.SetEnabled``1(Ghost.Entities.Entity,System.Boolean)">
|
|
SetEnabled<T>(Entity, bool)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"></div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public Error SetEnabled<T>(Entity entity, bool enabled) where T : unmanaged, IEnableableComponent</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>entity</code> <a class="xref" href="Ghost.Entities.Entity.html">Entity</a></dt>
|
|
<dd></dd>
|
|
<dt><code>enabled</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><span class="xref">Error</span></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Type Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>T</code></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</article>
|
|
|
|
<div class="contribution d-print-none">
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
<div class="affix">
|
|
<nav id="affix"></nav>
|
|
</div>
|
|
</main>
|
|
|
|
<div class="container-xxl search-results" id="search-results"></div>
|
|
|
|
<footer class="border-top text-secondary">
|
|
<div class="container-xxl">
|
|
<div class="flex-fill">
|
|
<span>Made with <a href="https://dotnet.github.io/docfx">docfx</a></span>
|
|
</div>
|
|
</div>
|
|
</footer>
|
|
</body>
|
|
</html>
|