Exemplo n.º 1
0
        public void SwapEffectsToStart(ClientActorHitResults other)
        {
            List <ClientEffectStartData> effectsToStart = m_effectsToStart;

            m_effectsToStart       = other.m_effectsToStart;
            other.m_effectsToStart = effectsToStart;
        }
Exemplo n.º 2
0
        public static Dictionary <ActorData, ClientActorHitResults> DeSerializeActorHitResultsDictionaryFromStream(
            Component context, ref IBitStream stream)
        {
            var   dictionary = new Dictionary <ActorData, ClientActorHitResults>();
            sbyte num        = 0;

            stream.Serialize(ref num);
            for (var index = 0; index < (int)num; ++index)
            {
                sbyte invalidActorIndex = (sbyte)ActorData.s_invalidActorIndex;
                stream.Serialize(ref invalidActorIndex);
                ActorData actorByActorIndex     = context.GameFlowData.FindActorByActorIndex(invalidActorIndex);
                var       clientActorHitResults = new ClientActorHitResults(context, ref stream);
                if (actorByActorIndex != null)
                {
                    dictionary.Add(actorByActorIndex, clientActorHitResults);
                }
            }

            return(dictionary);
        }
Exemplo n.º 3
0
        public void AdjustKnockbackCounts_ClientEffectResults(
            ref Dictionary <ActorData, int> outgoingKnockbacks,
            ref Dictionary <ActorData, int> incomingKnockbacks)
        {
            foreach (KeyValuePair <ActorData, ClientActorHitResults> actorToHitResult in m_actorToHitResults)
            {
                ActorData             key = actorToHitResult.Key;
                ClientActorHitResults clientActorHitResults = actorToHitResult.Value;
                if (clientActorHitResults.HasKnockback)
                {
                    if (!incomingKnockbacks.ContainsKey(key))
                    {
                        incomingKnockbacks.Add(key, 1);
                    }
                    else
                    {
                        Dictionary <ActorData, int> dictionary;
                        ActorData index;
                        (dictionary = incomingKnockbacks)[index = key] = dictionary[index] + 1;
                    }

                    if (clientActorHitResults.KnockbackSourceActor != null)
                    {
                        if (!outgoingKnockbacks.ContainsKey(clientActorHitResults.KnockbackSourceActor))
                        {
                            outgoingKnockbacks.Add(clientActorHitResults.KnockbackSourceActor, 1);
                        }
                        else
                        {
                            Dictionary <ActorData, int> dictionary;
                            ActorData knockbackSourceActor;
                            (dictionary = outgoingKnockbacks)[
                                knockbackSourceActor = clientActorHitResults.KnockbackSourceActor] =
                                dictionary[knockbackSourceActor] + 1;
                        }
                    }
                }
            }
        }