Ejemplo n.º 1
0
        public static ClientMovementResults DeSerializeClientMovementResultsFromStream(Component context,
                                                                                       ref IBitStream stream)
        {
            sbyte invalidActorIndex = (sbyte)ActorData.s_invalidActorIndex;

            stream.Serialize(ref invalidActorIndex);
            var   triggeringPath   = MovementUtils.DeSerializeLightweightPath(context, stream);
            var   seqStartDataList = DeSerializeSequenceStartDataListFromStream(ref stream);
            sbyte num = 0;

            stream.Serialize(ref num);
            var gameplayResponseType             = (MovementResults_GameplayResponseType)num;
            ClientEffectResults  effectResults   = null;
            ClientBarrierResults barrierResults  = null;
            ClientAbilityResults powerupResults  = null;
            ClientAbilityResults gameModeResults = null;

            switch (gameplayResponseType)
            {
            case MovementResults_GameplayResponseType.Effect:
                effectResults = DeSerializeClientEffectResultsFromStream(context, ref stream);
                break;

            case MovementResults_GameplayResponseType.Barrier:
                barrierResults = DeSerializeClientBarrierResultsFromStream(context, ref stream);
                break;

            case MovementResults_GameplayResponseType.Powerup:
                powerupResults = DeSerializeClientAbilityResultsFromStream(context, ref stream);
                break;

            case MovementResults_GameplayResponseType.GameMode:
                gameModeResults = DeSerializeClientAbilityResultsFromStream(context, ref stream);
                break;
            }

            return(new ClientMovementResults(context.GameFlowData.FindActorByActorIndex(invalidActorIndex),
                                             triggeringPath, seqStartDataList, effectResults, barrierResults, powerupResults, gameModeResults));
        }