Ejemplo n.º 1
0
        public CharadesEntry EntryExistsInCharades(IListEntry entry, ICollection <CharadesEntry> charades)
        {
            var existingCharadesWithEntry = charades
                                            .FirstOrDefault(c => c.Series.AnimePositions != null && c.Series.AnimePositions.Any(a => a.MalId == entry.Id));

            return(existingCharadesWithEntry);
        }
Ejemplo n.º 2
0
        public void AddEntryToCharadesEntry(CharadesEntry charadesEntry, IListEntry entry, SeriesEntry franchise)
        {
            charadesEntry.Series.AnimePositions.Add(new AnimeEntry()
            {
                MalId = entry.Id, Title = entry.Title, Series = charadesEntry.Series
            });
            var newUsers = entry.Users.Where(u => !charadesEntry.KnownBy.Contains(u)).ToArray();

            newUsers.ForEach(u => charadesEntry.KnownBy.Add(u));

            franchise.MangaPositions
            .Where(m => !charadesEntry.Series.MangaPositions.Any(a => a.MalId == m.MalId))
            .ForEach(m => charadesEntry.Series.MangaPositions.Add(m));
        }
Ejemplo n.º 3
0
        public ListEntry(IUIElement @base)
            : base(@base)
        {
            IListEntry listEntry = @base as IListEntry;

            ContentBoundLeft    = listEntry?.ContentBoundLeft;
            ListColumnCellLabel = listEntry?.ListColumnCellLabel;
            GroupExpander       = listEntry?.GroupExpander;
            IsGroup             = listEntry?.IsGroup;
            IsExpanded          = listEntry?.IsExpanded;
            IsSelected          = listEntry?.IsSelected;
            ListBackgroundColor = listEntry?.ListBackgroundColor;
            SetSprite           = listEntry?.SetSprite;
        }
Ejemplo n.º 4
0
        private async Task <CharadesEntry> CreateNextCharades(IListEntry entry)
        {
            var existingCharadesWithEntry = entryProcessingStrategy.EntryExistsInCharades(entry, charades);

            if (existingCharadesWithEntry != null)
            {
                var newUsers = entry.Users.Where(u => !existingCharadesWithEntry.KnownBy.Any(eu => eu.Equals(u))).ToArray();
                if (newUsers.Count() != 0)
                {
                    newUsers.ForEach(u => existingCharadesWithEntry.KnownBy.Add(u));
                }
                return(existingCharadesWithEntry);
            }
            var seriesExistsInDb = await entryProcessingStrategy.EntryExistsInRepository(entry, seriesRepository);

            if (seriesExistsInDb)
            {
                var franchiseFromRepo = await entryProcessingStrategy.GetFranchiseFromRepository(entry, seriesRepository);

                return(EnsureCreateAndAddToCharades(franchiseFromRepo));
            }
            var franchise = entryProcessingStrategy.CreateFranchise(entry, franchiseService, adaptationStrategy);

            if (franchise == null)
            {
                return(null);
            }
            var indirectExistingRelation = GetIndirectExistingRelation(charades, franchise);

            if (indirectExistingRelation != null)
            {
                entryProcessingStrategy.AddEntryToCharadesEntry(indirectExistingRelation, entry, franchise);
                return(indirectExistingRelation);
            }
            return(EnsureCreateAndAddToCharades(franchise));
        }
Ejemplo n.º 5
0
        public async Task <SeriesEntry> GetFranchiseFromRepository(IListEntry entry, ISeriesRepository seriesRepository)
        {
            var franchise = await seriesRepository.GetByAnimeId(entry.Id);

            return(franchise);
        }
Ejemplo n.º 6
0
        public SeriesEntry CreateFranchise(IListEntry entry, IFranchiseService franchiseService, AdaptationIncluding withAdaptations)
        {
            var franchise = franchiseService.CreateFromAnime(entry.Id, withAdaptations);

            return(franchise);
        }
Ejemplo n.º 7
0
		public ChatParticipantEntry(IListEntry @base)
				:
				base(@base)
		{
		}
