Inheritance: EventStep
コード例 #1
0
        /// <summary>
        /// 完成图像处理.
        /// </summary>
        /// <returns> 是否处理完毕, 返回 False 的情况下,表示还有后续处理. </returns>
        public override bool DoImageSwitch()
        {
            switch (this.rotationStep)
            {
            case RotationStep.LargeToSmall:
                // 从大到小.
                DoFromLargeToSmall();
                return(false);


            case RotationStep.ChangeImage:
                // 切换图片.
                SwitchImage();
                // 进入下一个阶段
                this.rotationStep = RotationStep.SmallToLarge;
                return(false);


            case RotationStep.SmallToLarge:
                // 从小到大.
                DoFromSmallToLarge();
                return(false);
            }

            return(true);
        }
コード例 #2
0
        /// <summary>
        /// 完成图像处理.
        /// </summary>
        /// <returns> 是否处理完毕, 返回 False 的情况下,表示还有后续处理. </returns>
        public override bool DoImageSwitch()
        {
            switch (this.rotationStep)
            {
                case RotationStep.LargeToSmall:
                    // 从大到小.
                    DoFromLargeToSmall();
                    return false;

                case RotationStep.ChangeImage:
                    // 切换图片.
                    SwitchImage();
                    // 进入下一个阶段
                    this.rotationStep = RotationStep.SmallToLarge;
                    return false;

                case RotationStep.SmallToLarge:
                    // 从小到大.
                    DoFromSmallToLarge();
                    return false;

            }

            return true;
        }
コード例 #3
0
        /// <summary>
        /// 初始化其他数据.
        /// </summary>
        protected override void InitOtherData()
        {
            // 初始情况下,需要调整为 “从大变小”
            rotationStep = RotationStep.LargeToSmall;

            // 旋转的情况下, 前景图片需要放到前面.
            ForePictureBox.BringToFront();


            // 旋转的模式下, 需要调整图像的 显示模式.
            this.ForePictureBox.SizeMode = PictureBoxSizeMode.StretchImage;
            this.BackPictureBox.SizeMode = PictureBoxSizeMode.StretchImage;
        }
コード例 #4
0
 public override void WriteXml(XmlWriter writer)
 {
     base.WriteXml(writer);
     writer.WriteElementString("KnobImage", KnobImage);
     writer.WriteElementString("RotationStep", RotationStep.ToString(CultureInfo.InvariantCulture));
     writer.WriteElementString("StepValue", StepValue.ToString(CultureInfo.InvariantCulture));
     writer.WriteElementString("InitialRotation", InitialRotation.ToString(CultureInfo.InvariantCulture));
     writer.WriteStartElement("ClickType");
     writer.WriteElementString("Type", ClickType.ToString());
     if (ClickType != ClickType.Touch)
     {
         writer.WriteElementString("Sensitivity", Sensitivity.ToString(CultureInfo.InvariantCulture));
     }
     writer.WriteEndElement();
 }
コード例 #5
0
 private async Task AnimateRotationStepAsync(RotationStep step)
 {
     await AnimateRotatingTilesAsync(step.MovedTiles, step.Pivot, step.RotationSense);
 }
コード例 #6
0
ファイル: GameEvent.cs プロジェクト: hughrogers/RPGQuest
    public EventStep TypeToStep(GameEventType t)
    {
        EventStep s = null;

        if(GameEventType.WAIT.Equals(t)) s = new WaitStep(t);
        else if(GameEventType.GO_TO.Equals(t)) s = new GoToStep(t);
        else if(GameEventType.RANDOM_STEP.Equals(t)) s = new RandomStep(t);
        else if(GameEventType.CHECK_RANDOM.Equals(t)) s = new CheckRandomStep(t);
        else if(GameEventType.CHECK_FORMULA.Equals(t)) s = new CheckFormulaStep(t);
        else if(GameEventType.END_EVENT.Equals(t)) s = new EndEventStep(t);
        else if(GameEventType.LOAD_SCENE.Equals(t)) s = new LoadSceneStep(t);
        else if(GameEventType.WAIT_FOR_BUTTON.Equals(t)) s = new WaitForButtonStep(t);
        else if(GameEventType.CHECK_DIFFICULTY.Equals(t)) s = new CheckDifficultyStep(t);
        // spawn steps
        else if(GameEventType.SPAWN_PLAYER.Equals(t)) s = new SpawnPlayerStep(t);
        else if(GameEventType.DESTROY_PLAYER.Equals(t)) s = new DestroyPlayerStep(t);
        else if(GameEventType.SPAWN_PREFAB.Equals(t)) s = new SpawnPrefabStep(t);
        else if(GameEventType.DESTROY_PREFAB.Equals(t)) s = new DestroyPrefabStep(t);
        else if(GameEventType.TELEPORT.Equals(t)) s = new TeleportStep(t);
        // dialogue steps
        else if(GameEventType.SHOW_DIALOGUE.Equals(t)) s = new ShowDialogueStep(t);
        else if(GameEventType.SHOW_CHOICE.Equals(t)) s = new ShowChoiceStep(t);
        else if(GameEventType.TELEPORT_CHOICE.Equals(t)) s = new TeleportChoiceStep(t);
        // function steps
        else if(GameEventType.SEND_MESSAGE.Equals(t)) s = new SendMessageStep(t);
        else if(GameEventType.BROADCAST_MESSAGE.Equals(t)) s = new BroadcastMessageStep(t);
        else if(GameEventType.ADD_COMPONENT.Equals(t)) s = new AddComponentStep(t);
        else if(GameEventType.REMOVE_COMPONENT.Equals(t)) s = new RemoveComponentStep(t);
        else if(GameEventType.ACTIVATE_OBJECT.Equals(t)) s = new ActivateObjectStep(t);
        else if(GameEventType.OBJECT_VISIBLE.Equals(t)) s = new ObjectVisibleStep(t);
        else if(GameEventType.PARENT_OBJECT.Equals(t)) s = new ParentObjectStep(t);
        else if(GameEventType.CALL_GLOBAL_EVENT.Equals(t)) s = new CallGlobalEventStep(t);
        // statistic steps
        else if(GameEventType.CUSTOM_STATISTIC.Equals(t)) s = new CustomStatisticStep(t);
        else if(GameEventType.CLEAR_STATISTIC.Equals(t)) s = new ClearStatisticStep(t);
        // camera steps
        else if(GameEventType.SET_CAMERA_POSITION.Equals(t)) s = new SetCamPosStep(t);
        else if(GameEventType.FADE_CAMERA_POSITION.Equals(t)) s = new FadeCamPosStep(t);
        else if(GameEventType.SET_INITIAL_CAMPOS.Equals(t)) s = new SetInitialCamPosStep(t);
        else if(GameEventType.FADE_TO_INITIAL_CAMPOS.Equals(t)) s = new FadeToInitialCamPosStep(t);
        else if(GameEventType.SHAKE_CAMERA.Equals(t)) s = new ShakeCameraStep(t);
        else if(GameEventType.ROTATE_CAMERA_AROUND.Equals(t)) s = new RotateCamAroundStep(t);
        // move steps
        else if(GameEventType.SET_TO_POSITION.Equals(t)) s = new SetToPositionStep(t);
        else if(GameEventType.MOVE_TO_WAYPOINT.Equals(t)) s = new MoveToWaypointStep(t);
        else if(GameEventType.MOVE_TO_DIRECTION.Equals(t)) s = new MoveToDirectionStep(t);
        else if(GameEventType.MOVE_TO_PREFAB.Equals(t)) s = new MoveToPrefabStep(t);
        // rotate steps
        else if(GameEventType.ROTATE_TO_WAYPOINT.Equals(t)) s = new RotateToWaypointStep(t);
        else if(GameEventType.ROTATION.Equals(t)) s = new RotationStep(t);
        // animation steps
        else if(GameEventType.PLAY_ANIMATION.Equals(t)) s = new PlayAnimationStep(t);
        else if(GameEventType.STOP_ANIMATION.Equals(t)) s = new StopAnimationStep(t);
        // audio steps
        else if(GameEventType.PLAY_SOUND.Equals(t)) s = new PlaySoundStep(t);
        else if(GameEventType.STOP_SOUND.Equals(t)) s = new StopSoundStep(t);
        else if(GameEventType.PLAY_MUSIC.Equals(t)) s = new PlayMusicStep(t);
        else if(GameEventType.STORE_MUSIC.Equals(t)) s = new StoreMusicStep(t);
        // fade steps
        else if(GameEventType.FADE_OBJECT.Equals(t)) s = new FadeObjectStep(t);
        else if(GameEventType.FADE_CAMERA.Equals(t)) s = new FadeCameraStep(t);
        // item steps
        else if(GameEventType.ADD_ITEM.Equals(t)) s = new AddItemStep(t);
        else if(GameEventType.REMOVE_ITEM.Equals(t)) s = new RemoveItemStep(t);
        else if(GameEventType.CHECK_ITEM.Equals(t)) s = new CheckItemStep(t);
        else if(GameEventType.LEARN_ITEM_RECIPE.Equals(t)) s = new LearnItemRecipeStep(t);
        else if(GameEventType.ITEM_RECIPE_KNOWN.Equals(t)) s = new ItemRecipeKnownStep(t);
        // weapon steps
        else if(GameEventType.ADD_WEAPON.Equals(t)) s = new AddWeaponStep(t);
        else if(GameEventType.REMOVE_WEAPON.Equals(t)) s = new RemoveWeaponStep(t);
        else if(GameEventType.CHECK_WEAPON.Equals(t)) s = new CheckWeaponStep(t);
        // armor steps
        else if(GameEventType.ADD_ARMOR.Equals(t)) s = new AddArmorStep(t);
        else if(GameEventType.REMOVE_ARMOR.Equals(t)) s = new RemoveArmorStep(t);
        else if(GameEventType.CHECK_ARMOR.Equals(t)) s = new CheckArmorStep(t);
        // money steps
        else if(GameEventType.ADD_MONEY.Equals(t)) s = new AddMoneyStep(t);
        else if(GameEventType.REMOVE_MONEY.Equals(t)) s = new RemoveMoneyStep(t);
        else if(GameEventType.SET_MONEY.Equals(t)) s = new SetMoneyStep(t);
        else if(GameEventType.CHECK_MONEY.Equals(t)) s = new CheckMoneyStep(t);
        // party steps
        else if(GameEventType.JOIN_PARTY.Equals(t)) s = new JoinPartyStep(t);
        else if(GameEventType.LEAVE_PARTY.Equals(t)) s = new LeavePartyStep(t);
        else if(GameEventType.IS_IN_PARTY.Equals(t)) s = new IsInPartyStep(t);
        else if(GameEventType.HAS_LEFT_PARTY.Equals(t)) s = new HasLeftPartyStep(t);
        else if(GameEventType.CHECK_PLAYER.Equals(t)) s = new CheckPlayerStep(t);
        else if(GameEventType.SET_PLAYER.Equals(t)) s = new SetPlayerStep(t);
        else if(GameEventType.SET_CHARACTER_NAME.Equals(t)) s = new SetCharacterNameStep(t);
        // battle party steps
        else if(GameEventType.JOIN_BATTLE_PARTY.Equals(t)) s = new JoinBattlePartyStep(t);
        else if(GameEventType.LEAVE_BATTLE_PARTY.Equals(t)) s = new LeaveBattlePartyStep(t);
        else if(GameEventType.IS_IN_BATTLE_PARTY.Equals(t)) s = new IsInBattlePartyStep(t);
        else if(GameEventType.LOCK_BP_MEMBER.Equals(t)) s = new LockBattlePartyMemberStep(t);
        else if(GameEventType.UNLOCK_BP_MEMBER.Equals(t)) s = new UnlockBattlePartyMemberStep(t);
        else if(GameEventType.IS_LOCKED_BP_MEMBER.Equals(t)) s = new IsLockedBattlePartyMemberStep(t);
        // skill steps
        else if(GameEventType.LEARN_SKILL.Equals(t)) s = new LearnSkillStep(t);
        else if(GameEventType.FORGET_SKILL.Equals(t)) s = new ForgetSkillStep(t);
        else if(GameEventType.HAS_SKILL.Equals(t)) s = new HasSkillStep(t);
        // equip steps
        else if(GameEventType.EQUIP_WEAPON.Equals(t)) s = new EquipWeaponStep(t);
        else if(GameEventType.EQUIP_ARMOR.Equals(t)) s = new EquipArmorStep(t);
        else if(GameEventType.UNEQUIP.Equals(t)) s = new UnequipStep(t);
        // status steps
        else if(GameEventType.REGENERATE.Equals(t)) s = new RegenerateStep(t);
        else if(GameEventType.CHECK_STATUS_VALUE.Equals(t)) s = new CheckStatusValueStep(t);
        else if(GameEventType.SET_STATUS_VALUE.Equals(t)) s = new SetStatusValueStep(t);
        else if(GameEventType.CHANGE_STATUS_EFFECT.Equals(t)) s = new ChangeStatusEffectStep(t);
        else if(GameEventType.LEVEL_UP.Equals(t)) s = new LevelUpStep(t);
        else if(GameEventType.CHECK_LEVEL.Equals(t)) s = new CheckLevelStep(t);
        // class steps
        else if(GameEventType.CHECK_CLASS.Equals(t)) s = new CheckClassStep(t);
        else if(GameEventType.CHANGE_CLASS.Equals(t)) s = new ChangeClassStep(t);
        //  variable steps
        else if(GameEventType.SET_VARIABLE.Equals(t)) s = new SetVariableStep(t);
        else if(GameEventType.REMOVE_VARIABLE.Equals(t)) s = new RemoveVariableStep(t);
        else if(GameEventType.CHECK_VARIABLE.Equals(t)) s = new CheckVariableStep(t);
        else if(GameEventType.SET_NUMBER_VARIABLE.Equals(t)) s = new SetNumberVariableStep(t);
        else if(GameEventType.REMOVE_NUMBER_VARIABLE.Equals(t)) s = new RemoveNumberVariableStep(t);
        else if(GameEventType.CHECK_NUMBER_VARIABLE.Equals(t)) s = new CheckNumberVariableStep(t);
        else if(GameEventType.SET_PLAYERPREFS.Equals(t)) s = new SetPlayerPrefsStep(t);
        else if(GameEventType.GET_PLAYERPREFS.Equals(t)) s = new GetPlayerPrefsStep(t);
        else if(GameEventType.HAS_PLAYERPREFS.Equals(t)) s = new HasPlayerPrefsStep(t);

        return s;
    }
コード例 #7
0
        /// <summary>
        /// 初始化其他数据.
        /// </summary>
        protected override void InitOtherData()
        {
            // 初始情况下,需要调整为 “从大变小”
            rotationStep = RotationStep.LargeToSmall;

            // 旋转的情况下, 前景图片需要放到前面.
            ForePictureBox.BringToFront();

            // 旋转的模式下, 需要调整图像的 显示模式.
            this.ForePictureBox.SizeMode = PictureBoxSizeMode.StretchImage;
            this.BackPictureBox.SizeMode = PictureBoxSizeMode.StretchImage;
        }