protected override void SwitchToState(int newState, out ViewBase newView, out WizardState wizardState)
        {
            int oldState = this.State;
            IntermediateClassWizardModel model = (IntermediateClassWizardModel)this.Model;


            if (newState == 1)
            {
                model.Index    = 0;
                base.LastState = 2;
            }

            if (newState == 0)
            {
                base.LastState = 2;
                if (model.Index == 1)
                {
                    model.Index = 0;
                    newState    = 1;
                }
            }

            if (newState == 2)
            {
                model.Index    = 1;
                newState       = 1;
                base.LastState = 1;
            }
            base.SwitchToState(newState, out newView, out wizardState);
        }
Ejemplo n.º 2
0
        protected override void SwitchToState(int newState, out ViewBase newView, out WizardState wizardState)
        {
            int oldState                  = this.State;
            ForeignKeyWizModel model      = (ForeignKeyWizModel)this.Model;
            FkRelation         fkRelation = (FkRelation)model.RelationNode.Relation;

            if (fkRelation.RelationDirection == RelationDirection.DirectedToMe && newState == 1)
            {
                // skip state 1
                if (State == 0)
                {
                    newState = 2;
                }
                if (State == 2)
                {
                    newState = 0;
                }
            }
            if (fkRelation.RelationDirection == RelationDirection.DirectedFromMe && newState == 2)
            {
                // skip state 2
                if (State == 1)
                {
                    newState = 3;
                }
                if (State == 3)
                {
                    newState = 1;
                }
            }
            base.SwitchToState(newState, out newView, out wizardState);
        }
Ejemplo n.º 3
0
        void wizard_ActiveStepChanged(object sender, EventArgs e)
        {
            var wiz = (Wizard)sender;

            switch (wiz.ActiveStepIndex)
            {
            case 0:
                // set workspace list control selectedvalue and selectedindex
                break;

            case 1:
                NewWorkspaceTypeNameControl.Text    = WizardState.GetSelectedWorkspaceName();
                WorkspaceNewNameControl.Text        = WizardState.WorkspaceNewName;
                WorkspaceNewDescriptionControl.Text = WizardState.WorkspaceNewDescription;
                break;

            case 2:
                var setting      = WizardState;
                var headerString = String.Format(@"the wizard is creating your '{0}' workspace named '{1}'.", setting.GetSelectedWorkspaceName(), setting.WorkspaceNewName);
                ProgressHeaderLabel.Text = headerString;
                break;

            case 3:
                CreateNewWorkspace();
                break;
            }
        }
Ejemplo n.º 4
0
        protected virtual void SwitchToState(int newState, out ViewBase newView, out WizardState wizardState)
        {
//			int oldState = this.state;
            this.state = newState;
//System.Diagnostics.Debug.WriteLine(oldState.ToString() + "->" + state + "/" + lastState);
            if (frame != null)
            {
                int step = state + 1;
                frame.Text = title + " Step " + step.ToString();
            }

            newView = (ViewBase)Activator.CreateInstance((Type)viewTypes[state], new object[] { model });
            if (state == 0)
            {
                wizardState = WizardState.First;
                if (lastState == 0)
                {
                    wizardState &= (~WizardState.Next);
                    wizardState |= (WizardState.Finish);
                }
            }
            else if (state == lastState)
            {
                wizardState = WizardState.Last;
                if (lastState == 0)
                {
                    wizardState &= (~WizardState.Back);
                }
            }
            else
            {
                wizardState = WizardState.Middle;
            }
        }
Ejemplo n.º 5
0
        public CalibrationForm()
        {
            InitializeComponent();
            wizardState = WizardState.START;

            //bc.ctl.open();
        }
