コード例 #1
0
        public void EndTurn()
        {
            m_CurrentTurnStep = TurnStep.Move;
            m_LowestTurnStep  = TurnStep.None;

            SwitchCurrentPlayer();
        }
コード例 #2
0
        public TurnState(MatchState match, string firstToMoveId)
        {
            m_PlayerOneId = match.PlayerOne.AccountIdentity;
            m_PlayerTwoId = match.PlayerTwo.AccountIdentity;

            SetCurrentPlayer(firstToMoveId);

            m_CurrentTurnStep = TurnStep.Move;
        }
コード例 #3
0
        public void SetCurrentStep(TurnStep turnStep)
        {
            if (m_LowestTurnStep < turnStep)
            {
                m_LowestTurnStep  = m_CurrentTurnStep;
                m_CurrentTurnStep = turnStep;
            }

            if (turnStep == TurnStep.End)
            {
                EndTurn();
            }
        }
コード例 #4
0
        public TurnState(string playerOneId, string playerTwoId)
        {
            m_PlayerOneId = playerOneId;
            m_PlayerTwoId = playerTwoId;

            if (RandomBoolean())
            {
                SetCurrentPlayer(m_PlayerOneId);
            }
            else
            {
                SetCurrentPlayer(m_PlayerTwoId);
            }

            m_CurrentTurnStep = TurnStep.Move;
        }
コード例 #5
0
ファイル: Actor.cs プロジェクト: SimianLogic/LD29_LakeMonster
    public virtual void handleTurnStep(TurnStep step, float dt)
    {
        if (prevScale > nextScale)
        {
            this.scaleX = Mathf.Max(nextScale, this.scaleX - dt / step.durationInSeconds);
        }
        else
        {
            this.scaleX = Mathf.Min(nextScale, this.scaleX + dt / step.durationInSeconds);
        }

        if (this.scaleX == nextScale)
        {
            nextStep();
        }
    }
コード例 #6
0
    internal static void UpdateTurnState(TurnStep step)
    {
        if (TestMode)
        {
            CurrentTurnState.SetCurrentStep(step);
            return;
        }

        if (CurrentTurnState == null)
        {
            Debug.LogFormat("Attempting To Update Null Turn State For Match ({0})", CurrentMatch.MatchIdentity);
            return;
        }

        if (CurrentTurnState.LowestTurnStep < step)
        {
            ClientManager.Instance.SendTurnUpdateCommand(CurrentMatch.MatchIdentity, (int)step);
        }
    }
コード例 #7
0
    internal void HandleTurnStepChange(TurnStep turnStep)
    {
        switch (turnStep)
        {
        case TurnStep.End:
        {
            if (!IsActivelyEngaged)
            {
                m_ParentBoard.ClearCurrentSelections();
                m_Handler.ClearFocusPiece();
            }
            break;
        }

        default:
        {
            Debug.LogFormat("Turn Step Case Invalid: {0}", turnStep.ToString());
            break;
        }
        }
    }
コード例 #8
0
 public void SetLowestTurnStep(TurnStep turnStep)
 {
     m_LowestTurnStep = turnStep;
 }