I'm currently in the process of rewriting John Allbritten's cbonsai in rust and im having some trouble with C's enums.
Here's my issue.
In line 698 in https://gitlab.com/jallbrit/cbonsai/-/blob/master/cbonsai.c
A custom branch function is called (function below).
branch(conf, objects, myCounters, maxY - 1, (maxX / 2), trunk, conf->lifeStart);
If you look at the function in line 416 these parameters are passed in.
void branch(struct config *conf, struct ncursesObjects *objects, struct counters *myCounters, int y, int x, enum branchType type, int life)
You can see the branchType enum that is passed in line 698 named 'trunk' (enum in line 17).
Now my confusion is with enums themselves, I have a poor understanding of them, especially what determines the values, such as the ones of 'trunk' in line 698, so how does cbonsai choose what type branchType actually is?
note this is my first time working with c but understand many of the concepts as it is very similar to the same capabilities rust has.