public override int GetHashCode() { unchecked { var hashCode = CardsFixedAtLevel?.GetHashCode() ?? 0; hashCode = (hashCode * 397) ^ (ComputerDifficulty != null ? ComputerDifficulty.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (DisplayInfo != null ? DisplayInfo.GetHashCode() : 0); hashCode = (hashCode * 397) ^ Hide.GetHashCode(); hashCode = (hashCode * 397) ^ (Id?.GetHashCode() ?? 0); hashCode = (hashCode * 397) ^ (Image != null ? Image.GetHashCode() : 0); hashCode = (hashCode * 397) ^ IsNew.GetHashCode(); hashCode = (hashCode * 397) ^ IsQuickmatchPlaylist.GetHashCode(); hashCode = (hashCode * 397) ^ IsTeamGamePlaylist.GetHashCode(); hashCode = (hashCode * 397) ^ LonelyPartyUsesWildcard.GetHashCode(); hashCode = (hashCode * 397) ^ MatchTicketTimeoutDurationSeconds; hashCode = (hashCode * 397) ^ MaxPartySize; hashCode = (hashCode * 397) ^ MaxPlayerCount; hashCode = (hashCode * 397) ^ MinPartySize; hashCode = (hashCode * 397) ^ MinPlayerCount; hashCode = (hashCode * 397) ^ (MpsdHopperName?.GetHashCode() ?? 0); hashCode = (hashCode * 397) ^ (MpsdHopperStatName?.GetHashCode() ?? 0); hashCode = (hashCode * 397) ^ (PlaylistEntries?.GetHashCode() ?? 0); hashCode = (hashCode * 397) ^ (StatsClassification?.GetHashCode() ?? 0); hashCode = (hashCode * 397) ^ (TargetPlatform?.GetHashCode() ?? 0); hashCode = (hashCode * 397) ^ (ThumbnailImage != null ? ThumbnailImage.GetHashCode() : 0); hashCode = (hashCode * 397) ^ UsesBanRules.GetHashCode(); hashCode = (hashCode * 397) ^ Voting.GetHashCode(); return(hashCode); } }
public override int GetHashCode() { unchecked { var hashCode = ContentId.GetHashCode(); hashCode = (hashCode * 397) ^ CreditPrice; hashCode = (hashCode * 397) ^ (Description?.GetHashCode() ?? 0); hashCode = (hashCode * 397) ^ Flair.GetHashCode(); hashCode = (hashCode * 397) ^ (int)GiftableAcquisitionMethod; hashCode = (hashCode * 397) ^ Id.GetHashCode(); hashCode = (hashCode * 397) ^ IsFeatured.GetHashCode(); hashCode = (hashCode * 397) ^ IsGiftOnly.GetHashCode(); hashCode = (hashCode * 397) ^ IsNew.GetHashCode(); hashCode = (hashCode * 397) ^ IsPurchasableFromMarketplace.GetHashCode(); hashCode = (hashCode * 397) ^ IsPurchasableWithCredits.GetHashCode(); hashCode = (hashCode * 397) ^ IsStack.GetHashCode(); hashCode = (hashCode * 397) ^ (StackedRequisitionPacks?.GetHashCode() ?? 0); hashCode = (hashCode * 397) ^ (LargeImageUrl?.GetHashCode() ?? 0); hashCode = (hashCode * 397) ^ (MediumImageUrl?.GetHashCode() ?? 0); hashCode = (hashCode * 397) ^ MerchandisingOrder; hashCode = (hashCode * 397) ^ (Name?.GetHashCode() ?? 0); hashCode = (hashCode * 397) ^ (SmallImageUrl?.GetHashCode() ?? 0); hashCode = (hashCode * 397) ^ XboxMarketplaceProductId.GetHashCode(); hashCode = (hashCode * 397) ^ (XboxMarketplaceProductUrl?.GetHashCode() ?? 0); return(hashCode); } }
//Wrapper method to determine how to filter champions given generic input public static List <Champion> FilterChampions(string input, string questionSymbol, List <Champion> champions) { if (input == "NoPref") { return(champions); } if (questionSymbol == LaneQuestion) { Lane.TryParse(input, out Lane lane); return(FilterChampionsByCriteria(lane, champions)); } if (questionSymbol == RoleQuestion) { AttackRange.TryParse(input, out AttackRange role); return(FilterChampionsByCriteria(role, champions)); } if (questionSymbol == DamageQuestion) { DamageType.TryParse(input, out DamageType dmg); return(FilterChampionsByCriteria(dmg, champions)); } if (questionSymbol == NewnessQuestion) { IsNew.TryParse(input, out IsNew n); return(FilterChampionsByCriteria(n, champions)); } return(champions); }
public override string ToString() { var str = "Pos: {0} - Name: {1}, IsNew: {2}, IsTransient: {3}".FormatCurrent( Position, EntityDisplayName.EmptyNull(), _initialized ? IsNew.ToString() : "-", _initialized ? IsTransient.ToString() : "-"); return(str); }
protected override int GetDetailedNodeKindHash() { var v = (int)NodeKind; unchecked { v += Name.GetHashCode() + IsNew.GetHashCode() + IsSub.GetHashCode(); } return(v); }
public async Task AddAsyncAndGetAsync_Sequence_IsNewFlagAutomaticallyHandled() { var store = new DefaultSequenceStore(new IntegrationLoggerSubstitute <DefaultSequenceStore>()); var context = ConsumerPipelineContextHelper.CreateSubstitute(sequenceStore: store); var sequence = await store.AddAsync(new ChunkSequence("abc", 10, context)); sequence.IsNew.Should().BeTrue(); sequence = (await store.GetAsync <ChunkSequence>("abc")) !; sequence !.IsNew.Should().BeFalse(); }
private static List <Champion> FilterChampionsByCriteria(IsNew newness, List <Champion> champions) { List <Champion> options = new List <Champion>(); foreach (Champion champ in champions) { if (newness == champ.TryNew) { options.Add(champ); } } return(options); }
public async Task GetSequence_ChunkForExistingSequence_SequenceReturned() { var envelope1 = new RawInboundEnvelope( new byte[] { 0x01, 0x02, 0x03 }, new MessageHeaderCollection { { DefaultMessageHeaders.MessageId, "123" }, { DefaultMessageHeaders.ChunkIndex, "0" }, { DefaultMessageHeaders.ChunksCount, "4" } }, new TestConsumerEndpoint("test"), "test", new TestOffset()); var envelope2 = new RawInboundEnvelope( new byte[] { 0x04, 0x05, 0x06 }, new MessageHeaderCollection { { DefaultMessageHeaders.MessageId, "123" }, { DefaultMessageHeaders.ChunkIndex, "1" }, { DefaultMessageHeaders.ChunksCount, "4" } }, new TestConsumerEndpoint("test"), "test", new TestOffset()); var reader = new ChunkSequenceReader(); var context1 = ConsumerPipelineContextHelper.CreateSubstitute( envelope1, sequenceStore: _defaultSequenceStore); var sequence1 = await reader.GetSequenceAsync(context1); sequence1.Should().NotBeNull(); sequence1.Should().BeOfType <ChunkSequence>(); sequence1 !.TotalLength.Should().Be(4); sequence1.IsNew.Should().BeTrue(); var context2 = ConsumerPipelineContextHelper.CreateSubstitute( envelope2, sequenceStore: _defaultSequenceStore); var sequence2 = await reader.GetSequenceAsync(context2); sequence2.Should().NotBeNull(); sequence2.Should().BeSameAs(sequence1); sequence2 !.IsNew.Should().BeFalse(); }
public override string toFullString() { return(ProductCode + "; " + Description + "; " + SellPrice + "€ sp - " + RentPrice + "€ rp; isNew = " + IsNew.ToString() + "; Marca:" + Brand + "; " + Category.ToString()); }
public bool Equals(DestinyActivity input) { if (input == null) { return(false); } return (( ActivityHash == input.ActivityHash || (ActivityHash.Equals(input.ActivityHash)) ) && ( IsNew == input.IsNew || (IsNew != null && IsNew.Equals(input.IsNew)) ) && ( CanLead == input.CanLead || (CanLead != null && CanLead.Equals(input.CanLead)) ) && ( CanJoin == input.CanJoin || (CanJoin != null && CanJoin.Equals(input.CanJoin)) ) && ( IsCompleted == input.IsCompleted || (IsCompleted != null && IsCompleted.Equals(input.IsCompleted)) ) && ( IsVisible == input.IsVisible || (IsVisible != null && IsVisible.Equals(input.IsVisible)) ) && ( DisplayLevel == input.DisplayLevel || (DisplayLevel.Equals(input.DisplayLevel)) ) && ( RecommendedLight == input.RecommendedLight || (RecommendedLight.Equals(input.RecommendedLight)) ) && ( DifficultyTier == input.DifficultyTier || (DifficultyTier != null && DifficultyTier.Equals(input.DifficultyTier)) ) && ( Challenges == input.Challenges || (Challenges != null && Challenges.SequenceEqual(input.Challenges)) ) && ( ModifierHashes == input.ModifierHashes || (ModifierHashes != null && ModifierHashes.SequenceEqual(input.ModifierHashes)) ) && ( BooleanActivityOptions == input.BooleanActivityOptions || (BooleanActivityOptions != null && BooleanActivityOptions.SequenceEqual(input.BooleanActivityOptions)) ) && ( LoadoutRequirementIndex == input.LoadoutRequirementIndex || (LoadoutRequirementIndex.Equals(input.LoadoutRequirementIndex)) )); }