Kursach_StealthAction/Assets/Tremble/Editor/Manual/ManualEntry.cs
2026-10-11 19:16:11 +03:00

34 lines
754 B
C#

//
// This file is part of the Tremble package by Tiny Goose.
// Copyright (c) 2024-2026 TinyGoose Ltd., All Rights Reserved.
//
using System;
using System.Collections.Generic;
namespace TinyGoose.Tremble.Editor
{
public record ManualEntry
{
public string Title { get; init; }
public string PagePath { get; init; }
public bool ShowInTree { get; init; } = true;
public List<ManualEntry> Children { get; } = new();
public ManualEntry FindEntryByPath_Recursive(string path)
{
if (PagePath != null && PagePath.EqualsInvariant(path))
return this;
foreach (ManualEntry child in Children)
{
ManualEntry result = child.FindEntryByPath_Recursive(path);
if (result != null)
return result;
}
return null;
}
}
}