Merge branch 'lang/memory-burn3' into lang/foundations
This commit is contained in:
commit
858544e231
11 changed files with 42 additions and 9 deletions
|
|
@ -1,6 +1,7 @@
|
|||
# arc.ludic - an arc is a table of chapters, each a table of up to STEPS_PER_CHAPTER steps. The
|
||||
# game builds one with steps_chapter_add / steps_add; what a chapter is called is the game's.
|
||||
# empty the tables for another arc (the progress goes back to the first chapter)
|
||||
@alloc_ok("an arc's tables: once, when an arc is built")
|
||||
export function steps_arc_clear(steps_st: mut StepsState) -> void {
|
||||
steps_st.steps__n = new []int
|
||||
steps_st.steps__kind = new []int
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ export function steps_config(steps_st: mut StepsState, players: int) -> void {
|
|||
steps_st.steps__col = null
|
||||
}
|
||||
|
||||
@alloc_ok("the party's columns: once a chapter, and when the party changes")
|
||||
function steps__party_clear(steps_st: mut StepsState) -> void {
|
||||
steps_st.steps__col = new []int
|
||||
for i in 0 .. steps_st.steps__players * STEPS_PER_CHAPTER { push(steps_st.steps__col, 0) }
|
||||
|
|
@ -36,6 +37,7 @@ function steps__share(steps_st: StepsState, p: int, i: int) -> int {
|
|||
# the same into a list the caller keeps (a guest checks its shares every tick)
|
||||
export function steps_my_shares_into(steps_st: StepsState, out: []int) -> void {
|
||||
List.clear(out)
|
||||
@alloc_ok("into the caller's kept list, at most STEPS_PER_CHAPTER")
|
||||
for i in 0 .. STEPS_PER_CHAPTER { push(out, steps__share(steps_st, 0, i)) }
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ export function steps_facts(steps_st: StepsState) -> Queue<StepsFact> {
|
|||
return steps_st.steps__facts
|
||||
}
|
||||
|
||||
@alloc_ok("a step's fact: once, when a step or a chapter is met")
|
||||
function steps__fact(steps_st: StepsState, what: int, ch: int, i: int) -> void {
|
||||
var f = q_rec(steps_facts(steps_st))
|
||||
if f == null {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue