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

Entry for Snippets of Code? #24

Open
Dealman opened this issue Apr 5, 2020 · 6 comments
Open

Entry for Snippets of Code? #24

Dealman opened this issue Apr 5, 2020 · 6 comments
Assignees

Comments

@Dealman
Copy link

Dealman commented Apr 5, 2020

Not sure how many would find it useful, but maybe having a link where people can contribute various small snippets of code? Instead of fully fledged tutorials.

One simple example would be to fetch how much XP the player has of the current skill level in for example OneHanded. While there is a method to return the progress(percentage) I couldn't find a method to return the actual XP of the current level. For example let's say the player has 35/150 in OneHanded, one way you could fetch that value would be like this;

MathF.Round(hero.HeroDeveloper.GetPropertyValue(DefaultSkills.OneHanded) - Campaign.Current.Models.CharacterDevelopmentModel.GetXpRequiredForSkillLevel(hero.GetSkillValue(DefaultSkills.OneHanded)));

And it would return 35.

I think having a collection of short snippets like these could be beneficial and help novices get started a bit easier. :)

@strlngd strlngd self-assigned this Apr 5, 2020
@strlngd
Copy link
Member

strlngd commented Apr 5, 2020

Instead of creating a snippets section, I think it would be easier/more organized to create a tutorial instead. In the above case, you could create a tutorial about working with skills, which would also include the above snippet.

@mewosmith
Copy link

I would find it useful. A searchable store of "how to do x" would be an amazing resource for people who cannot commit the time or lack the skill to understand the structure of whatever they want to do.

Forcing a tutorial would limit contributions and increase the burden of organization.

@strlngd
Copy link
Member

strlngd commented Apr 8, 2020

You can search based on markdown headers. When I migrate to VuePress you will also be able to search based on 2nd-level (and perhaps 3rd-level) headers as well. I think that in the long-term, having snippets of code in separate files is a bad idea. I couldn't find any quality documentation that does this either.

@Peweez
Copy link

Peweez commented Apr 12, 2020

I think it would also be useful to create an own API which offers easy to use methods like your example @Dealman provides. If people contribute time to time we will have a good collection of methods and newcomers as senior developer would have a benefit.

@Anakael
Copy link
Contributor

Anakael commented Apr 18, 2020

I think own API - not good idea, because it's unneccesary and very limited.
Tutorials are good for begginers to start. It can cover base aspects.
Instead of code snippets I suggest to share finished smal libraries.

@iPherian
Copy link
Contributor

I have various interesting snippets which are pretty advanced and obscure that I'd like to share but I'm not sure that they would work as seperate tutorials. A catch-all entry for "interesting snippets" I think actually might be useful.

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

No branches or pull requests

6 participants