public static BattleInstructionBase Deserializetion(byte[] byteArray, ref int index)
        {
            if (byteArray.Length < SelfSerializationByteLength)
            {
                return(null);
            }
            int sceneUnitId = SerializeUtils.ReadInt(byteArray, ref index);
            BattleInstructionType instructionType = (BattleInstructionType)SerializeUtils.ReadByte(byteArray, ref index);
            BattleInstructionBase ret             = null;

            switch (instructionType)
            {
            case BattleInstructionType.Move:
                ret = BattleMove.Deserialize(byteArray, ref index);
                break;

            case BattleInstructionType.StopMove:
                ret = BattleStopMove.Deserialize(byteArray, ref index);
                break;

            case BattleInstructionType.NoTargetSkill:
                ret = BattleNoTargetSkill.Deserialize(byteArray, ref index);
                break;

            case BattleInstructionType.UnitTargetSkill:
                ret = BattleUnitTargetSkill.Deserialize(byteArray, ref index);
                break;

            case BattleInstructionType.AreaTargetSkill:
                ret = BattleAreaTargetSkill.Deserialize(byteArray, ref index);
                break;

            default:

                break;
            }
            if (null != ret)
            {
                ret.SceneUnitId = sceneUnitId;
            }
            return(ret);
        }
        public static RpBattleInstructionList Deserialization(Dictionary <byte, object> parameters)
        {
            byte[] byteArray = parameters[1] as byte[];
            if (byteArray == null || byteArray.Length < 7)
            {
                return(null);
            }

            List <BattleInstructionBase> instructionList = new List <BattleInstructionBase>();

            int   index            = 0;
            int   frameCount       = SerializeUtils.ReadInt(byteArray, ref index);
            short instructionCount = SerializeUtils.ReadShort(byteArray, ref index);
            bool  isFrameFinish    = SerializeUtils.ReadBool(byteArray, ref index);

            RpBattleInstructionList retBattleInstruction = new RpBattleInstructionList(frameCount, instructionList, isFrameFinish);

            for (int i = 0; i < instructionCount; ++i)
            {
                BattleInstructionBase instruction = BattleInstructionBase.Deserializetion(byteArray, ref index);
                instructionList.Add(instruction);
            }
            return(retBattleInstruction);
        }