Ejemplo n.º 8
0
        public async Task <bool> EntryExistsInRepository(IListEntry entry, ISeriesRepository seriesRepository)
        {
            var seriesExistsInDb = await seriesRepository.SeriesExistsByAnimeId(entry.Id);

            return(seriesExistsInDb);
        }
Ejemplo n.º 9
0
 public MarketOrderEntry(IListEntry Base)
     :
     base(Base)
 {
 }
Ejemplo n.º 10
0
 public DroneViewEntry(IListEntry Base)
     :
     base(Base)
 {
 }
Ejemplo n.º 11
0
 public DroneViewEntry(IListEntry @base)
     : base(@base)
 {
 }
Ejemplo n.º 12
0
		public OverviewEntry(IListEntry @base)
			:
			base(@base)
		{
		}
Ejemplo n.º 13
0
		public MarketOrderEntry(IListEntry Base)
			:
			base(Base)
		{
		}
Ejemplo n.º 14
0
 public ChatParticipantEntry(IListEntry Base)
     :
     base(Base)
 {
 }
Ejemplo n.º 15
0
		public OverviewEntry(IListEntry Base)
			:
			base(Base)
		{
		}
Ejemplo n.º 16
0
        public static T ContainingRecord <T>(this IListEntry self, int offset) where T : class, IRemoteStruct, new()
        {
            self.AssertRefreshed();

            return(self.Context.As <T>(self.Address - offset));
        }
Ejemplo n.º 17
0
		public DroneViewEntry(IListEntry @base)
			:
			base(@base)
		{
		}
Ejemplo n.º 18
0
 public OverviewEntry(IListEntry @base)
     :
     base(@base)
 {
 }
Ejemplo n.º 19
0
 public MarketOrderEntry(IListEntry @base)
     :
     base(@base)
 {
 }
Ejemplo n.º 20
0
		public MarketOrderEntry(IListEntry @base)
			:
			base(@base)
		{
		}
		virtual public void Berecne()
		{
			var Container = EntryAst.AlsContainer(regionConstraint: RegionConstraint);

			if (null == Container)
				return;

			LabelAst = EntryAst.LargestLabelInSubtree();

			FläceFürMenuAst = LabelAst;

			LabelGrenzeLinx = (int?)LabelAst.LaagePlusVonParentErbeLaageA();

			/*
			 * 2014.11.08
			 * 
			 * Änderung für Release "Rhea":
			 * "PyObjTypName": "GlowSprite"
			 * 
			ExpanderAst =
				EntryAst.SuuceFlacMengeAstFrüheste(
				(Kandidaat) =>
					AuswertGbs.Glob.GbsAstTypeIstEveIcon(Kandidaat) &&
					Regex.Match(Kandidaat.Name	?? "", "expander", RegexOptions.IgnoreCase).Success);
			 * */
			ExpanderAst =
					EntryAst.FirstMatchingNodeFromSubtreeBreadthFirst(
					(kandidaat) =>
						(AuswertGbs.Glob.GbsAstTypeIstEveIcon(kandidaat) ||
						AuswertGbs.Glob.GbsAstTypeIstSprite(kandidaat)) &&
						Regex.Match(kandidaat.Name ?? "", "expander", RegexOptions.IgnoreCase).Success);

			IstGroup = ((null == ExpanderAst) ? null : ExpanderAst.VisibleIncludingInheritance) ?? false;

			var MengeIconOderSpriteAst =
				EntryAst.MatchingNodesFromSubtreeBreadthFirst(
				(kandidaat) =>
					(AuswertGbs.Glob.GbsAstTypeIstEveIcon(kandidaat) ||
					Regex.Match(kandidaat.PyObjTypName ?? "", "sprite", RegexOptions.IgnoreCase).Success) &&
					(kandidaat.VisibleIncludingInheritance ?? false));

			IstItem =
				(!MengeIconOderSpriteAst.IsNullOrEmpty() || null != LabelAst) &&
				!(IstGroup ?? false);

			var MengeIconOderSpriteGrenzeLinx =
				MengeIconOderSpriteAst
				?.Select((iconAst) => iconAst.LaagePlusVonParentErbeLaageA())
				?.Where((kandidaat) => kandidaat.HasValue)
				?.Select((iconAstGrenzeLinx) => iconAstGrenzeLinx.Value)
				?.ToArray();

			if (!MengeIconOderSpriteGrenzeLinx.IsNullOrEmpty())
				InhaltGrenzeLinx = (int)Math.Min(InhaltGrenzeLinx ?? int.MaxValue, MengeIconOderSpriteGrenzeLinx.Min());

			if (LabelGrenzeLinx.HasValue)
				InhaltGrenzeLinx = (int)Math.Min(InhaltGrenzeLinx ?? int.MaxValue, LabelGrenzeLinx.Value);

			var ListEntryInZeleTrenung = this.ListEntryInZeleTrenung();

			if (ListEntryTrenungZeleTypEnum.Ast == ListEntryInZeleTrenung)
			{
				//	genuzt z.B. für "OverviewScrollEntry".
				var EntryListeZeleLabel =
					EntryAst.ExtraktMengeLabelString()?.ToArray();

				ListeZuHeaderZeleString =
					EntryListeZeleLabel
					?.Select(zeleLabel => new KeyValuePair<IColumnHeader, string>(
						HeaderBestFit(zeleLabel, ListeColumnHeader),
						zeleLabel?.Text))
					?.ToArray();
			}
			else
			{
				Label = LabelAst.AsUIElementTextIfTextNotEmpty();

				var Bescriftung = Label?.Text;

				if (null != Bescriftung)
				{
					if (!(IstGroup ?? false))
					{
						ItemListeZeleTextMitFormat = Bescriftung.Split(new string[] { "<t>" }, StringSplitOptions.None);

						var ItemListeZeleText =
							ItemListeZeleTextMitFormat
							?.Select((zeleTextMitFormat) => ZeleTextAusZeleTextMitFormat(zeleTextMitFormat))
							?.ToArray();

						ListeZuHeaderZeleString =
							ItemListeZeleText
							?.Select((zeleText, index) => new KeyValuePair<IColumnHeader, string>(
								ListeColumnHeader?.FirstOrDefault(kandidaat => kandidaat.ColumnIndex == index),
								zeleText))
							?.ToArray();
					}
				}
			}

			var backgroundColorNode =
				EntryAst?.FirstMatchingNodeFromSubtreeBreadthFirst(node =>
					(node?.PyObjTypNameMatchesRegexPatternIgnoreCase("fill") ?? false) &&
					(node?.Name?.RegexMatchSuccessIgnoreCase("bgColor") ?? false));

			var ListBackgroundColor =
				EntryAst?.BackgroundList
				?.Select(background => background.Color.AlsColorORGB())
				.ConcatNullable(new[] { backgroundColorNode?.Color.AlsColorORGB() })
				?.WhereNotDefault()
				?.ToArrayIfNotEmpty();

			var SetSprite =
				EntryAst.SetSpriteFromChildren()
				?.ToArrayIfNotEmpty();

			ErgeebnisListEntry = new ListEntry(Container)
			{
				ContentBoundLeft = InhaltGrenzeLinx,

				ListColumnCellLabel = ListeZuHeaderZeleString,

				GroupExpander = ExpanderAst?.AsUIElementIfVisible(),

				IsGroup = IstGroup,
				IsExpanded = ExpanderSpriteIsExpanded(ExpanderAst),
				IsSelected = EntryAst.isSelected,

				ListBackgroundColor = ListBackgroundColor,
				SetSprite = SetSprite,
			};
		}
Ejemplo n.º 22
0
		public DroneViewEntry(IListEntry Base)
			:
			base(Base)
		{
		}
Ejemplo n.º 23
0
 public OverviewEntry(IListEntry Base)
     :
     base(Base)
 {
 }