Executor
I see you
- Reaction score
- 57
JASS:
private struct Pawn extends Figure
static constant integer UNIT_ID = PAWN_ID
method isMoveValid takes Chess__FieldStruct dest returns boolean
if .white then
return ( (FieldStruct(dest).y - FieldStruct(.pos).y) == 1) and (IAbsBJ( FieldStruct(dest).x - FieldStruct(.pos).x ) == 1)
else
return (dest.y-.pos.y == -1) and (IAbsBJ(dest.x-.pos.x) == 1) // <-
endif
endmethod
static method create takes real x, real y, boolean white returns thistype
return .createFigure(x,y,white,UNIT_ID)
endmethod
endstruct
the marked line makes problems.
There are 2 error texts, which occur:
- dest is not of a type that allows . syntax
- pos[this] is not of a type that allows .syntax
The weird thing is that both vars are "FieldStruct" vars, but only a typecast prevents the error line.