cache the hashcode of a piece - we can do this because piece is immutable