refactoring: removing duplication in code checking whether piece placement/movement/rotation is valid
refactoring: removing duplication in code checking whether piece placement/movement/rotation is valid

villez/xtris,villez/xtris