Skip to content

Commit

Permalink
tick: Document and move related functions to sub-folder
Browse files Browse the repository at this point in the history
This documents the tick and set_player_id function (work towards #5).

Both functions are moved to the tick subfolder now.
  • Loading branch information
NeunEinser committed Mar 2, 2021
1 parent a7cdefa commit ada088d
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 7 deletions.
2 changes: 0 additions & 2 deletions data/bingo/functions/set_player_id.mcfunction

This file was deleted.

5 changes: 0 additions & 5 deletions data/bingo/functions/tick.mcfunction

This file was deleted.

15 changes: 15 additions & 0 deletions data/bingo/functions/tick/set_player_id.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#> bingo:tick/set_player_id
#
# This function gives @s a unique player ID.
#
# @within function bingo:tick/**
# @context entity Player to give the next ID
#>
# Score holder which holds the next id.
# This is part of the bingo.id objective
#
# @private
#declare score_holder $next

scoreboard players operation @s bingo.id = $next bingo.id
scoreboard players add $next bingo.id 1
16 changes: 16 additions & 0 deletions data/bingo/functions/tick/tick.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#> bingo:tick/tick
#
# This function is called every tick
#
# This contains some base logic, but most of the stuff happens in
# bingo:card_display/display_card or GAMELOOP_TO_BE_IMPLEMENTED
#
# @within tag/function minecraft:tick
# @handles #minecraft:tick

execute as @a run function bingo:card_display/display_card

execute in bingo:lobby run function bingo:lobby/tick

# Assign each player a unique ID
execute as @a unless score @s bingo.id matches -2147483648.. run function bingo:tick/set_player_id

0 comments on commit ada088d

Please sign in to comment.