-
Notifications
You must be signed in to change notification settings - Fork 73
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
Comments
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. |
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. |
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. |
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. |
I think own API - not good idea, because it's unneccesary and very limited. |
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. |
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. :)
The text was updated successfully, but these errors were encountered: