scanner.GetToken() updates scanner.Token / scanner.token with the next string read. scanner.GetNumber() will convert that token in to a number. In this case, they convert the token using atoi just like GetNumber() does as well.
Before the loop starts, it tries to grab a token. Then the loop starts until the stream is essentially ended.Ifif the token at that state is MONSTER
Then it grabs another token. From the comment, this is expected to be an opening brace.
Then it grabs another token after and the comment states either a closing brace or an id.
Then it loops agai, butt this time while the scanner.Token is not a closing brace.
It creates a pointer of the struct type DPSProp using new allocating the memory to heap.
It assigns a variable from the structure dwID to the current token converted to a number by using atoi.
It then adds that pointer to a vector.
After doing so, it acquires another token. Meaning that the token could be another id or a closing brace. The loop will end if it is a closing brace; otherwise, it will repeat with the next id.
when it is a closing brace, that loops ends.
Then it acquires the next token (GetToken()) while in that if statement which is useless to be honest and shouldn't be there as the first two and the loop will handle that and the fact of the next GetTooutsideside of the if statement.
And after it acquires another token.