instead , he resolved to spend as much time as he could with her , to store up a wealth of memories against the day when he would no longer be able to hide his affliction and he would be forced to leave the castle for good .