private ElementType transformElement(ElementType et)
 {
     if (et.Equals (ElementType.Earth)) {
         return ElementType.Fire;
     } else if (et.Equals (ElementType.Fire)) {
         return ElementType.Ice;
     } else if (et.Equals (ElementType.Ice)) {
         return ElementType.Lightning;
     } else if (et.Equals (ElementType.Lightning)) {
         return ElementType.None;
     } else if (et.Equals (ElementType.None)) {
         return ElementType.Earth;
     }
     return ElementType.None;
 }
Пример #2
0
        public static ElementType GetNewElementType(ElementType a, ElementType b)
        {
            if (a.Equals(ElementType.Fire) && b.Equals(ElementType.Fire))
            {
                return(ElementType.Fire);
            }
            if (a.Equals(ElementType.Earth) && b.Equals(ElementType.Earth))
            {
                return(ElementType.Earth);
            }
            if (a.Equals(ElementType.Water) && b.Equals(ElementType.Water))
            {
                return(ElementType.Water);
            }
            if (a.Equals(ElementType.Wind) && b.Equals(ElementType.Wind))
            {
                return(ElementType.Wind);
            }
            //advanced
            if (a.Equals(ElementType.Fire) && b.Equals(ElementType.Water))
            {
                return(ElementType.Steam);
            }
            else if (a.Equals(ElementType.Fire) && b.Equals(ElementType.Wind))
            {
                return(ElementType.Blaze);
            }
            else if (a.Equals(ElementType.Water) && b.Equals(ElementType.Earth))
            {
                return(ElementType.Wood);
            }
            else if (a.Equals(ElementType.Water) && b.Equals(ElementType.Wind))
            {
                return(ElementType.Ice);
            }
            //secret arts
            //if(c != null)
            //{
            //    if (a.Equals(ElementType.Steam) && b.Equals(ElementType.Water) && c.Equals(ElementType.Ice))
            //    {
            //        return ElementType.Lightning;
            //    }
            //    else if (a.Equals(ElementType.Wood) && b.Equals(ElementType.Water) && c.Equals(ElementType.Earth))
            //    {
            //        return ElementType.Breeze;
            //    }
            //    else if ((a.Equals(ElementType.Fire) || a.Equals(ElementType.Blaze)) && b.Equals(ElementType.Water) && c.Equals(ElementType.Earth))
            //    {
            //        return ElementType.Lava;
            //    }
            //}


            return(ElementType.Aether);
        }
Пример #3
0
 public override string ToString()
 {
     if (elementType.Equals(ElementType.NONE))
     {
         return("Casilla normal");
     }
     else if (elementType.Equals(ElementType.EARTH))
     {
         return("Casilla de tierra");
     }
     else if (elementType.Equals(ElementType.WATER))
     {
         return("Casilla de agua");
     }
     else if (elementType.Equals(ElementType.FIRE))
     {
         return("Casilla de fuego");
     }
     return("Casilla de elemento desconocido");
 }
Пример #4
0
 public bool Equals(CppArrayType other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(base.Equals(other) && ElementType.Equals(other.ElementType) && Size == other.Size);
 }
            public bool Equals(UnificationKey other)
            {
                if (!ElementType.Equals(other.ElementType))
                {
                    return(false);
                }

                // The TypeHandle is not actually part of the key but riding along for convenience (see commment at head of class.)
                // If the other parts of the key matched, this must too.
                Debug.Assert(TypeHandle.Equals(other.TypeHandle));
                return(true);
            }
Пример #6
0
 private ElementType transformElement(ElementType et)
 {
     if (et.Equals(ElementType.Earth))
     {
         return(ElementType.Fire);
     }
     else if (et.Equals(ElementType.Fire))
     {
         return(ElementType.Ice);
     }
     else if (et.Equals(ElementType.Ice))
     {
         return(ElementType.Lightning);
     }
     else if (et.Equals(ElementType.Lightning))
     {
         return(ElementType.None);
     }
     else if (et.Equals(ElementType.None))
     {
         return(ElementType.Earth);
     }
     return(ElementType.None);
 }
