Exemple #1
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            LoL.BindNinject(Container);

            Container.Bind <Config>().ToMethod(_ => Config.Current);
            Container.Bind <Container <Config> >().ToConstant(Config.Container);

            Container.Bind <Actuator>().ToSelf().InSingletonScope();
            Container.Bind <Detector>().To <LoginDetector>();
            Container.Bind <Detector>().To <ChampSelectDetector>();
            Container.Bind <Detector>().To <ReadyCheckDetector>();

            Container.Bind <MainWindow>().ToSelf().InSingletonScope();

            var loadingWindow = Container.Get <LoadingWindow>();

            Current.MainWindow = loadingWindow;

            if (!loadingWindow.IsClosed)
            {
                Current.MainWindow.Show();
            }
        }
        public override void MouseDown(int x, int y)
        {
            var system = ((Sfml)GraphicsManager.Graphics).SceneSystem;

            base.MouseDown(x, y);

            switch (this.Name)
            {
            case "cmdLogin":
                string name = system.GetUIObject("txtAccount").GetStringValue("text");

                if (name != string.Empty)
                {
                    Data.DataManager.LoadAccount(name);
                    LoL.SetGameState(GameState.MainMenu);
                }
                break;
            }

            switch (this.Caption)
            {
            case "RELOAD":
                system.Reload();
                break;
            }
        }
Exemple #3
0
        public void LoLReturnsNumberOfLoLsRequested()
        {
            // arrange
            var httpRequest = Substitute.For <HttpRequest>();

            httpRequest.Query["count"].Returns(info => new StringValues("2"));

            // act
            var result = LoL.GetLoLz(httpRequest, NullLogger.Instance);

            // assert
            result.ShouldBeOfType <OkObjectResult>();
            (result as OkObjectResult)?.Value.ShouldBe("LoL.LoL.");
        }
Exemple #4
0
        public void LoLReturnsBadRequestIfCountIsNotSpecified()
        {
            // arrange
            var httpRequest = Substitute.For <HttpRequest>();

            httpRequest.Query["count"].Returns(StringValues.Empty);

            // act
            var result = LoL.GetLoLz(httpRequest, NullLogger.Instance);

            // assert
            result.ShouldBeOfType <BadRequestObjectResult>();
            (result as BadRequestObjectResult)?.Value.ShouldBe("Please pass a count on the query string");
        }
Exemple #5
0
        private void DrawingSurface_Closed(object sender, System.EventArgs e)
        {
            switch (LoL.State)
            {
            case GameState.MainMenu:
                DataManager.SaveAccount();
                LoL.SetGameState(GameState.Login);
                break;

            default:
                LoL.SetGameFlag(GameFlag.Closing);
                break;
            }
        }