// Predicate to check if the player can move usign the normal movetype in a certain direction public bool canMoveNormal(Vector2Int displacement, Vector2Int targetPos) { if (Employee.willEmployeeMoveInto(targetPos) || Employee.willEmployeeSwapWith(truePos, targetPos)) { return(false); } Tile tile = LevelManager.getTile(targetPos); ForegroundObject foregroundObj = LevelManager.getForegroundObject(targetPos); return((tile != null && tile.isSteppable()) && (foregroundObj == null || foregroundObj.IsSteppable(MoveType.normal, displacement))); }
// Predicate to check if the player can move using the jumpTwoTiles movetype in a certain direction public bool canMoveJumpTwoTiles(Vector2Int displacement, Vector2Int jumpOverPos, Vector2Int targetPos) { Tile tileToJump = LevelManager.getTile(jumpOverPos); ForegroundObject foregroundObjToJump = LevelManager.getForegroundObject(jumpOverPos); if ((tileToJump != null && !tileToJump.CanBeJumpedOver()) || (foregroundObjToJump != null && !foregroundObjToJump.CanBeJumpedOver())) { return(false); } if (Employee.willEmployeeMoveInto(targetPos)) { return(false); } Tile tile = LevelManager.getTile(targetPos); ForegroundObject foregroundObj = LevelManager.getForegroundObject(targetPos); return((tile != null && tile.isSteppable()) && (foregroundObj == null || foregroundObj.IsSteppable(MoveType.jumpTwoTiles, displacement))); }