Пример #7
0
        public override bool Equals(object obj)
        {
            var fat = obj as FixedArrayType;

            if (fat == null || !ElementType.Equals(fat.ElementType))
            {
                return(false);
            }

            return(fat.OptionalSize != null && OptionalSize != null?
                   fat.OptionalSize.Equals(OptionalSize) :
                       fat.OptionalSize == OptionalSize ||
                       fat.OptionalSize == null ||
                       OptionalSize == null);
        }
    public void initialize(Vector3 vectorUp,GameObject objective,TrackingMissilesAttack originalAttack,ElementType elementType)
    {
        timeHasBeenAlive = 0f;
        this.objective = objective;
        this.originalAttack = originalAttack;
        speed = new Vector3 (Random.value, Random.value,0f).normalized;
        speed = ((speed * 0.8f) + vectorUp).normalized;

        if(!elementType.Equals(ElementType.None)){
            elementalParticleEffect.SetActive(true);
            elementalParticleEffect.GetComponent<ParticleSystem>().Play();
            Material material = AttackElementsManager.getElement(elementType).material;
            if(material!=null){
                elementalParticleEffect.GetComponent<ParticleSystemRenderer >().material = material;
            }
        }
    }
Пример #9
0
        ///<summary>
        /// Check if the current instance equals another instance of this class.
        ///</summary>
        ///<param name="obj">The instance to compare the current instance with.</param>
        ///<returns><code>true</code> if the instances are the same instance or have the same content.</returns>
        public override bool Equals(object obj)
        {
            if (obj == null || GetType() != obj.GetType())
            {
                return(false);
            }
            ElementSet s = (ElementSet)obj;

            if (Description == null && s.Description != null)
            {
                return(false);
            }
            if (Description != null && !Description.Equals(s.Description))
            {
                return(false);
            }
            if (!Caption.Equals(s.Caption))
            {
                return(false);
            }
            if (SpatialReferenceSystemWkt == null && s.SpatialReferenceSystemWkt != null)
            {
                return(false);
            }
            if (SpatialReferenceSystemWkt != null && !SpatialReferenceSystemWkt.Equals(s.SpatialReferenceSystemWkt))
            {
                return(false);
            }
            if (!ElementType.Equals(s.ElementType))
            {
                return(false);
            }
            if (ElementCount != s.ElementCount)
            {
                return(false);
            }
            for (int i = 0; i < ElementCount; i++)
            {
                if (!GetElement(i).Equals(s.GetElement(i)))
                {
                    return(false);
                }
            }
            return(true);
        }
Пример #10
0
        public override bool Equals(object obj)
        {
            if (this == obj)
            {
                return(true);
            }

            if (typeof(CollectionNode) != obj.GetType())
            {
                return(false);
            }

            var col = obj as CollectionNode;

            return(collectionType.Equals(col.collectionType) &&
                   ElementType.Equals(col.ElementType) &&
                   Array.SequenceEqual(col.Array));
        }
Пример #11
0
    public void initialize(Vector3 vectorUp, GameObject objective, TrackingMissilesAttack originalAttack, ElementType elementType)
    {
        timeHasBeenAlive    = 0f;
        this.objective      = objective;
        this.originalAttack = originalAttack;
        speed = new Vector3(Random.value, Random.value, 0f).normalized;
        speed = ((speed * 0.8f) + vectorUp).normalized;

        if (!elementType.Equals(ElementType.None))
        {
            elementalParticleEffect.SetActive(true);
            elementalParticleEffect.GetComponent <ParticleSystem>().Play();
            Material material = AttackElementsManager.getElement(elementType).material;
            if (material != null)
            {
                elementalParticleEffect.GetComponent <ParticleSystemRenderer>().material = material;
            }
        }
    }
Пример #12
0
 private Rectangle GetRectangle()
 {
     if (ElementType.Equals("leather_cap"))
     {
         return(helmet);
     }
     else if (ElementType.Equals("leather_brigandine"))
     {
         return(brigandine);
     }
     else if (ElementType.Equals("leather_pants"))
     {
         return(pants);
     }
     else if (ElementType.Equals("leather_boots"))
     {
         return(boots);
     }
     return(helmet);
 }
Пример #13
0
        public override int ScoreCastTo(CType otherType)
        {
            if (Equals(otherType))
            {
                return(1000);
            }

            if (otherType is CPointerType pt)
            {
                if (ElementType.Equals(pt.InnerType))
                {
                    return(900);
                }
                else
                {
                    return(ElementType.ScoreCastTo(pt.InnerType) / 2);
                }
            }

            return(0);
        }
Пример #14
0
        public bool Equals(DataType other)
        {
            if (other == null)
            {
                return(false);
            }

            switch (Kind)
            {
            case DataTypeKind.POINTER:
                return(Kind == other.Kind && ElementType.Kind == other.ElementType.Kind);

            case DataTypeKind.ENUM:
                return(Kind == other.Kind && CustomTypeName == other.CustomTypeName);

            case DataTypeKind.ARRAY:
                return(Kind == other.Kind && ElementType.Equals(other.ElementType));
            }

            return(Kind == other.Kind);
        }
Пример #15
0
        ///<summary>
        /// Check if the current instance equals another instance of this class.
        ///</summary>
        ///<param name="obj">The instance to compare the current instance with.</param>
        ///<returns><code>true</code> if the instances are the same instance or have the same content.</returns>
        public override bool Equals(Object obj)
        {
            if (obj == null || GetType() != obj.GetType())
            {
                return(false);
            }
            ElementSet s = (ElementSet)obj;

            if (!Description.Equals(s.Description))
            {
                return(false);
            }
            if (!ID.Equals(s.ID))
            {
                return(false);
            }
            if (!SpatialReference.Equals(s.SpatialReference))
            {
                return(false);
            }
            if (!ElementType.Equals(s.ElementType))
            {
                return(false);
            }
            if (ElementCount != s.ElementCount)
            {
                return(false);
            }
            for (int i = 0; i < ElementCount; i++)
            {
                if (!GetElement(i).Equals(s.GetElement(i)))
                {
                    return(false);
                }
            }
            return(true);
        }
Пример #16
0
        /// <inheritdoc />
        public override bool Equals(object obj)
        {
            StaticArrayTypeWrapper other = obj as StaticArrayTypeWrapper;

            return(other != null && ElementType.Equals(other.ElementType) && arrayRank == other.arrayRank);
        }
Пример #17
0
 public override bool Equals(object obj)
 {
     return(obj is CArrayType a && Length == a.Length && ElementType.Equals(a.ElementType));
 }
Пример #18
0
        /// <inheritdoc />
        public override bool Equals(object obj)
        {
            StaticByRefTypeWrapper other = obj as StaticByRefTypeWrapper;

            return(other != null && ElementType.Equals(other.ElementType));
        }
Пример #19
0
 public override bool Equals(object obj)
 {
     return(obj is RefArrayType && ElementType.Equals((obj as RefArrayType).ElementType));
 }
Пример #20
0
 /// <summary>
 /// Determines whether this instance of <see cref="ArrayTypeId"/> refers to the same type as <paramref name="other"/>.
 /// </summary>
 public bool Equals(ArrayTypeId?other)
 {
     return(other != null &&
            ElementType.Equals(other.ElementType) &&
            Dimensions == other.Dimensions);
 }
Пример #21
0
 /// <summary>
 /// Is other equal to this?
 /// </summary>
 public bool Equals(ArrayType other)
 {
     return(base.Equals(other) && ElementType.Equals(other.ElementType));
 }
Пример #22
0
 public Boolean HasElementOnPeek(ElementType elementType)
 {
     return(Count > 0 ? Peek().Any(p => elementType.Equals(p.ElementType)) : false);
 }
Пример #23
0
        protected override bool TypeEquals(Type other)
        {
            var at = (ArrayType)other;

            return(this.Dimensions == at.Dimensions && ElementType.Equals(at.ElementType));
        }