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

STRUCT_MEMBER_ACCESS Add support for using variables inside other variables #31

Closed
gtker opened this issue Oct 15, 2022 · 1 comment
Closed
Labels
enhancement New feature or request

Comments

@gtker
Copy link
Owner

gtker commented Oct 15, 2022

In the Wrath MovementBlock the first few fields are identical to the fields of the MovementInfo.

Emulators send an actual MovementInfo but we have to duplicate the fields because we can't reach into the structs.

We want to be able to do

flag A : u8 {
	ONE = 1;
	TWO = 2;
}
flag B : u8 {
	FOUR = 4;
	EIGHT = 8;
}

struct T {
	A a;
}
struct Y {
	T t;
	if (t.a & ONE) {
		u8 one;
	}
}

It is not certain what the generated Rust could should look like.

@gtker gtker added the enhancement New feature or request label Oct 15, 2022
@gtker gtker changed the title Add support for using variables inside other variables STRUCT_MEMBER_ACCESS Add support for using variables inside other variables Feb 21, 2023
@gtker gtker closed this as completed in e089206 Feb 23, 2023
@gtker
Copy link
Owner Author

gtker commented Feb 23, 2023

The motivation for doing this was partly automatically converting to/from MovementInfo and the resulting type that contained a MovementInfo, but this would introduce a very nasty edge case that would only be used for a single thing. Manually writing a conversion function is simpler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant