Skip to content

GameState Reflection Rewrite#2008

Merged
diogotr7 merged 12 commits intoantonpup:devfrom
Wibble199:fix/gamestate-reflection-rewrite
May 17, 2020
Merged

GameState Reflection Rewrite#2008
diogotr7 merged 12 commits intoantonpup:devfrom
Wibble199:fix/gamestate-reflection-rewrite

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