Exemplo n.º 1
0
        public Result Start()
        {
            StartGameAction gameAction = new StartGameAction();

            GoFishGame game   = _gameAccessor.Game;
            Result     result = _gameManager.PerformAction(gameAction, ref game);

            return(result);
        }
Exemplo n.º 2
0
        public void StartGame()
        {
            playerHealth = startPlayerHealth;

            PlayStatus  = EnPlayStatus.None;
            LevelStatus = EnLevelStatus.Playing;

            StartGameAction?.Invoke();
        }
Exemplo n.º 3
0
 void onClick()
 {
     Debug.Log("tapping");
     if (startButtonPress)
     {
         Debug.Log("trying to invoke game start action");
         StartGameAction?.Invoke();
     }
     else if (quitButtonPress)
     {
         Application.Quit();
     }
 }
Exemplo n.º 4
0
 private void ConfirmDeck()
 {
     Client.Instance.Proxy.OnSendBuildInfo(CurrentEditBuildButton.BuildInfo);
     NoticeManager.Instance.ShowInfoPanelCenter(LanguageManager.Instance.GetText("Notice_SelectBuildManagerSelect_UpdateDeckSuccess"), 0, 1f);
     if (CurrentSelectedBuildButton)
     {
         CurrentSelectedBuildButton.IsSelected = false;
     }
     CurrentSelectedBuildButton            = CurrentEditBuildButton;
     CurrentSelectedBuildButton.IsSelected = true;
     CloseUIForm();
     StartGameAction?.Invoke();
 }
Exemplo n.º 5
0
        void SetShip(Point point)
        {
            currentShip.AddPoint(point);
            SetEnabledPoints(currentShip);

            if (currentShip.Initialized)
            {
                if (currentShip.IsVertical)
                {
                    var top    = Buttons.First(n => n.Coordinates() == currentShip.Top);
                    var bottom = Buttons.First(n => n.Coordinates() == currentShip.Bottom);
                    top.Text    = "⎯";
                    bottom.Text = "⎯";
                }
                else
                {
                    var left  = Buttons.First(n => n.Coordinates() == currentShip.Left);
                    var right = Buttons.First(n => n.Coordinates() == currentShip.Right);
                    left.Text  = "|";
                    right.Text = "|";
                }

                currentShip = ships.FirstOrDefault(n => !n.Initialized);
                if (currentShip == null)
                {
                    Buttons.ForEach(n =>
                    {
                        n.IsEnabled       = true;
                        n.Clicked        -= SetShip;
                        n.Clicked        += Hit;
                        n.BackgroundColor = Color.White;
                    });
                    NotifyOfPropertyChange(() => Initialized);
                    StartGameAction?.Invoke();
                }
                else
                {
                    EnableEmpty();
                }
            }
        }
Exemplo n.º 6
0
    IEnumerator Start()
    {
        timerImage.gameObject.SetActive(true);
        float timeRemaining = CountdownTime;

        while (timeRemaining > 0)
        {
            yield return(EndOfFrame);

            timeRemaining -= Time.deltaTime;

            //interpolate timer image's fill amount from 1 to 0 over CountdownTime seconds
            timerImage.fillAmount = timeRemaining / CountdownTime;

            //change timer display text to show timeRemaining (rounded up)
            timerDisplay.text = Mathf.CeilToInt(timeRemaining).ToString();
        }

        StartGameAction?.Invoke();
        gameObject.SetActive(false);
    }
Exemplo n.º 7
0
    protected override void OnButtonClicked()
    {
        var startGameAction = new StartGameAction();

        ActionSystem.Instance.PerformAction(startGameAction);
    }
Exemplo n.º 8
0
 public async Task StartGame (string sessionId) {
   await Clients.Caller.SendAsync( "LogMessage", $"Received Request - StartGame ({sessionId})" );
   UserModel user = await userManager.GetUserAsync( Context.GetHttpContext().User );
   StartGameAction action = await gameActionService.StartGameAction( sessionId, user.UserId );
   await DoAction( action );
 }
        public async Task StartGameAction(StartGameAction _, IDispatcher dispatcher)
        {
            await Task.Delay(500);

            dispatcher.Dispatch(new SetExpectedElementAction(atomicNumber: GetRandomElementAtomicNumber()));
        }