A Survey of Cyber-Physical Systems From a Game-Theoretic Perspective