コード例 #1
0
        public CustomCharacterGearInfo(string name, string type, bool isCustom, TextureChange[] textureChanges, string[] tags) : base(name, type, isCustom, textureChanges, tags)
        {
            // For now all I saw was one texture change per gear type, so assuming first.
            var textureChange = textureChanges?.FirstOrDefault();

            if (textureChange != null)
            {
                Info = new CustomInfo(name, textureChange.texturePath, null, isCustom)
                {
                    ParentObject = this
                };
            }
        }
コード例 #2
0
ファイル: CustomFolderInfo.cs プロジェクト: MCBTay/XLMenuMod
        public ICustomInfo GetNewestChild(List <ICustomInfo> sourceList = null)
        {
            ICustomInfo newestChild = null;

            if (sourceList == null)
            {
                sourceList = Children;
            }

            if (sourceList == null || !sourceList.Any())
            {
                return(newestChild);
            }

            foreach (var child in sourceList)
            {
                if (child.IsFolder)
                {
                    var customFolder = child as CustomFolderInfo;

                    if (newestChild == null)
                    {
                        newestChild = GetNewestChild(customFolder.Children);
                    }
                    else
                    {
                        var tempChild = GetNewestChild(customFolder.Children);
                        if (tempChild != null && tempChild.ModifiedDate > newestChild.ModifiedDate)
                        {
                            newestChild = tempChild;
                        }
                    }
                }
                else
                {
                    if (newestChild == null)
                    {
                        newestChild = child;
                    }
                    else
                    {
                        if (child.ModifiedDate > newestChild.ModifiedDate)
                        {
                            newestChild = child;
                        }
                    }
                }
            }

            return(newestChild);
        }