public UserController(User user, ClientNetworkManager networkManager)
        {
            this.user = user;
            this.networkManager = networkManager;

            keyMappings = new Dictionary<Keys, Ship.Action>();

            previousKeyboardState = Keyboard.GetState();

            commands = new List<UserCommand>();
        }
Пример #2
0
        public Game()
        {
            world = new World();
            user = new User();
            networkManager = new ClientNetworkManager(world, user);
            worldView = new WorldView(world, user);
            userController = new UserController(user, networkManager);
            networkManager.UserController = userController;

            _graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";
        }
        /// <summary>
        /// Constructs the client network manager
        /// </summary>
        public ClientNetworkManager(World world, User user)
        {
            // Construct the connection to the hub
            #if DEBUG
            connection = new HubConnection("http://localhost:29058");
            #else
            connection = new HubConnection("http://vectorarena.cloudapp.net");
            #endif

            // Construct the proxy to the hub
            proxy = connection.CreateHubProxy("ServerHub");

            // Setup the packet deserializer
            packetDeserializer = new PacketDeserializer();

            // Set the world context
            this.world = world;

            this.user = user;
        }
 /// <summary>
 /// Constructs the world display
 /// </summary>
 /// <param name="world"></param>
 /// <param name="user"></param>
 public WorldView(World world, User user)
 {
     this.world = world;
     this.user = user;
     starfield = new Starfield(World.Width, World.Height);
     grid = new Grid(World.Width, World.Height);
     shipView = new ShipView();
 }