Skip to content

Fix documentation on DataPack methods#1164

Merged
Headline merged 3 commits intoalliedmodders:masterfrom
Deathreus:vector-dp
Feb 7, 2020
Merged

Fix documentation on DataPack methods#1164
Headline merged 3 commits intoalliedmodders:masterfrom
Deathreus:vector-dp

Conversation

@Deathreus
Copy link
Contributor

Also fixup a couple descriptions in the methodmap

Copy link
Member

@Headline Headline left a comment

Choose a reason for hiding this comment

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

Good catch on the documentation changes!

Since DataPacks have strict type checking, reading a float where an int would be read will throw an error. To keep this consistent float[3] "vectors" should probably be given their own type internally instead of papering over this with a loop of WriteFloats.

It's a nice ease-of-use addition, but if we take this I think it'd have to be via it's own read/write natives.

Thanks for contributing!

@FortyTwoFortyTwo
Copy link
Contributor

Would it be better to have WriteCellArray, WriteFloatArray, ReadCellArray and ReadFloatArray instead? Allowing to pass any array size rather than limited to 3, write/read vectors can be done using WriteFloatArray/ReadFloatArray with size 3.

@Deathreus
Copy link
Contributor Author

Would it be better to have WriteCellArray, WriteFloatArray, ReadCellArray and ReadFloatArray instead? Allowing to pass any array size rather than limited to 3, write/read vectors can be done using WriteFloatArray/ReadFloatArray with size 3.

Actually, yeah, that would be far better, I'll commit that instead at the native level

@Deathreus Deathreus changed the title Add a vector variant to datapacks Fix documentation on DataPack methods Jan 31, 2020
Copy link
Member

@Headline Headline left a comment

Choose a reason for hiding this comment

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

Thanks!

@Headline
Copy link
Member

After conversation with @Deathreus we'll be leaving the vector changes for later and take the documentation ones for now.

@peace-maker
Copy link
Member

What happened with the submodules? Revert those changes before merging!

@Headline
Copy link
Member

Headline commented Feb 6, 2020

@peace-maker thank you for keeping an eye out, but I’m aware. It’s an issue with rebase picking it’s own submodule commits instead of origin/master’s

@Headline Headline merged commit 48ed38a into alliedmodders:master Feb 7, 2020
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.

5 participants