arkparser

package
v1.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeMain         string = "MAIN_STORY"
	TypeActivity     string = "ACTIVITY_STORY"
	TypeMiniActivity string = "MINI_STORY"
	TypeNone         string = "NONE"

	TagBefore    string = "BEFORE"
	TagAfter     string = "AFTER"
	TagInterlude string = "INTERLUDE"

	TagBeforeCN    string = "行动前"
	TagAfterCN     string = "行动后"
	TagInterludeCN string = "幕间"
	TagBeforeEN    string = "Before Operation"
	TagAfterEN     string = "After Operation"
	TagInterludeEN string = "Interlude"
	TagBeforeJP    string = "戦闘前"
	TagAfterJP     string = "戦闘後"
	TagInterludeJP string = "幕間"
	TagBeforeKR    string = "작전 전"
	TagAfterKR     string = "작전 후"
	TagInterludeKR string = "브릿지"
)

Variables

View Source
var DirectiveRegex = regexp.MustCompile(`\[(\w*)(?:\((.*)\))?]|\[name="(.*)"]`)

Functions

func NormalizeCharacterID

func NormalizeCharacterID(id string) string

func ParseDirectiveParams

func ParseDirectiveParams(rawParams string) map[string]string

Types

type Directive

type Directive struct {
	Name   string
	Params map[string]string
}

func ParseDirectives

func ParseDirectives(raw string) []Directive

type JsonComponent

type JsonComponent struct {
	Pic struct {
		Pics orderedmap.OrderedMap[string, JsonPic] `json:"pics"`
	} `json:"pic"`
}

type JsonPic

type JsonPic struct {
	PicId     string `json:"picId"`
	PicSortId int    `json:"picSortId"`
}

type JsonResPic

type JsonResPic struct {
	Id             string `json:"id"`
	Desc           string `json:"desc"`
	AssetPath      string `json:"assetPath"`
	PicDescription string `json:"picDescription"`
}

type JsonStory

type JsonStory struct {
	ID      string       `json:"storyId"`
	GroupID string       `json:"storyGroup"`
	Code    string       `json:"storyCode"`
	Name    string       `json:"storyName"`
	Info    string       `json:"storyInfo"`
	Text    string       `json:"storyTxt"`
	Tag     JsonStoryTag `json:"avgTag"`
}

type JsonStoryGroup

type JsonStoryGroup struct {
	ID      string       `json:"id"`
	Name    string       `json:"name"`
	Type    string       `json:"actType"`
	Stories []*JsonStory `json:"infoUnlockDatas"`
}

type JsonStoryReviewMetaTable

type JsonStoryReviewMetaTable struct {
	ActArchiveResData struct {
		Pics orderedmap.OrderedMap[string, JsonResPic] `json:"pics"`
	} `json:"actArchiveResData"`
	ActArchiveData struct {
		Components orderedmap.OrderedMap[string, JsonComponent] `json:"components"`
	} `json:"actArchiveData"`
}

type JsonStoryTag

type JsonStoryTag struct {
	Type string
	Text string
}

func (*JsonStoryTag) UnmarshalJSON

func (t *JsonStoryTag) UnmarshalJSON(data []byte) error

type Parser

type Parser struct {
	Root   string
	Prefix string
	// contains filtered or unexported fields
}

func (*Parser) GetInfo

func (p *Parser) GetInfo(infoPath string) (string, error)

func (*Parser) GetText

func (p *Parser) GetText(textPath string) (string, error)

func (*Parser) Parse

func (p *Parser) Parse() (*StoryTree, error)

func (*Parser) ParseCharacters

func (p *Parser) ParseCharacters(directives []Directive) []*StoryCharacter

func (*Parser) ParsePictures

func (p *Parser) ParsePictures(directives []Directive) []*StoryPicture

func (*Parser) ParseStoryReviewMetaTable

func (p *Parser) ParseStoryReviewMetaTable() (*JsonStoryReviewMetaTable, error)

func (*Parser) ParseStoryReviewTable

func (p *Parser) ParseStoryReviewTable() ([]*JsonStoryGroup, error)

func (*Parser) ParseStoryText

func (p *Parser) ParseStoryText(storyTextPath string) ([]Directive, error)

type Story

type Story struct {
	ID      string
	GroupID string
	Code    string
	Name    string
	Info    string
	TagType string
	TagText string

	Pictures   []*StoryPicture
	Characters []*StoryCharacter
}

type StoryCharacter

type StoryCharacter struct {
	ID    string
	Names []string
}

type StoryGroup

type StoryGroup struct {
	ID      string
	Name    string
	Type    string
	Stories []*Story
}

type StoryPicture

type StoryPicture struct {
	ID       string
	Category string
	Title    string
	Subtitle string
}

type StoryTree

type StoryTree struct {
	StoryGroups []*StoryGroup
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL