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

GameState Reflection Rewrite #2008

Merged
merged 12 commits into from
May 17, 2020

Conversation

Wibble199
Copy link
Collaborator

  • IStringProperty and StringProperty{T} have been removed. FastMember has been added instead which can achieve the same results without requiring classes to implement or extend one of these classes.
  • The Utils.GameStateUtils class has been removed.
    • The methods for retrieving a value from the game state (such as TryGetDoubleFromState) have been moved into the IGameState interface and GameState class. This means that instead of doing something like GameStateUtils.TryGetDoubleFromState(gameState, VariablePath), you would now use gameState.GetNumber(VariablePath).
    • GameState parameter reflection has been replaced with a dedicated GameStateParameterNode class which uses FastMember and generates a tree-like structure, making it easier for the GameStateParameterPicker to manage and opening up the possibility of adding additional metadata in future.
    • With these changes, GameState and Nodes no longer require a self-referencing type parameter, however this has not been removed since it may have compatibility issues.
  • Removed the clone constructor (that takes an IGameState) from all game states since this was not being used.
  • Removed the type parameters from Node and GameState (still required for AutoJsonNode).

These changes do not break profiles since the paths are still stored as strings and only the internals have been changed. Since it's such a large change though, additional testing would be appreciated.

@diogotr7 diogotr7 merged commit d9ed030 into antonpup:dev May 17, 2020
@Wibble199 Wibble199 deleted the fix/gamestate-reflection-rewrite branch May 17, 2020 22:44
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