Ejemplo n.º 6
0
        private void IntializeStateTexts()
        {
            mCurrentState = WizardState.Introduction;

            // NOTE: The line returns are to reserve space for the label word wraps to work correctly.

            mStateHelpTexts[WizardState.Introduction] =
                "This simple wizard will walk you through the initial setup process for the SDK. " +
                "If you have any questions please visit our website (link below).\n\n";

            mStateHelpTexts[WizardState.Setup] =
                "The first step is to ensure that you have registered an account with KnetikCloud. " +
                "Once you have an account you must setup an application on the KnetikCloud website.\n\n";

            mStateHelpTexts[WizardState.AppName] =
                "Once you have created an application enter the name in the 'App Name' project setting field.\n\n";

            mStateHelpTexts[WizardState.ClientId] =
                "The next step is to create a client ID and enter it in the 'Client ID' project setting field.\n\n";

            mStateHelpTexts[WizardState.ClientCredentials] =
                "Optional: If the application is setup to use a client secret then enter it in the 'Client Secret' project setting field.\n\n";

            mStateHelpTexts[WizardState.UserCredentials] =
                "Optional: If the application is setup to use user id/passwords then enter your own user id/password combination in the 'User Credentials' settings section.\n\n";

            mStateHelpTexts[WizardState.MonoBehaviour] =
                "Once you have configured the project you need to add the 'KnetikClient' behaviour to an object in your game scene. " +
                "Once it is initialized it will fire a 'KnetikClientReadyResponseEvent'. " +
                "You can then access it via the KnetikClient.DefaultClient static member to authenticate via the provided API.\n\n\n\n";
        }
Ejemplo n.º 7
0
 public Wizard(Vector2 position, Texture2D image, Vector2 scale, List <Frame> frames, float JumpPower, TimeSpan frameRate)
     : base(frames, position, image, 0, scale, SpriteEffects.None, Color.White, frameRate)
 {
     jumpPower   = JumpPower;
     ground      = position.Y + FrameHeight / 2;
     wizardState = WizardState.Idle;
 }
Ejemplo n.º 8
0
    void DoCupRecover()
    {
        state = WizardState.Idle;
        motor.DoCupRecover();

        Invoke("NextDecision", 2.0f);
    }
Ejemplo n.º 9
0
    public override void PlayerPunched(int damage, PlayerPunch punch)
    {
        if (state == WizardState.PickingCups)
        {
            if (motor.IsRealCupInFront())
            {
                Invoke("DoCupRecover", 4.0f);

                motor.DoCupStun();
            }
            else
            {
                state = WizardState.Idle;
                DoScreenSweep();
            }
        }
        if (state == WizardState.CupStunned)
        {
            healthPool -= damage;
            healthBar.updateHealth(healthPool);
            CamShake.AddTrauma(0.2f);
            audioSource.PlayOneShot(hurtSound);

            if (healthPool < 0)
            {
                DoDie();
            }
            else
            {
                motor.DoCupHurt();
            }
        }
    }
Ejemplo n.º 10
0
        void SwitchToState(State newState, out ViewBase newView, out WizardState wizardState)
        {
            this.state = newState;
            switch (this.state)
            {
            case State.ConnectionType:
                newView     = new AssemblyWiz1(model);
                wizardState = WizardState.First;
                break;

            case State.ConnectionString:
                newView     = new AssemblyWiz2(model);
                wizardState = WizardState.Middle;
                break;

            case State.Namespace:
                newView     = new AssemblyWiz3(model);
                wizardState = WizardState.Middle;
                break;

            case State.ProjectDir:
                newView     = new AssemblyWiz2(model);
                wizardState = WizardState.Last;
                break;

            default:
                throw new Exception("Wrong state");
                break;
            }
        }
Ejemplo n.º 11
0
 public void Start(T data)
 {
     _data        = data;
     CurrentState = WizardState.InProgress;
     _currentStep = 0;
     _display.Clear();
     _steps[_currentStep].Initialize(_display, _font);
 }
Ejemplo n.º 12
0
 private void SetWizardState(WizardState value)
 {
     wizardState             = value;
     this.btnBack.Enabled    = (wizardState & WizardState.Back) != 0;
     this.btnForward.Enabled = (wizardState & WizardState.Next) != 0;
     this.btnCancel.Enabled  = (wizardState & WizardState.Cancel) != 0;
     this.btnFinish.Enabled  = (wizardState & WizardState.Finish) != 0;
 }
Ejemplo n.º 13
0
    public CastingWizardState(Wizard w, Ability a, WizardState ret) : base(w)
    {
        allowsmovement = false;

        allowsabilities = false;

        ab = a;

        returnstate = ret;
    }
Ejemplo n.º 14
0
    public CastIntoState(Wizard w, Ability a, WizardState s) : base(w)
    {
        allowsmovement = false;

        allowsabilities = false;

        nextstate = s;

        ab = a;
    }
Ejemplo n.º 15
0
    void DoCups()
    {
        player.ClearInputQueue();
        player.canPunch = false;
        player.canDodge = false;

        swaps = 0;
        state = WizardState.Cups;
        motor.DoCups();
    }
Ejemplo n.º 16
0
    void DoPickingCups()
    {
        state           = WizardState.PickingCups;
        player.canPunch = true;
        player.canDodge = true;

        swaps = 0;

        motor.SetSwapSpeed(0.2f, 0.4f, 0.4f);
        NextDecision();
    }
Ejemplo n.º 17
0
    public CastIntoEffect(Wizard w, Ability a, WizardEffect e, WizardState ret) : base(w)
    {
        allowsmovement = false;

        allowsabilities = false;

        effect = e;

        ab = a;

        retrn = ret;
    }
        private void StartOver()
        {
            this.panelContainer.Controls.Remove(this.authorizationForm);
            this.panelContainer.Controls.Remove(this.selectionForm);
            this.panelContainer.Controls.Remove(this.successForm);

            this.buttonNext.Text      = "Next";
            this.buttonNext.Enabled   = true;
            this.buttonCancel.Visible = true;
            this.wizardState          = WizardState.UrlEntry;
            this.panelContainer.Controls.Add(this.selectionForm);
        }
Ejemplo n.º 19
0
    // display valid movements
    public void DisplayMovement()
    {
        HideSpellTiles();
        int movementValue = m_CurrentTile.m_Value;         // get movement value for turn

        // check wether movement is within boundaries, and whether next tile in all 4 directions is valid
        if (m_CurrentX + movementValue < 5 &&
            !m_TileMap [m_CurrentY].m_Tiles [m_CurrentX + movementValue].GetComponent <TileManager>().m_Player&&
            m_TileMap [m_CurrentY].m_Tiles [m_CurrentX + movementValue].GetComponent <TileManager>().m_Value < 5 &&
            m_TileMap [m_CurrentY].m_Tiles [m_CurrentX + movementValue].GetComponent <TileManager>().m_Value > 0)
        {
            m_MovementIndicators [0].transform.position = m_TileMap [m_CurrentY].m_Tiles [m_CurrentX + movementValue].transform.position;
            m_MovementIndicators [0].gameObject.SetActive(true);
        }
        if (m_CurrentX - movementValue >= 0 &&
            !m_TileMap [m_CurrentY].m_Tiles [m_CurrentX - movementValue].GetComponent <TileManager>().m_Player&&
            m_TileMap [m_CurrentY].m_Tiles [m_CurrentX - movementValue].GetComponent <TileManager>().m_Value < 5 &&
            m_TileMap [m_CurrentY].m_Tiles [m_CurrentX - movementValue].GetComponent <TileManager>().m_Value > 0)
        {
            m_MovementIndicators [1].transform.position = m_TileMap [m_CurrentY].m_Tiles [m_CurrentX - movementValue].transform.position;
            m_MovementIndicators [1].gameObject.SetActive(true);
        }
        if (m_CurrentY + movementValue < 5 &&
            !m_TileMap [m_CurrentY + movementValue].m_Tiles [m_CurrentX].GetComponent <TileManager>().m_Player&&
            m_TileMap [m_CurrentY + movementValue].m_Tiles [m_CurrentX].GetComponent <TileManager>().m_Value < 5 &&
            m_TileMap [m_CurrentY + movementValue].m_Tiles [m_CurrentX].GetComponent <TileManager>().m_Value > 0)
        {
            m_MovementIndicators [2].transform.position = m_TileMap [m_CurrentY + movementValue].m_Tiles [m_CurrentX].transform.position;
            m_MovementIndicators [2].gameObject.SetActive(true);
        }
        if (m_CurrentY - movementValue >= 0 &&
            !m_TileMap [m_CurrentY - movementValue].m_Tiles [m_CurrentX].GetComponent <TileManager>().m_Player&&
            m_TileMap [m_CurrentY - movementValue].m_Tiles [m_CurrentX].GetComponent <TileManager>().m_Value < 5 &&
            m_TileMap [m_CurrentY - movementValue].m_Tiles [m_CurrentX].GetComponent <TileManager>().m_Value > 0)
        {
            m_MovementIndicators [3].transform.position = m_TileMap [m_CurrentY - movementValue].m_Tiles [m_CurrentX].transform.position;
            m_MovementIndicators [3].gameObject.SetActive(true);
        }

        // if any movements are valid, return
        foreach (GameObject movement in m_MovementIndicators)
        {
            if (movement.activeInHierarchy)
            {
                return;
            }
        }

        // if no movements are valid, game over for player
        m_AudioPlayer.PlayOneShot(m_DeathSound);
        m_State = WizardState.Dead;
        m_Manager.GameOver();
    }
Ejemplo n.º 20
0
        public override void Update(GameTime gameTime)
        {
            keyboardState = Keyboard.GetState();
            if (keyboardState.IsKeyDown(Keys.D) || keyboardState.IsKeyDown(Keys.Right))
            {
                if (prevKeyboardState.IsKeyUp(Keys.A) || prevKeyboardState.IsKeyUp(Keys.Left))
                {
                    spriteEffects = SpriteEffects.None;
                    wizardState   = WizardState.Walking;
                }
            }
            else if (keyboardState.IsKeyDown(Keys.A) || keyboardState.IsKeyDown(Keys.Left))
            {
                spriteEffects = SpriteEffects.FlipHorizontally;
                wizardState   = WizardState.Walking;


                if (prevKeyboardState.IsKeyUp(Keys.D) || prevKeyboardState.IsKeyUp(Keys.Right))
                {
                    spriteEffects = SpriteEffects.FlipHorizontally;
                }
            }
            else
            {
                wizardState = WizardState.Idle;
            }
            if (!isAir && keyboardState.IsKeyDown(Keys.Space))
            {
                wizardState = WizardState.Jumping;
                speed       = jumpPower;
                isAir       = true;
            }



            if (isAir)
            {
                Position.Y -= speed;
                speed      -= gravity;

                if (Position.Y + FrameHeight / 2 > ground)
                {
                    Position.Y = ground - FrameHeight / 2;
                    isAir      = false;
                }
            }

            if (wizardState.Equals(WizardState.Jumping) || wizardState.Equals(WizardState.Walking))
            {
                base.Update(gameTime);
            }
        }
Ejemplo n.º 21
0
        public void Back(out ViewBase newView, out WizardState wizardState)
        {
            switch (state)
            {
            case State.ProjectDir:
                SwitchToState(State.ConnectionString, out newView, out wizardState);
                break;

            default:
                throw new Exception("Wrong state");
                break;
            }
        }
Ejemplo n.º 22
0
        public Wizard(PiTopModule module, IWizardStep <T>[] steps)
        {
            _steps   = steps;
            _display = module.Display;

            module.UpButton.PressedChanged += (sender, pressed) => {
                if (pressed)
                {
                    steps[_currentStep].Up();
                }
            };

            module.DownButton.PressedChanged += (sender, pressed) => {
                if (pressed)
                {
                    steps[_currentStep].Down();
                }
            };

            module.SelectButton.PressedChanged += (sender, pressed) => {
                steps[_currentStep].Confirm(_data);
                var nextStep = _currentStep + 1;
                if (nextStep < steps.Length)
                {
                    _currentStep = nextStep;
                    steps[_currentStep].Initialize(_display, _font);
                }
                else
                {
                    _display.Draw((context, cr) => {
                        context.Clear(Color.Black);
                        var rect = TextMeasurer.Measure("Done!", new RendererOptions(_font));
                        var x    = 1;
                        var y    = 1;
                        context.DrawText("Done!", _font, Color.Aqua, new PointF(x, y));
                    });
                    CurrentState = WizardState.Completed;
                }
            };

            module.CancelButton.PressedChanged += (sender, pressed) => {
                _display.Draw((context, cr) => {
                    context.Clear(Color.Black);
                    var rect = TextMeasurer.Measure("Cancelled.", new RendererOptions(_font));
                    var x    = 1;
                    var y    = 1;
                    context.DrawText("Cancelled.", _font, Color.Aqua, new PointF(x, y));
                });
                CurrentState = WizardState.Cancelled;
            };
        }
Ejemplo n.º 23
0
    // Update is called once per frame
    void Update()
    {
        // select animation set
        switch (m_State)
        {
        case WizardState.Idle:
            // idle animation loops
            m_IdleAnimation.enabled    = true;
            m_DeathAnimation.enabled   = false;
            m_MovingAnimation.enabled  = false;
            m_CastingAnimation.enabled = false;
            break;

        case WizardState.Casting:
            m_CastingAnimation.enabled = true;
            m_DeathAnimation.enabled   = false;
            m_MovingAnimation.enabled  = false;
            m_IdleAnimation.enabled    = false;

            // casting animation reverts to idle when done
            if (m_CastingAnimation.m_AnimationFinished)
            {
                m_State = WizardState.Idle;
            }

            break;

        case WizardState.Moving:
            m_MovingAnimation.enabled  = true;
            m_DeathAnimation.enabled   = false;
            m_IdleAnimation.enabled    = false;
            m_CastingAnimation.enabled = false;

            // moving animation reverts to idle when done
            if (m_MovingAnimation.m_AnimationFinished)
            {
                m_State = WizardState.Idle;
            }
            break;

        case WizardState.Dead:
            // death animation stops after one loop
            m_DeathAnimation.enabled   = true;
            m_MovingAnimation.enabled  = false;
            m_IdleAnimation.enabled    = false;
            m_CastingAnimation.enabled = false;
            break;
        }
    }
Ejemplo n.º 24
0
 /// <summary>
 /// Sets the wizard state flag.
 /// </summary>
 protected void SetState()
 {
     if (_pluginList.Count - 1 == _position)
     {
         _state = WizardState.End;
     }
     else if (_position == 0)
     {
         _state = WizardState.Start;
     }
     else
     {
         _state = WizardState.Middle;
     }
 }
        public void SaveWizardState(WizardState <WizardStep> state)
        {
            var user = manager.GetUserAsync(this.httpContextAccessor.HttpContext.User).Result;

            if (user == null)
            {
                throw new UnauthorizedAccessException();
            }

            var json = JsonConvert.SerializeObject(state);

            user.WizardState = json;
            IdentityResult result = this.manager.UpdateAsync(user).Result;

            this.context.SaveChanges();
        }
Ejemplo n.º 26
0
        protected override void SwitchToState(int newState, out ViewBase newView, out WizardState wizardState)
        {
            int oldState = this.State;
            IntermediateTableWizardModel model = (IntermediateTableWizardModel)this.Model;
            RelationDirection            dir   = model.IntermediateTableNode.IntermediateTable[0].RelationDirection;

            if (dir == RelationDirection.DirectedFromMe)
            {
                base.LastState = 2;
            }
            else
            {
                base.LastState = 3;
            }

            // State 2 is shared, state 3 is a dummy.
            // State 2: Index = 0
            // State 3: Index = 1
            if (newState == 2)             // means: State == 1
            {
                if (dir == RelationDirection.DirectedToMe)
                {
                    // Skip State 2, Index 0
                    model.Index    = 1;
                    base.LastState = 2;
                }
                else
                {
                    model.Index = 0;
                }
            }

            if (newState == 1 && State == 2 && model.Index == 1 && dir != RelationDirection.DirectedToMe)
            {
                newState    = 2;
                model.Index = 0;
            }

            if (newState == 3)
            {
// dir == RelationDirection.DirectedFromMe shouldn't occur
                newState       = 2;
                model.Index    = 1;
                base.LastState = 2;
            }
            base.SwitchToState(newState, out newView, out wizardState);
        }
Ejemplo n.º 27
0
    void SwitchState()
    {
        switch (currentState)
        {
        case WizardState.STATE_CALM:
            if (HP * 2 == MaxHP)
            {
                nextState = WizardState.STATE_ANGRY;
                animator.SetBool("Angry", true);
            }
            break;

        case WizardState.STATE_ANGRY:
            break;
        }
        currentState = nextState;
    }
Ejemplo n.º 28
0
    public void Move(int x, int y)
    {
        // grab reference to next tile
        TileManager nextTile = m_TileMap [y].m_Tiles[x].GetComponent <TileManager> ();

        // previous tile no longer contains a player
        m_CurrentTile.m_Player = false;

        // move to new square
        this.transform.position = nextTile.transform.position;
        nextTile.m_Player       = true;
        m_CurrentTile           = nextTile;
        m_CurrentX = x;
        m_CurrentY = y;
        m_State    = WizardState.Moving;      // trigger animation

        m_AudioPlayer.PlayOneShot(m_MoveSound);
        DisplaySpellTiles();          // go to next stage
    }
Ejemplo n.º 29
0
        public void Next(out ViewBase newView, out WizardState wizardState)
        {
            switch (state)
            {
            case State.ConnectionType:
                SwitchToState(State.ConnectionString, out newView, out wizardState);
                break;

            case State.ConnectionString:
                SwitchToState(State.Namespace, out newView, out wizardState);
                break;

            case State.Namespace:
                SwitchToState(State.ProjectDir, out newView, out wizardState);
                break;

            default:
                throw new Exception("Wrong state");
                break;
            }
        }
Ejemplo n.º 30
0
 void Awake()
 {
     calledOnce            = true;
     doOnce                = false;
     animator              = (Animator)gameObject.GetComponent <Animator>();
     m_RigidBody2D         = (Rigidbody2D)gameObject.GetComponent <Rigidbody2D>();
     pouch                 = (GoldPouch)gameObject.GetComponent <GoldPouch>();
     RecoverTimer          = 0;
     recoveryDone          = true;
     AttackTimer           = 0;
     ShootCoolDownInterval = 0;
     fireBalls             = 0;
     GroundPounds          = 0;
     facingRight           = false;
     prevFace              = false;
     initPosition          = gameObject.transform;
     currentState          = WizardState.STATE_CALM;
     nextState             = currentState;
     currentAttackState    = WizardAttackState.STATE_RECOVERY;
     nextAttackState       = WizardAttackState.STATE_RECOVERY;
 }
Ejemplo n.º 31
0
 public StartPageViewModel(WizardState state)
 {
     _state = state;
 }
Ejemplo n.º 32
0
 public FinishPageViewModel(WizardState state)
 {
     State = state;
 }
 public EventStoreConnectionPageViewModel(WizardState state)
 {
     _state = state;
 }