Crate minigene Copy item path Source pub extern crate game_features ;pub extern crate hibitset ;izip Create an iterator running multiple iterators in lockstep. join The join macro makes it very easy to iterate over multiple
components of the same Entity at once. system_error Returns a custom error from a System during execution. AiDestination Indicates that the ai should calculate an AiPath from the current position
towards this destination. AiPath The path calculated by the Ai that it will follow. Camera Used to change the visible space of the world on screen. Collision Collision of a single tile entity CollisionMap Collision of a multi tile entity. Not necessarily colliding everywhere.
Can be both used as a global resource and as a component for individual entities. CollisionResource Holds the collision map used to calculate movements, ai pathing and collisions
between entities and the map. ComponentIterator Iterates over components using a provided bitset.
Each time the bitset has a 1 in index i, the iterator will fetch data
from the storage at index i and return it as an Option. ComponentIteratorMut Iterates over components using a provided bitset.
Each time the bitset has a 1 in index i, the iterator will fetch data
from the storage at index i and return it as an Option. Components Holds components of a given type indexed by Entity.
We do not check if the given entity is alive here, this should be done using
Entities. Dispatcher A dispatcher is used to execute a collection of System in order and
possibly in parallel using World’s resources.
A dispatcher automatically avoids mutable borrow collisions which would
normally lead to data corruption, dead locks and more. DispatcherBuilder A builder that accumulates systems to be inserted into a Dispatcher. EffectorDefinition The definition of a stat effector.
This modifies temporarily the value of a stat. EffectorDefinitions Holds the definitions of the stat effectors. EffectorInstance An active instance of an effector. EffectorSet A collection of currently active effectors. Engine The main structure of the engine core loop.
It holds the data necessary to the execution of a game engine. Entities Holds a list of alive entities.
It also holds a list of entities that were recently killed, which allows
to remove components of deleted entities at the end of a game frame. Entity An entity index.
They are created using the Entities struct.
They are used as indices with Components structs. EntityIterator Iterator over entities using the provided bitset. Faction A team with the ability to claim ownership over terrain.
WIP FactionFlags Fags that modify how a faction behaves and how the claimed terrain behaves. FactionSettings Settings of the faction module. GameFeaturesSystemBundle Creates a bundle of systems for the game_features crate. GotoEntity Indicates that the ai should calculate an AiPath from the current position
towards this entity’s position. GotoStraight Indicates that the ai should calculate an AiPath from the current position
towards this destination. HBitSet A BitSet is a simple set designed to track which indices are placed
into it. Inventory Generics InventoryBuilder Builder for Inventory . ItemDefinition An ItemDefinition stores the different properties of a type of item.
It is a schema that contains the data which isn’t changing between different item instances. ItemDefinitionBuilder Builder for ItemDefinition . ItemDefinitions A simple repository mapping the key K to the corresponding ItemDefinition. ItemInstance An ItemInstance is a stack of item.
It refers to the ItemDefinition’s key. The associated ItemDefinition contains the data
describing that object type.
An item stack can be composed of one or many of the same item.
It can also have a durability, which decreases when the item is used using
Inventory::use_item. ItemInstanceBuilder Builder for ItemInstance . ItemTransitionBatch A transition in progress. ItemTransitionDefinition A transition from one or more items into one or more different items.
Can be used for all sorts of crafting. ItemTransitionDefinitionBuilder Builder for ItemTransitionDefinition . ItemTransitionDefinitions The definitions of all known stats. LandClaimSettings The settings related to terrain claiming and how the world is divided into claimable chunks. Leveled A levelable element.
It can be anything: an item, a player, a monster, a skill. LootTree A loot tree based on the lower partial function construct.
Each loot tree node has a chance associated with it. LootTreeBuilder A builder for the LootTree. LootTreeNode A weighted node of a loot tree with the corresponding result. MoveCameraEvent Moves all cameras in the world by distance towards direction.
Consumed by move_camera_system. MultiSprite A text-based sprite that is multiple tiles wide/high. Path Point RNG Random Number Generator
It is suggested to create it manually if it is important that the numbers can’t be guessed
easily. RenderTarget The target terminal id to render to. SkillDefinition The definition of an usable skill. SkillDefinitionBuilder Builder for SkillDefinition . SkillDefinitions Holds the definitions of all known skills. SkillInstance An instance of a skill.
There is one per skill per entity that can use it.
Holds the cooldown for each skill. SkillSet The set of skill that can be used by an entity. SkillTriggerEvent An event where a skill is activated by a specific entity. Sprite A single colored letter sprite. StatCondition Condition based on a stat to activate something. StatDefinition The definition of a stat.
A stat is a named float value optionally constrained between two other values and with a
default value. It is used to create effects, conditions and in general to hold state
for each entity.
For example, it can be used to contain the health or mana of an entity just as well as it
can be used to keep track of the number of enemies positioned around an entity. StatDefinitionBuilder Builder for StatDefinition . StatDefinitions The definitions of all known stats. StatInstance An instance of a stat.
Contains a base value as well as a value after applying the stat effectors. StatInstanceBuilder Builder for StatInstance . StatSet Holds the instances of all the stats an entity has. StateMachine A state machine that holds the stack of states and performs transitions between states.
It can be created using Stopwatch A stopwatch used to calculate time differences. System Struct used to run a system function using the world.
This struct is also used internally by the Dispatcher to create a coherent
execution sequence. Terminal Tiered Tiered element.
Simply adds a numerical value to any element. Time Frame timing values. TimeSpan A span of time that is started but might not have an end yet. Unlockable An unlockable element.
It can be unlocked to access the inner value if all conditions are met: UnlockableBuilder Builder for Unlockable . Unlockables A structure holding all unlockables. User Base struct for the user of a game. UserGroup A clan.
This is a group of multiple users. UserGroupSettings The settings of user groups. Viewshed Everything we can see from. World Contains data indexed by type.
World allows to dynamically enforce the rust rules of borrowing and ownership
at runtime: Color Represents a color. ConditionLostReaction What happens when the transition is stopped or conditions aren’t met anymore for it to
continue. Direction A direction towards one of the 3d axis. EcsError The types of errors a System can create. EffectorType The way this effector modifies the stat. FactionError Errors that can occur while using factions. InventoryBuilderError Error type for InventoryBuilder InventorySizingMode The way the inventory size is handled. ItemDefinitionBuilderError Error type for ItemDefinitionBuilder ItemError The different errors that can happen when interacting with the Inventory. ItemInstanceBuilderError Error type for ItemInstanceBuilder ItemTransitionDefinitionBuilderError Error type for ItemTransitionDefinitionBuilder MoveToFrontMode The way items are removed from the inventory. Indicates if empty spots are left, and if not, how to fill them. SkillDefinitionBuilderError Error type for SkillDefinitionBuilder StatConditionType A condition based on a stat’s value. StatDefinitionBuilderError Error type for StatDefinitionBuilder StatInstanceBuilderError Error type for StatInstanceBuilder StateTransition A transition from one state to the other. UnlockableBuilderError Error type for UnlockableBuilder UseMode The way items are used in a transition. BitSet The BitSet API. Bundle A trait allowing the creation of bundles.
Bundles are groups of Systems that are added together and
in order in a DispatcherBuilder. IntoSystem Converts a function into a System. It is required to execute a function
automatically from World’s resources.
This trait is automatically implemented for functions taking 12 arguments (22 if using the
big_systems feature)
or less where: LevelFor A trait that can calculate the level for something that can accumulate experience.
We suggest using PartialFunction when implementing this trait. SlotType A trait defining which items can be inserted into each inventory slot type. State Trait that states must implement. WorldExt Extension to the World struct that adds a maintain() method. ai_pathing_system Calculates a path from the entity’s current position towards the specified
AiDestination and inserts it in a AiPath component.
It uses a CollisionResource to take collisions into account. apply_effector_system Modifies the stats of entities depending on the effectors applied through them
(using the EffectorSet component.) astar combine_collision_system Combine individual entity’s CollisionMap components into one single
CollisionResource resource. create_bitset Creates a bitset big enough to contain the index of each entity.
Mostly used to create caches. dist Get the euclidian distance between two points. event_retrigger_system Sends input events to output events using a map to link the input to the
output in O(1).
Does not consume input events. exec_skill_system Uses the SkillTriggerEvents to apply effectors to the correct entities. goto_entity_simple_system Moves an entity one tile towards the targeted entity, regardless of collisions. goto_straight_system Moves an entity one tile towards the target position, regardless of collisions. input_driver Transforms char input events into the desired event type using a keybindings map. move_camera_system Consumes MoveCameraEvent to move the camera resource.
Events are cleared by this system. move_position Moves the 2d point by 1 in the given direction.
Only works for 2d directions (North, South, East, West) position_inside_rect Checks if the given position is inside of the given rectangle. remove_outdated_effector_system Removes effectors where their time to live is expired.
Note: Run after ApplyEffectorsSystem. render_ascii Renders ascii characters. skill_cooldown_system Ticks down the cooldown of skill instances for each entity having a SkillSet component. trigger_passive_skill_system Activates passive skills for each entities where all conditions are met using
their SkillSet component.
Creates SkillTriggerEvent events. BitSetVec The type of bitsets used to track entities in component storages.
Mostly used to create caches. FactionRepository Alias type. List of all known factions. FactionResult Alias type. Result of faction methods that can fail. SystemResult The result of a System’s execution.
Returns Ok(()) on success, EcsError on failure.
To return a custom error from a system, use the
system_error! macro. UserRepository The list of all known users. new