Class ChapterArticle

Create an article with chapters.

Hierarchy (view full)

Constructors

  • Parameters

    • id: string

      Id of the article.

    • title: string | RawMessage

      Title of the article.

    • body: string | RawMessage

      Body of the article, support RawMessage.

    • chapters: ChapterData[]

      Chapters of the article.

    • OptionaliconPath: string

      Icon path of the article.

    • needUnlock: boolean = true

      If true, articles will be unlocked in the ArticleCollection after reading it.

    Returns ChapterArticle

Properties

body: string | RawMessage

Body of the article, support RawMessage.

chapters: ChapterData[]

Chapters of the article.

iconPath?: string

Icon path of the article.

id: string

Id of the article.

needUnlock: boolean = true

If true, articles will be unlocked in the ArticleCollection after reading it.

title: string | RawMessage

Title of the article.

Methods

  • Check the article whether it is unlocked or not to article collection.

    Parameters

    • player: Player

    Returns boolean

  • Display the reading to a player.

    Parameters

    • player: Player

    Returns void

  • Registry the prop.

    Returns void

    Use Register.articleRegistry() to registry the prop

  • Unlock the article to article collection.

    Parameters

    • player: Player

    Returns void