Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type
- TState* = ref object of RootObj
- Move* = tuple
- x: int
- y: int
- ChildState* = ref object of TState
- method GetMoves[M](state:TState):seq[M] {.base.} =
- quit "to override!"
- # THIS DOESN'T WORK WHEN StarVsNostar is here
- proc StarVsNostar*[T,M](state:var T,nill_move:M) =
- discard state.GetMoves()
- method GetMoves*(state: ChildState):seq[Move] {.base.} =
- echo "GetMoves - ChildState"
- # BUT IF I MOVE IT HERE, IT WORKS: (uncomment)
- # proc StarVsNostar*[T,M](state:var T,nill_move:M) =
- # discard state.GetMoves()
- var state = new ChildState
- let nil_move:Move = (-1,-1)
- StarVsNostar(state,nil_move)
Advertisement
Add Comment
Please, Sign In to add comment