コード例 #1
0
ファイル: Weapon.cs プロジェクト: jeremywrowe/botw
        public override bool Equals(object other)
        {
            if (other == null || other.GetType() != GetType())
            {
                return(false);
            }

            var otherWeapon = (Weapon)other;

            return(Type.Equals(otherWeapon.Type) &&
                   Name.Equals(otherWeapon.Name) &&
                   Parry.Equals(otherWeapon.Parry) &&
                   Powers.OrderBy(p => p).SequenceEqual(otherWeapon.Powers.OrderBy(p => p)) &&
                   Locations.OrderBy(l => l).SequenceEqual(otherWeapon.Locations.OrderBy(l => l)));
        }