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

Evaluatable debug #2009

Merged
merged 6 commits into from
May 17, 2020
Merged

Conversation

Wibble199
Copy link
Collaborator

@Wibble199 Wibble199 commented May 14, 2020

This PR adds a togglable (checkbox in the top right of the overrides editor, defaults to off) display next to evaluatable blocks that will show their latest evaluated value.

Note that this also changes the signatures slightly for evaluatables in code. The interface IEvaluatable{T} has been replaced with an abstract class Evaluatable{T}, which handles some of the IEvaluatable methods and handles storing the most recent value. There exists an abstract method Execute on the Evaluatable{T} which is what should now be overriden to provide evaluatable logic. The method Evaluate should still be called when getting the value of an evaluatable.

Note that the type binder has been updated to support converting IEvaluatable{T} to Evaluatable{T}. This means previously created override logic will seamlessly transition, but any logic created with this version will not work on versions where IEvaluatable{T} is still used.

Now 'Evaluate' is handled by the abstract Evaluatable{T}, which calls a protected abstract 'Execute' method. This 'Execute' is that one that should be overriden to provide evaluatable logic. 'Evaluate' should still be called when getting the value from an evaluatable.
The most recent value from evaluatables is now stored, with the aim of helping to provide debugging information.
This is because the value may not actually be the current value if the evaluatable isn't updated (e.g. in a false branch of an if-else).
@diogotr7 diogotr7 merged commit 5a1befd into antonpup:dev May 17, 2020
@Wibble199 Wibble199 deleted the feature/evaluatable-debug branch May 17, 2020 23:03
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