A heating and cooling system for a building comprising: - an evaporator configured to vaporize a refrigerant to cool a first fluid stream; - a compressor coupled to the evaporator and configured to compress the vaporized refrigerant; - a condenser configured to condense the refrigerant compressed by the compressor to heat a second fluid stream; - a heat exchanger configured to receive the refrigerant from the condenser, to selectively extract heat from or to add heat to the refrigerant, and to transfer the refrigerant to the evaporator; - first control valving between the condenser and the heat exchanger, configured to regulate flow of the refrigerant from the condenser to the heat exchanger in a first mode of operation of the system; - second control valving between the heat exchanger and the evaporator, configured to regulate flow of the refrigerant from the heat exchanger to the evaporator in a second mode of operation of the system; and - control circuitry coupled to the first and second control valving and configured to regulate opening and closing of the first and second valving to operate the system in the first and second modes of operation wherein the refrigerant is configured to flow in the same direction through the evaporator, the compressor, and the condenser in the first and second modes of operation, wherein the heat exchanger is an evaporator in the first mode of operation and a condenser in the second mode of operation, wherein the first control valving includes a first bypass valve and a first electronically controllable expansion valve disposed in parallel with the first bypass valve, wherein the second control valving includes a second bypass valve and a second electronically controllable expansion valve disposed in parallel with the second bypass valve, and wherein the control circuitry is configured to close the first bypass valve to direct, the refrigerant through the first electronically controllable expansion valve to operate the system in the first mode of operation, and to close the second bypass valve to direct the refrigerant through the second electronically controllable expansion valve to operate the system in the second mode of operation, and wherein the first bypass valve and the second bypass valve are controlled by the control circuitry to change the direction of flow of the refrigerant through the heat exchanger in the first and second modes of operation. - an evaporator configured to vaporize a refrigerant to cool a first fluid stream; - a compressor coupled to the evaporator and configured to compress the vaporized refrigerant; - a condenser configured to condense the refrigerant compressed by the compressor to heat a second fluid stream; - a heat exchanger configured to receive the refrigerant from the condenser, to selectively extract heat from or to add heat to the refrigerant, and to transfer the refrigerant to the evaporator; - first control valving between the condenser and the heat exchanger, configured to regulate flow of the refrigerant from the condenser to the heat exchanger in a first mode of operation of the system; - second control valving between the heat exchanger and the evaporator, configured to regulate flow of the refrigerant from the heat exchanger to the evaporator in a second mode of operation of the system; and - control circuitry coupled to the first and second control valving and configured to regulate opening and closing of the first and second valving to operate the system in the first and second modes of operation