public void InitializeGame() { if (!offline && (!client.Initialized() || !server.Initialized())) { throw new Exception("Connection unitialized. Can't start a game"); } if (offline) { left = new HumanPlayer(Side.LEFT); right = new HumanPlayer(Side.RIGHT); } else if (isServer) { left = new HumanPlayer(Side.LEFT); right = new NetworkPlayer(Side.RIGHT); } else { left = new NetworkPlayer(Side.LEFT); right = new HumanPlayer(Side.RIGHT); } WorldController wrld = new WorldController(left, right, server, client, isServer); Overseer overseer = new Overseer(wrld); BallObject ball = new BallObject(left, right, overseer); wrld.AttachBall(ball); using (var game = new Pong(left, right, ball)) game.Run(); }
public void InitializeGame() { if (!offline && (!client.Initialized() || !server.Initialized())) throw new Exception("Connection unitialized. Can't start a game"); if (offline) { left = new HumanPlayer(Side.LEFT); right = new HumanPlayer(Side.RIGHT); } else if (isServer) { left = new HumanPlayer(Side.LEFT); right = new NetworkPlayer(Side.RIGHT); } else { left = new NetworkPlayer(Side.LEFT); right = new HumanPlayer(Side.RIGHT); } WorldController wrld = new WorldController(left, right, server, client, isServer); Overseer overseer = new Overseer(wrld); BallObject ball = new BallObject(left, right, overseer); wrld.AttachBall(ball); using (var game = new Pong(left, right, ball)) game.Run(); }
public Overseer(WorldController wrld) { worldController = wrld; }