Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration to inline macros #539

Merged
merged 16 commits into from
Jun 26, 2023
Merged

Migration to inline macros #539

merged 16 commits into from
Jun 26, 2023

Conversation

neotheprogramist
Copy link
Collaborator

@neotheprogramist neotheprogramist commented Jun 21, 2023

This task updates the commands to use macros, which will also enable them to be used outside of components / systems.

# Previous
fn commands::uuid() -> felt252;

# Actual
uuid!()
# Previous
fn commands::set_entity(storage_key: StorageKey, components: T);

# Actual
set!(context, component, ctor, query);
# Previous
fn commands::<T>::get(storage_key: StorageKey) -> T;

# Actual
get!(context, component, query_subtype, query_id, query, lookup_err_msg, deser_err_msg);
# Previous
fn commands::<T>::entities() -> Array<felt252>;

# Actual
find!(context, query_id, query_subtype, partition, component);
# Previous
fn commands::execute(SpawnSystem, 'PositionPlayerWriter'.into(), calldata);

# Actual
execute!(context, system, calldata);

Copy link
Contributor

@tarrencev tarrencev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor feedback otherwise lgtm. The uuid! macro is kind of useless with the world context. we should prob drop it but we can land this first

crates/dojo-lang/src/plugin_test_data/system Outdated Show resolved Hide resolved
crates/dojo-lang/src/system.rs Outdated Show resolved Hide resolved
@neotheprogramist neotheprogramist changed the title uuid migration to inline macros Migration to inline macros Jun 24, 2023
@tarrencev tarrencev merged commit 4d3a549 into dojoengine:main Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants