private static void HandleAction(_DTO_frame_info dto)
        {
            int count = dto.actions.Length;

            for (int i = 0; i < count; i++)
            {
                _DTO_action_info action = dto.actions[i];

                if (action.sender == CPlayer.instance.rid)
                {
                    SyncEvent.HandleFrameAction();
                }

                FrameActionType type = ( FrameActionType )action.type;
                switch (type)
                {
                case FrameActionType.Move:
                {
                    lBattle.HandleBeginMove(action.sender, new FVec3(action.x, action.y, action.z));
                }
                break;

                case FrameActionType.UseItem:
                {
                    lBattle.HandleUseItem(action.sender);
                }
                break;
                }
            }
        }
Beispiel #2
0
            /// <summary>
            /// Initializes a new instance of the <see cref="FrameAction"/> structure.
            /// </summary>
            /// <param name="actionType">The type of frame action which this structure represents.</param>
            /// <param name="actionIndex">The index of the frame, update, or render on which to perform the action.</param>
            /// <param name="action">The action to perform on the specified frame.</param>
            public FrameAction(FrameActionType actionType, Int32 actionIndex, Delegate action)
            {
                Contract.Require(action, nameof(action));

                this.ActionType  = actionType;
                this.ActionIndex = actionIndex;
                this.Action      = action;
            }
Beispiel #3
0
        private static void HandleAction(_DTO_frame_info dto)
        {
            int count = dto.actions.Length;

            for (int i = 0; i < count; i++)
            {
                _DTO_action_info action = dto.actions[i];

                if (action.sender == VPlayer.instance.rid)
                {
                    SyncEvent.HandleFrameAction();
                }

                FrameActionType type = ( FrameActionType )action.type;
                switch (type)
                {
                case FrameActionType.Idle:
                    break;

                case FrameActionType.Move:
                {
                    lBattle.HandleMove(action.sender, new Vec3(action.x, action.y, action.z));
                }
                break;

                case FrameActionType.Track:
                {
                    lBattle.HandleTrack(action.sender, action.target);
                }
                break;

                case FrameActionType.UseSkill:
                {
                    Vector3 targetPoint = new Vector3(action.x, action.y, action.z);
                    lBattle.HandleUseSkill(action.sid, action.src, action.target, targetPoint.ToVec3());
                }
                break;

                case FrameActionType.Relive:
                {
                    lBattle.HandleRelive(action.sender);
                    break;
                }

                case FrameActionType.UpgradeSkill:
                {
                    lBattle.HandleUpgradeSkill(action.sender, action.target);
                    break;
                }
                }
            }
        }
Beispiel #4
0
        /// <summary>
        /// Runs the specified set of frame actions.
        /// </summary>
        private void RunFrameActions(FrameActionType actionType, Int32 actionIndex, UltravioletTime time)
        {
            if (frameActions == null)
            {
                return;
            }

            var actions = frameActions.Where(x => x.ActionType == actionType && (x.ActionIndex < 0 || x.ActionIndex == actionIndex));

            foreach (var action in actions)
            {
                switch (actionType)
                {
                case FrameActionType.FrameStart:
                    ((Action <IUltravioletTestApplication>)action.Action)(this);
                    break;

                default:
                    ((Action <IUltravioletTestApplication, UltravioletTime>)action.Action)(this, time);
                    break;
                }
            }
        }