///<inheritdoc/>
        public override int GetHashCode()
        {
            int hash = 17;

            // Overflow is fine, just wrap
            unchecked
            {
                hash = (hash * 29) + PaintScheme.GetHashCode();
                hash = (hash * 29) + Mobility.GetHashCode();
                hash = (hash * 29) + FirePower.GetHashCode();
                hash = (hash * 29) + Damage.GetHashCode();
                hash = (hash * 29) + Smoke.GetHashCode();
                hash = (hash * 29) + TrailingEffects.GetHashCode();
                hash = (hash * 29) + Hatch.GetHashCode();
                hash = (hash * 29) + HeadLights.GetHashCode();
                hash = (hash * 29) + TailLights.GetHashCode();
                hash = (hash * 29) + BrakeLights.GetHashCode();
                hash = (hash * 29) + Flaming.GetHashCode();
                hash = (hash * 29) + Launcher.GetHashCode();
                hash = (hash * 29) + CamouflageType.GetHashCode();
                hash = (hash * 29) + Concealed.GetHashCode();
                hash = (hash * 29) + FrozenStatus.GetHashCode();
                hash = (hash * 29) + PowerPlantStatus.GetHashCode();
                hash = (hash * 29) + State.GetHashCode();
                hash = (hash * 29) + Tent.GetHashCode();
                hash = (hash * 29) + Ramp.GetHashCode();
                hash = (hash * 29) + BlackoutLights.GetHashCode();
                hash = (hash * 29) + BlackoutBrakeLights.GetHashCode();
                hash = (hash * 29) + SpotLights.GetHashCode();
                hash = (hash * 29) + InteriorLights.GetHashCode();
                hash = (hash * 29) + SurrenderState.GetHashCode();
                hash = (hash * 29) + MaskedCloaked.GetHashCode();
            }

            return(hash);
        }
Example #2
0
    private void specialPlacementLogic(GameObject g, GameObject sg = null, GameObject oldG = null)
    {
        if (sg != null)
        {
            // Special behaviour for Resize component
            Resize r = sg.GetComponent <Resize>();
            if (r != null)
            {
                r.nonStatic = g;
            }
        }

        // Special behaviour for CollideTrigger component
        CollideTrigger ct = g.GetComponent <CollideTrigger>();

        if (ct != null)
        {
            ct.initialize();
        }

        if (oldG != null)
        {
            Transfigure oldT = oldG.GetComponent <Transfigure>();
            if (oldT != null)
            {
                Transfigure t = g.GetComponent <Transfigure>();
                t.targetAndTags.Clear();
                foreach (TargetAnimControllerAndTags tar in oldT.targetAndTags)
                {
                    TargetAnimControllerAndTags newTar = new TargetAnimControllerAndTags();
                    newTar.targetAnimController = tar.targetAnimController;
                    newTar.includedTags         = new List <string>(tar.includedTags);
                    newTar.excludedTags         = new List <string>(tar.excludedTags);
                    newTar.repeatable           = tar.repeatable;
                    newTar.id   = tar.id;
                    newTar.done = false;
                    t.targetAndTags.Add(newTar);
                }
            }
        }

        TimeTrigger tt = g.GetComponent <TimeTrigger>();

        if (tt != null)
        {
            tt.initialize();
        }

        MoveHorizontalUntilCollision mh = g.GetComponent <MoveHorizontalUntilCollision>();

        if (mh != null)
        {
            mh.run();
        }

        KoopaTroopa kt = g.GetComponent <KoopaTroopa>();

        if (kt != null)
        {
            addResetListener(kt);
        }

        FirePower fp = g.GetComponent <FirePower>();

        if (fp != null)
        {
            addResetListener(fp);
        }

        Invisible i = g.GetComponent <Invisible>();

        if (i != null)
        {
            addResetListener(i);
        }
    }