parent
e728e47136
commit
d9882bf86e
9 changed files with 282 additions and 0 deletions
@ -0,0 +1,158 @@ |
|||||||
|
//! Module with Flecs builtin components. |
||||||
|
|
||||||
|
const c = @import("../c.zig"); |
||||||
|
|
||||||
|
/// Entity associated with world. |
||||||
|
pub const World = struct {}; |
||||||
|
|
||||||
|
// Builtin components |
||||||
|
|
||||||
|
/// Component that is added to entities which are components. |
||||||
|
pub const Component: type = c.EcsComponent; |
||||||
|
|
||||||
|
/// Component used for entity names, symbols, etc. |
||||||
|
pub const Identifier: type = c.EcsIdentifier; |
||||||
|
|
||||||
|
/// Used as `.{ Identifier, Name }` to store entity name. |
||||||
|
pub const Name = struct {}; |
||||||
|
/// Used as `.{ Identifier, Symbol }` to store entity symbol. |
||||||
|
pub const Symbol = struct {}; |
||||||
|
/// Used as `.{ Identifier, Alias }` to store entity alias. |
||||||
|
pub const Alias = struct {}; |
||||||
|
|
||||||
|
/// Internal component to make (query) entities iterable. |
||||||
|
pub const Iterable: type = c.EcsIterable; |
||||||
|
/// Internal component that stores pointer to poly objects. |
||||||
|
pub const Poly: type = c.EcsPoly; |
||||||
|
|
||||||
|
// Builtin tags |
||||||
|
|
||||||
|
/// Tag that is added to modules, which act as a container for logically |
||||||
|
/// grouping tags, components, systems, other sub-modules and more. |
||||||
|
pub const Module = struct {}; |
||||||
|
/// Tag that is added to prefabsm, which can be inherited from, and are ignored by queries (by default). |
||||||
|
pub const Prefab = struct {}; |
||||||
|
/// Tag that added to disabled entities, which are ignored by queries (by default). |
||||||
|
pub const Disabled = struct {}; |
||||||
|
/// Tag that is added to private components, which hides them in the explorer (by default). |
||||||
|
pub const Private = struct {}; |
||||||
|
|
||||||
|
/// Tag that is added to query entities. |
||||||
|
pub const Query = struct {}; |
||||||
|
/// Tag that is added to observer entities, which listen for events involving entities. |
||||||
|
pub const Observer = struct {}; |
||||||
|
|
||||||
|
/// Internal tag for tracking IDs with special ID flags. |
||||||
|
pub const Flag = struct {}; |
||||||
|
|
||||||
|
// Builtin relationships |
||||||
|
|
||||||
|
/// Relationship used for expressing inheritance. |
||||||
|
pub const IsA = struct {}; |
||||||
|
/// Relationship used for expressing hierarchies. |
||||||
|
pub const ChildOf = struct {}; |
||||||
|
/// Relationship used for expressing dependencies. |
||||||
|
pub const DependsOn = struct {}; |
||||||
|
/// Relationship used for expressing prefab slots. |
||||||
|
pub const SlotOf = struct {}; |
||||||
|
|
||||||
|
// Relationship properties |
||||||
|
|
||||||
|
/// Trait that enables transitive evaluation of relationships. |
||||||
|
pub const Transitive = struct {}; |
||||||
|
/// Trait that enables reflexive evaluation of relationships. |
||||||
|
pub const Reflexive = struct {}; |
||||||
|
/// Trait that indicates an entity cannot be inherited from. |
||||||
|
pub const Final = struct {}; |
||||||
|
/// Trait that indicates it should not be inherited. |
||||||
|
pub const DontInherit = struct {}; |
||||||
|
/// Trait that ensures a pair cannot contain a value. |
||||||
|
pub const Tag = struct {}; |
||||||
|
/// Trait that indicates a relationship is acyclic. |
||||||
|
pub const Acyclic = struct {}; |
||||||
|
/// Trait that indicates a relationship is traversable. |
||||||
|
pub const Traversable = struct {}; |
||||||
|
/// Trait that ensures a relationship can only have one target. |
||||||
|
pub const Exclusive = struct {}; |
||||||
|
/// Trait that causes a relationship to be two-way. |
||||||
|
pub const Symmetric = struct {}; |
||||||
|
/// Trait for adding additional components when a component is added. |
||||||
|
pub const With = struct {}; |
||||||
|
/// Trait that indicates a component should always be overridden. |
||||||
|
pub const AlwaysOverride = struct {}; |
||||||
|
/// Trait for creating a non-fragmenting relationship. |
||||||
|
pub const Union = struct {}; |
||||||
|
/// Trait that enforces target of relationship is a child of <specified>. |
||||||
|
pub const OneOf = struct {}; |
||||||
|
|
||||||
|
// Builtin event tags |
||||||
|
|
||||||
|
/// Event emitted when component is added. |
||||||
|
pub const OnAdd = struct {}; |
||||||
|
/// Event emitted when component is removed. |
||||||
|
pub const OnRemove = struct {}; |
||||||
|
/// Event emitted when component is set. |
||||||
|
pub const OnSet = struct {}; |
||||||
|
/// Event emitted when component is unset. |
||||||
|
pub const UnSet = struct {}; |
||||||
|
|
||||||
|
/// Event emitted when table is created. |
||||||
|
pub const OnTableCreate = struct {}; |
||||||
|
/// Event emitted when table becomes empty. |
||||||
|
pub const OnTableDelete = struct {}; |
||||||
|
/// Event emitted when table becomes empty. |
||||||
|
pub const OnTableEmpty = struct {}; |
||||||
|
/// Event emitted when table becomes non-empty. |
||||||
|
pub const OnTableFilled = struct {}; |
||||||
|
|
||||||
|
// Cleanup policies |
||||||
|
// For example, components have `.{ OnDelete, Panic }` by default. |
||||||
|
|
||||||
|
/// Cleanup trait for specifying what happens when component is deleted. |
||||||
|
pub const OnDelete = struct {}; |
||||||
|
/// Cleanup trait for specifying what happens when pair target is deleted. |
||||||
|
pub const OnDeleteTarget = struct {}; |
||||||
|
|
||||||
|
/// Cleanup action to delete entity from other entities. (default) |
||||||
|
pub const Remove = struct {}; |
||||||
|
/// Cleanup action to delete all entities that have this entity. |
||||||
|
pub const Delete = struct {}; |
||||||
|
/// Cleanup action to panic when entity is deleted. |
||||||
|
pub const Panic = struct {}; |
||||||
|
|
||||||
|
// Query markers |
||||||
|
|
||||||
|
/// Query marker to express `$this` variable. |
||||||
|
pub const This = struct {}; |
||||||
|
pub const _This_Name = "$"; |
||||||
|
/// Query marker to express match all wildcard (`*` in query DSL). |
||||||
|
pub const Wildcard = struct {}; |
||||||
|
pub const _Wildcard_Name = "*"; |
||||||
|
/// Query marker to express match at least one wildcard (`_` in query DSL). |
||||||
|
pub const Any = struct {}; |
||||||
|
pub const _Any_Name = "_"; |
||||||
|
|
||||||
|
/// Query marker to express `==` operator. |
||||||
|
pub const PredEq = struct {}; |
||||||
|
/// Query marker to express `~=` operator. |
||||||
|
pub const PredMatch = struct {}; |
||||||
|
/// Query marker to express by-name lookup. |
||||||
|
pub const PredLookup = struct {}; |
||||||
|
|
||||||
|
/// Query marker to express scope open. |
||||||
|
pub const ScopeOpen = struct {}; |
||||||
|
/// Query marker to express scope close. |
||||||
|
pub const ScopeClose = struct {}; |
||||||
|
|
||||||
|
/// Tag used to indicate a query has no results. |
||||||
|
pub const Empty = struct {}; |
||||||
|
|
||||||
|
// Misc |
||||||
|
|
||||||
|
/// Internal component that stores information for flattened trees. |
||||||
|
pub const Target: type = c.EcsTarget; |
||||||
|
/// Tag that when added to assembly automatically flattens tree. |
||||||
|
pub const Flatten = struct {}; |
||||||
|
|
||||||
|
/// Sets default component hint for children of entity. |
||||||
|
pub const DefaultChildComponent = struct {}; |
@ -0,0 +1,13 @@ |
|||||||
|
//! Flecs module with documentation components. |
||||||
|
|
||||||
|
const c = @import("../c.zig"); |
||||||
|
|
||||||
|
/// Component used to add documentation. |
||||||
|
pub const Description = c.EcsDocDescription; |
||||||
|
|
||||||
|
/// Used as `.{ Description, Brief }` to add a brief description. |
||||||
|
pub const Brief = struct {}; |
||||||
|
/// Used as `.{ Description, Detail }` to add a detailed description. |
||||||
|
pub const Detail = struct {}; |
||||||
|
/// Used as `.{ Description, Link }` to add a link. |
||||||
|
pub const Link = struct {}; |
@ -0,0 +1,19 @@ |
|||||||
|
//! Module that schedules and runs systems. |
||||||
|
|
||||||
|
pub const Pipeline = struct {}; |
||||||
|
pub const Phase = struct {}; |
||||||
|
|
||||||
|
// Builtin pipeline phases |
||||||
|
// See also "Selecting a Phase" in the Flecs docs. |
||||||
|
|
||||||
|
pub const OnStart = struct {}; |
||||||
|
pub const PreFrame = struct {}; |
||||||
|
pub const OnLoad = struct {}; |
||||||
|
pub const PostLoad = struct {}; |
||||||
|
pub const PreUpdate = struct {}; |
||||||
|
pub const OnUpdate = struct {}; |
||||||
|
pub const OnValidate = struct {}; |
||||||
|
pub const PostUpdate = struct {}; |
||||||
|
pub const PreStore = struct {}; |
||||||
|
pub const OnStore = struct {}; |
||||||
|
pub const PostFrame = struct {}; |
@ -0,0 +1,4 @@ |
|||||||
|
//! Module that implements Flecs systems. |
||||||
|
|
||||||
|
pub const System = struct {}; |
||||||
|
pub const TickSource = struct {}; |
@ -0,0 +1,6 @@ |
|||||||
|
//! Flecs root module. |
||||||
|
|
||||||
|
pub const core = @import("./flecs.core.zig"); |
||||||
|
pub const doc = @import("./flecs.doc.zig"); |
||||||
|
pub const pipeline = @import("./flecs.pipeline.zig"); |
||||||
|
pub const system = @import("./flecs.system.zig"); |
Loading…
Reference in new issue