Skip to content

Rename variables in Grid Sensor #5217

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

Merged
merged 5 commits into from
Apr 1, 2021
Merged

Rename variables in Grid Sensor #5217

merged 5 commits into from
Apr 1, 2021

Conversation

dongruoping
Copy link
Contributor

Proposed change(s)

Renaming variables to better follow naming conventions.

Useful links (Github issues, JIRA tickets, ML-Agents forum threads etc.)

Types of change(s)

  • Bug fix
  • New feature
  • Code refactor
  • Breaking change
  • Documentation update
  • Other (please describe)

Checklist

  • Added tests that prove my fix is effective or that my feature works
  • Updated the changelog (if applicable)
  • Updated the documentation (if applicable)
  • Updated the migration guide (if applicable)

Other comments

int[] ChannelOffsets;
string m_Name;
Vector3 m_CellScale;
Vector3Int m_GridNum;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I explored grouping these parameters into struct. The constructer became cleaner but the code becomes much more verbose since these are used a lot everywhere. Also that brings another problem that in the struct some parameters can be changed at runtime while some cannot, and that will make it even more complicated.
So I decided to leave it as is.

@@ -37,23 +37,23 @@ public Vector3 CellScale
}

[HideInInspector, SerializeField]
internal Vector3Int m_GridNumSide = new Vector3Int(16, 1, 16);
internal Vector3Int m_GridNum = new Vector3Int(16, 1, 16);
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this be called GridDimensions, or GridSize? GridNum is confusing to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was thinking this as "number of grids" on each side. I'll change it to GridSize.

Copy link
Contributor

@surfnerd surfnerd left a comment

Choose a reason for hiding this comment

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

Small comment about the m_GridNum variable name, otherwise LGTM

Copy link
Contributor

@chriselion chriselion left a comment

Choose a reason for hiding this comment

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

Looks good, just make sure you're keeping a rough list of API changes so that we can add them to the Migration Guide

@dongruoping dongruoping merged commit 82464ac into main Apr 1, 2021
@delete-merged-branch delete-merged-branch bot deleted the grid-vaiable-rename branch April 1, 2021 23:26
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants