The new Room.Terrain.get() function seems to be "missing" a constant for the return of a Plain. The function it is replacing had clear returns of each type of terrain.
In the documentation it says it is returning values 0-1-2 and that there are constants describing walls and swamps, but there is no constant for the return of a plain. This makes it easy to check if a terrain is a swamp, but to check if the terrain is a plain i have to check if the functions return a vale of 0. This makes me use "magic numbers" in my code which i prefer to aviod. I can of course create my own constant and compare this, but why then is it defined for the two other two return values and just not for the first value? Also, if this return is ever changed for whatever reason by the server, by creating my own constant i would not evaluate the return correctly. If i used the accompanying constants my code would not care if the raw number returned was changed.
As i understod, the used constants "TERRAIN_MASK_WALL" and "TERRAIN_MASK_SWAMP" is used for bit masking and since the value 0 is not checkable with a bit mask it has no constant. However the return of this function does not appear to have multiple possibilities, the return is always either 0-1-2, so no need for a bit mask?
It just feels a bit inconsistent to provide constants for 2 of the 3 return values. Maybe we could get a new set of constants that describes the terrain types returned?