22 lines
No EOL
2.5 KiB
HTML
22 lines
No EOL
2.5 KiB
HTML
<!doctype html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||
<title>Pool — Ludic</title>
|
||
<meta name="description" content="Entity-pool statistics.">
|
||
<link rel="stylesheet" href="base.css">
|
||
<link rel="stylesheet" href="docs.css">
|
||
</head>
|
||
<body>
|
||
<header class="nav"><div class="wrap nav-in"><a class="brand" href="index.html"><span class="logo">L</span> Ludic</a><button class="nav-toggle" aria-label="Toggle menu" aria-expanded="false">☰</button><nav class="nav-links"><a href="index.html">Home</a><a href="api.html">API Reference</a><a class="nav-cta" href="https://git.workshopsoft.io/workshopsoft/ludic">Source ↗</a></nav></div></header>
|
||
<main class="wrap item">
|
||
<div class="crumbs"><a href="api.html">API Reference</a> <span>›</span> <span class="here">Pool</span></div>
|
||
<div class="item-head"><span class="kind-badge kind-namespace">namespace</span><h1 id="top">Pool</h1></div>
|
||
<p class="ns-blurb">Entity-pool statistics. Ludic's ECS is already pool-based: the allocator recycles freed entity slots through a freelist (a <a href="../structure/kw-model"><code>despawn</code></a>ed slot is reused by the next <code>spawn</code> before any new slot is taken), and component storage is fixed per-entity arrays — so spawning and despawning many entities per frame does no per-spawn heap allocation and cannot fragment. <a href="pool-live"><code>Pool.live</code></a> / <a href="pool-free"><code>Pool.free</code></a> / <a href="pool-reserved"><code>Pool.reserved</code></a> / <a href="pool-capacity"><code>Pool.capacity</code></a> read those counters so a bullet-hell or horde game can watch reuse and budget against the cap.</p>
|
||
<div class="ns-methods"><a class="ns-method" href="pool-live.html"><code class="nm-sig">Pool.live() -> int</code><span class="nm-tip">How many entities are currently alive.</span></a><a class="ns-method" href="pool-free.html"><code class="nm-sig">Pool.free() -> int</code><span class="nm-tip">How many freed slots are waiting to be reused.</span></a><a class="ns-method" href="pool-reserved.html"><code class="nm-sig">Pool.reserved() -> int</code><span class="nm-tip">High-water: how many slots have ever been allocated.</span></a><a class="ns-method" href="pool-capacity.html"><code class="nm-sig">Pool.capacity() -> int</code><span class="nm-tip">The maximum number of entities.</span></a></div>
|
||
<a class="back" href="api.html">← All symbols</a>
|
||
</main>
|
||
<script src="ludic-highlight.js"></script>
|
||
<script>Ludic.installCards(); Ludic.flashTarget();</script>
|
||
</body></html> |