You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a **dependency free**, **lightweight**, **fast** and **easy to use**[Entity-Component System](https://en.wikipedia.org/wiki/Entity_component_system) implementation in Swift. It is developed and maintained as part of the [Fireblade Game Engine project](https://github.com/fireblade-engine).
Copy file name to clipboardExpand all lines: Sources/FirebladeECS/EntityIdentifierGenerator.swift
+46-25Lines changed: 46 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -5,18 +5,23 @@
5
5
// Created by Christian Treffs on 26.06.20.
6
6
//
7
7
8
-
/// An entity identifier generator provides new entity
9
-
/// identifiers on entity creation.
10
-
/// It also allows entity ids to be marked for re-use.
11
-
/// Entity identifiers must be unique.
8
+
/// **Entity Identifier Generator**
9
+
///
10
+
/// An entity identifier generator provides new entity identifiers on entity creation.
11
+
/// It also allows entity ids to be marked as unused (to be re-usable).
12
+
///
13
+
/// You should strive to keep entity ids tightly packed around `EntityIdentifier.Identifier.min` since it has an influence on the underlying memory layout.
12
14
publicprotocolEntityIdentifierGenerator{
13
-
/// Initialize the generator with entity ids already in use.
14
-
/// - Parameter entityIds: The entity ids already in use. Default should be an empty array.
15
-
init(inUse entityIds:[EntityIdentifier])
15
+
/// Initialize the generator providing entity ids to begin with when creating new entities.
16
+
///
17
+
/// Entity ids provided should be passed to `nextId()` in last out order up until the collection is empty.
18
+
/// The default is an empty collection.
19
+
/// - Parameter initialEntityIds: The entity ids to start providing up until the collection is empty (in last out order).
0 commit comments