public void CreatePlayerController()
        {
            IPlayerController controller = new PlayerControllerBuilder(new Mock <IPlayerModel>().Object,
                                                                       new Mock <IPlayerView>().Object)
                                           .Build();

            Assert.NotNull(controller);
        }
        public void ConfigureHttpClientService()
        {
            IPlayerController controller = new PlayerControllerBuilder(new Mock <IPlayerModel>().Object,
                                                                       new Mock <IPlayerView>().Object)
                                           .ConfigureHttpClientService(new Mock <IHttpClientService>().Object)
                                           .Build();

            Assert.NotNull(controller.HttpClientService);
        }
        public void ConfigurePlayer()
        {
            IPlayerController controller = new PlayerControllerBuilder(new Mock <IPlayerModel>().Object,
                                                                       new Mock <IPlayerView>().Object)
                                           .Configure(new PlayerControllerOptions())
                                           .Build();

            Assert.NotNull(controller.Options);
        }
Ejemplo n.º 4
0
    private void CreatePlayer()
    {
        Debug.Log("Game Controller CreatePlayer running");

        var playerView = player.GetComponent <PlayerView>();

        if (playerView == null)
        {
            Debug.Log("couldn't locate PlayerView in main menu");
        }

        PlayerModelFactory PlayerModelFactory = new PlayerModelFactory();

        PlayerModelFactory.Model.Id       = new Guid("11111111-1111-1111-1111-111111111112");
        PlayerModelFactory.Model.Position = new WGVector3();

        PlayerControllerBuilder PlayerControllerBuilder = new PlayerControllerBuilder(PlayerModelFactory.Model,
                                                                                      playerView);


        IPlayerControllerOptions options = new PlayerControllerOptions();

        if (Debug.isDebugBuild)
        {
            options.Uri = new Uri("https://marblemotiondev.wolfgamesllc.com/api/players/");
        }
        if (Application.isEditor)
        {
            options.Uri = new Uri("https://localhost:44340/api/players/");
        }
        options.Uri = new Uri("https://localhost:44340/api/players/");

        IHttpClientService httpClient = new HttpClientService(mainMenu.GetComponent <NonAsyncHttpClient>(), new UnityJsonConverter());

        Debug.Log("cookie = {" + httpClient.HandleGetCookieClicked() + "}");

        PlayerControllerBuilder.Configure(options).ConfigureHttpClientService(httpClient).Build();
    }