|
Nebula
|
Worlds hold entities.
<remark> Note that the managed side of Nebula Worlds (C# worlds) is basically a mirror of the native side, which has authority. </remark>
Public Member Functions | |
| bool | IsSimulating () |
| Whether this world is simulating. | |
| Entity | CreateEntity () |
| Entity | GetEntity (UInt64 id) |
| Get an entity by id, or null if it doesn't exist. | |
| void | RefreshMode () |
| Reads the mode from the native world and runs the activation pass when it changed. | |
| void | DeregisterEntity (Entity entity) |
| void | CollectGarbage () |
| Removes entities that no longer exist in the native world. | |
| void | Clear () |
| Drops the world on the managed side. | |
Static Public Member Functions | |
| static bool | HasWorld (uint id) |
| Check if a world id exists in the native game server. | |
| static World | Get (uint id) |
| Get a world by its native world id. | |
Static Public Attributes | |
| static readonly uint | DEFAULT_WORLD = Api.GetDefaultWorldId() |
Package Functions | |
| Entity | RegisterEntityFromNative (UInt64 id) |
| Add an entity reported by the native entity callback. | |
| List< Entity > | GetEntities () |
| void | ClearProperties () |
Static Package Functions | |
| static IReadOnlyCollection< World > | AllWorlds () |
| The worlds the managed runtime has seen. | |
| static void | ClearAllProperties () |
| Detaches properties from every world the managed runtime knows about. | |
Properties | |
| uint | Id [get] |
| IReadOnlyList< Entity > | Entities [get] |
| The entities in the world. | |
Private Member Functions | |
| void | RegisterEntity (Entity entity) |
| World (uint id) | |
Static Private Member Functions | |
| static | World () |
Private Attributes | |
| readonly uint | id |
| readonly List< Entity > | entities |
| readonly Dictionary< UInt64, Entity > | entityMap |
| bool | lastSimulating |
Static Private Attributes | |
| static readonly Dictionary< uint, World > | worlds = [] |
|
inlinestaticprivate |
|
inlineprivate |
|
inlinestaticpackage |
The worlds the managed runtime has seen.
A native world the plugin has not looked at is not in here, and cannot hold a managed property.
|
inline |
Drops the world on the managed side.
Called when the native world is destroyed
|
inlinestaticpackage |
Detaches properties from every world the managed runtime knows about.
A property can only be attached from C#, so the worlds the runtime has seen are the only ones that can hold one.
|
inlinepackage |
|
inline |
Removes entities that no longer exist in the native world.
|
inline |
|
inline |
Get a world by its native world id.
Returns null if the world does not exist.
|
inline |
Get an entity by id, or null if it doesn't exist.
<remark> Entities created in native code become available once the entity queue has been flushed at the beginning of the frame, so an entity created during the frame is not in the mirror until the next one. </remark>
|
inlinestatic |
Check if a world id exists in the native game server.
|
inline |
Whether this world is simulating.
|
inline |
Reads the mode from the native world and runs the activation pass when it changed.
This is where a property is activated when its world starts simulating and deactivated when it stops, because a property that was asked to be active only actually runs in a simulating world.
|
inlineprivate |
|
inlinepackage |
Add an entity reported by the native entity callback.
Entities that are already mirrored are skipped, which is what keeps entities created from C# from being added twice.
|
static |
|
private |
|
private |
|
private |
|
staticprivate |
|
get |
The entities in the world.
|
get |