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

Be better at documenting #5

Closed
NeunEinser opened this issue Jan 28, 2021 · 10 comments
Closed

Be better at documenting #5

NeunEinser opened this issue Jan 28, 2021 · 10 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@NeunEinser
Copy link
Owner

There is no documentation.
git gud

@NeunEinser NeunEinser added documentation Improvements or additions to documentation enhancement New feature or request labels Jan 28, 2021
NeunEinser added a commit that referenced this issue Mar 2, 2021
This documents most declarations in the init functions and also adds
documentation for the functions themselves.

The storage bingo:main was renamed to bingo:items

Setup lobby is no longer executed positioned 0 0 0, but instead the
commands used in that function are executed on global coordinates.

Work towards #5
NeunEinser added a commit that referenced this issue Mar 2, 2021
This documents most declarations in the init functions and also adds
documentation for the functions themselves.

The storage bingo:main was renamed to bingo:items

Setup lobby is no longer executed positioned 0 0 0, but instead the
commands used in that function are executed on global coordinates.

Work towards #5
NeunEinser added a commit that referenced this issue Mar 2, 2021
This documents the tick and set_player_id function (work towards #5).

Both functions are moved to the tick subfolder now.
NeunEinser added a commit that referenced this issue Mar 2, 2021
This adds documentation to all util ffunctions.
Work towards #5

Additionally, some names in match_uuid changed.
NeunEinser added a commit that referenced this issue Mar 2, 2021
Adds documentation to prefrences.

Work towards #5
NeunEinser added a commit that referenced this issue Mar 3, 2021
This documents the card_frames sub folder.

Furthermore, temporary storages are renamed to follow the new scheme
(Work towards #5) and the tag bingo.unmark has the inverse functionality
and is now called bingo.toggle_on.
NeunEinser added a commit that referenced this issue Mar 3, 2021
This documents the card_frames sub folder. (Work towards #5)

Furthermore, temporary storages are renamed to follow the new scheme
(Work towards #4) and the tag bingo.unmark has the inverse functionality
and is now called bingo.toggle_on.
NeunEinser added a commit that referenced this issue Mar 4, 2021
This refactors command queue to be easier to understand and removes some
unnecessary functions.

Everything in there is now also documented (Work towards #5) and names
are changed to follow #4.
NeunEinser added a commit that referenced this issue Mar 4, 2021
This documents card display functions (Work towards #5)

score_holder name $y follows new rules for temporary score holder names
and is now called $card_display/display_card.y.
NeunEinser added a commit that referenced this issue Mar 4, 2021
This documents the function responsible for setting signs in the lobby.

Work towards #5
NeunEinser added a commit that referenced this issue Mar 6, 2021
This documents the full init function and adds declarations for every
variable used for the api. (Work towards #5)

Other functions are not yet documented.

Some objective names where renamed to follow new conventions. (Work
towards #4)
NeunEinser added a commit that referenced this issue Mar 6, 2021
This moves internal scores used by the timer from 91.timer.main to
91.timer.intern.

The sole constant (value 60) was also moved from 91.timer.const to the
new objective, and the const objective was removed.

All internal score holders are also properly documented now (Work
towards #5)
NeunEinser added a commit that referenced this issue Mar 11, 2021
This documents all functions and declarations in item detection (Work
towards #5).

This also renames some tremporary declarations to follow new conventions
better (work towards #4).
@Kri5t0fK
Copy link
Contributor

Kri5t0fK commented Feb 13, 2022

Is lacking @context here?

#> bingo:game/start/set_spawn
#
# Sets the spawnpoint for all players and spawns a marker aec incase the player
# respawns in the overworld
#
# @within function bingo:game/start/countdown

from here (at @a[...):

execute if score $start_game.countdown bingo.schedule matches 3 at @a[predicate=bingo:is_in_game, limit=1] align xz positioned ~0.5 ~ ~0.5 run function bingo:game/start/set_spawn

@Kri5t0fK
Copy link
Contributor

Is #bingo:post_register_items the same thing as #bingo:post_registration?

  • storage bingo:items categories[].items - mentions #bingo:post_register_items
    # items: (Compund List) (readonly) List of all items this category has. Entries
    # have the same structure as in the items array. Will be created
    # automatically, after #bingo:post_register_items ran.
  • storage bingo:registries - mentions both:
    # To execute an action before the registries are processed but after all active
    # extension packs have registered everything, add a function to the function tag
    # #bingo:post_registration
    # In order to modify existing items, either added by the default bingo datapack,
    # or added by another extension pack, please use a function registered to the
    # function tag #bingo:post_register_items
  • no declaration for #bingo:post_register_items
  • #bingo:post_registration declaration:
    #>
    # Function tag for doing actions after the item registration, but before the
    # items are duplicated into the categories array.
    #
    # You may use this function tag for modifing existing items from the default
    # bingo item pool or from other extensio packs.
    #
    # @api
    #declare tag/function bingo:post_registration
    function #bingo:post_registration

@Kri5t0fK
Copy link
Contributor

Maybe add info that bingo:items are generated from bingo:registries?

# This storage is used to keep track of all items that are available in
# Minecraft: Bingo.
#region initialize items
#>
# @within function bingo:init/*
#declare storage tmp.bingo:init
# initialize items
data modify storage tmp.bingo:init items set from storage bingo:registries items
data modify storage bingo:items categories set from storage bingo:registries categories
data remove storage bingo:items items
function bingo:init/initialize_items
execute unless data storage bingo:items activeTags run data modify storage bingo:items activeTags set value ["bingo:default"]
# Schedule to avoid maxCommandChainLength being hit (setting it in init doesn't work the first time)
schedule function bingo:util/apply_active_item_tags 1t
#endregion

@Kri5t0fK
Copy link
Contributor

Add more info about strict mode (description, only used in MP)

#>
# Whether strict mode is turned on
#
# @internal
#declare score_holder $strict_mode
scoreboard players add $strict_mode bingo.settings 0

@Kri5t0fK
Copy link
Contributor

Maybe encapsulate consts in #region consts?
#>
# Whether the card needs to be updated
#
# @internal
#declare score_holder $update_card
#>
# @public
#declare score_holder -2
scoreboard players set -2 bingo.const -2
#>
# @public
#declare score_holder -1
scoreboard players set -1 bingo.const -1

@Kri5t0fK
Copy link
Contributor

Add declaration for #bingo:fill_registries
#region run registries
data remove storage bingo:registries categories
data remove storage bingo:registries items
data remove storage bingo:registries structures
data remove storage bingo:registries hud_components
data remove storage bingo:registries preferences
function #bingo:fill_registries

@Kri5t0fK
Copy link
Contributor

Explain registration of own items (or delete line 5 if it's to be done somewhere else)
#> bingo:init/fill_registries
#
# Registers everything in vanilla bingo.
#
# To register your own ite

Kri5t0fK added a commit to Kri5t0fK/bingo that referenced this issue Feb 18, 2022
- misspellings - missing letters
- improved some descriptions NeunEinser#5
@NeunEinser
Copy link
Owner Author

NeunEinser commented Feb 19, 2022

Add declaration for #bingo:fill_registries

#region run registries
data remove storage bingo:registries categories
data remove storage bingo:registries items
data remove storage bingo:registries structures
data remove storage bingo:registries hud_components
data remove storage bingo:registries preferences
function #bingo:fill_registries

Only tags that are not otherwise declared (through a file) are declared with #declare. Unfortunately DPH+/SPYglass/IMP does currently not support documentation for tags like that.
See Arcensoth/imp-spec#1

@NeunEinser
Copy link
Owner Author

NeunEinser commented Feb 19, 2022

Is #bingo:post_register_items the same thing as #bingo:post_registration?

  • storage bingo:items categories[].items - mentions #bingo:post_register_items

    # items: (Compund List) (readonly) List of all items this category has. Entries
    # have the same structure as in the items array. Will be created
    # automatically, after #bingo:post_register_items ran.

  • storage bingo:registries - mentions both:

    # To execute an action before the registries are processed but after all active
    # extension packs have registered everything, add a function to the function tag
    # #bingo:post_registration

    # In order to modify existing items, either added by the default bingo datapack,
    # or added by another extension pack, please use a function registered to the
    # function tag #bingo:post_register_items

  • no declaration for #bingo:post_register_items

  • #bingo:post_registration declaration:

    #>
    # Function tag for doing actions after the item registration, but before the
    # items are duplicated into the categories array.
    #
    # You may use this function tag for modifing existing items from the default
    # bingo item pool or from other extensio packs.
    #
    # @api
    #declare tag/function bingo:post_registration
    function #bingo:post_registration

I think #bingo:post_register_items is the old name when nothing else but items were registered.

@NeunEinser
Copy link
Owner Author

I think it's good enough now. No need to keep track of this issue anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants