ForEach constructor
ForEach(})
The ForEach Loop repeats a set of commands for each value in a Score. Therefore a file is called recursively and a counter score is increased.
constructor | |
---|---|
Score | the score to iterate through |
then | A Function that takes in the count Score |
from | the initial value for the counter(default = 0) |
counter | an Entity to hold the count value(default = #objd_foreach) |
step | how much to increase or decrease the counter each time(default = 1) |
Implementation
ForEach(
this.score, {
required this.then,
this.from = 0,
this.counter,
this.step = 1,
this.translate,
}) {
counter ??= Entity.PlayerName('#objd_foreach');
_countScore = Score(counter!, 'objd_count');
}