json

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2020 License: AGPL-3.0 Imports: 14 Imported by: 1

Documentation

Overview

Project OpenMonster Copyright (C) 2020 Kori

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/\>.

Project OpenMonster Copyright (C) 2020 Kori

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/\>.

Project OpenMonster Copyright (C) 2020 Kori

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/\>.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewItemLoader

func NewItemLoader(itemFiles map[string]io.Reader) db.ItemLoader

func NewMoveLoader

func NewMoveLoader(moveFiles map[string]io.Reader) db.MoveLoader

func NewSpeciesLoader

func NewSpeciesLoader(speciesFiles map[string]io.Reader) db.SpeciesLoader

func NewStatusLoader

func NewStatusLoader(statusFiles map[string]io.Reader) db.StatusLoader

Types

type FailedToLoadFileError

type FailedToLoadFileError struct {
	Files map[string]error
}

func NewFailedToLoadFileError

func NewFailedToLoadFileError() FailedToLoadFileError

func (FailedToLoadFileError) Error

func (e FailedToLoadFileError) Error() string

type HabitatLoader

type HabitatLoader struct {
	// contains filtered or unexported fields
}

func NewHabitatLoader

func NewHabitatLoader(habitatFiles map[string]io.Reader) *HabitatLoader

func (*HabitatLoader) Load

func (ml *HabitatLoader) Load() (map[string][]*habitat.Entry, error)

Load loads every file in the basepath folder and tries to convert it into a monster habitat The basepath is read from the 'data.dir.monster' field in the configuration.

Failed files will be listed in the returned error object The returned map contains every habitat, which could be parsed

func (*HabitatLoader) LoadHabitat

func (ml *HabitatLoader) LoadHabitat(reader io.Reader) (map[string][]*habitat.Entry, error)

LoadHabitat loads a monster habitat from the given file in the basepath folder. The 'filename' parameter sould be relative to the basepath. The basepath is read from the 'data.dir.monster' field in the configuration.

type ItemLoader

type ItemLoader struct {
	// contains filtered or unexported fields
}

func (*ItemLoader) Load

func (ml *ItemLoader) Load() (map[string]*item.Base, error)

Load loads every file in the basepath folder and tries to convert it into an item The basepath is read from the 'data.dir.item' field in the configuration.

Failed files will be listed in the returned error object The returned map contains every species, which could be parsed

func (*ItemLoader) LoadItem

func (ml *ItemLoader) LoadItem(reader io.Reader) (*item.Base, error)

LoadItem loads a itembase from the given file in the basepath folder. The 'filename' parameter sould be relative to the basepath. The basepath is read from the 'data.dir.item' field in the configuration.

type MoveLoader

type MoveLoader struct {
	// contains filtered or unexported fields
}

func (*MoveLoader) Load

func (ml *MoveLoader) Load() (map[string]model.MoveBase, error)

Load loads every file in the basepath folder and tries to convert it into a move The basepath is read from the 'data.dir.move' field in the configuration.

Failed files will be listed in the returned error object The returned map contains every species, which could be parsed

func (*MoveLoader) LoadMove

func (ml *MoveLoader) LoadMove(reader io.Reader) (model.MoveBase, error)

LoadMove loads a movebase from the given file in the basepath folder. The 'filename' parameter sould be relative to the basepath. The basepath is read from the 'data.dir.move' field in the configuration.

type SpeciesLoader

type SpeciesLoader struct {
	// contains filtered or unexported fields
}

func (*SpeciesLoader) Load

func (ml *SpeciesLoader) Load() (map[string]*model.Species, error)

Load loads every file in the basepath folder and tries to convert it into a monster species The basepath is read from the 'data.dir.monster' field in the configuration.

Failed files will be listed in the returned error object The returned map contains every species, which could be parsed

func (*SpeciesLoader) LoadSpecies

func (ml *SpeciesLoader) LoadSpecies(reader io.Reader) (*model.Species, error)

LoadSpecies loads a monster species from the given file in the basepath folder. The 'filename' parameter sould be relative to the basepath. The basepath is read from the 'data.dir.monster' field in the configuration.

type StatusLoader

type StatusLoader struct {
	// contains filtered or unexported fields
}

func (*StatusLoader) Load

func (ml *StatusLoader) Load() (map[string]*status.Base, error)

Load loads every file in the basepath folder and tries to convert it into an status The basepath is read from the 'data.dir.status' field in the configuration.

Failed files will be listed in the returned error object The returned map contains every species, which could be parsed

func (*StatusLoader) LoadStatus

func (ml *StatusLoader) LoadStatus(reader io.Reader) (*status.Base, error)

LoadStatus loads a statusbase from the given file in the basepath folder. The 'filename' parameter sould be relative to the basepath. The basepath is read from the 'data.dir.status' field in the configuration.

type TraitLoader

type TraitLoader struct {
	TraitFiles map[string]io.Reader
}

func NewTraitLoader

func NewTraitLoader(TraitFiles map[string]io.Reader) *TraitLoader

func (*TraitLoader) Load

func (ml *TraitLoader) Load() (map[string]*model.Trait, error)

Load loads every file in the basepath folder and tries to convert it into an Trait The basepath is read from the 'data.dir.Trait' field in the configuration.

Failed files will be listed in the returned error object The returned map contains every species, which could be parsed

func (*TraitLoader) LoadTrait

func (ml *TraitLoader) LoadTrait(reader io.Reader) (*model.Trait, error)

LoadTrait loads a Traitbase from the given file in the basepath folder. The 'filename' parameter sould be relative to the basepath. The basepath is read from the 'data.dir.Trait' field in the configuration.

type WorldLoader added in v0.4.0

type WorldLoader struct {
	// contains filtered or unexported fields
}

func NewWorldLoader added in v0.4.0

func NewWorldLoader(worldFiles map[string]io.Reader) *WorldLoader

func (*WorldLoader) Load added in v0.4.0

func (ml *WorldLoader) Load() (map[string]*tmx.Map, error)

Load loads every file in the basepath folder and tries to convert it into a world The basepath is read from the 'data.dir.world' field in the configuration.

Failed files will be listed in the returned error object The returned map contains every species, which could be parsed

func (*WorldLoader) LoadWorld added in v0.4.0

func (ml *WorldLoader) LoadWorld(reader io.Reader) (*tmxWorld, error)

LoadWorld loads a worldbase from the given file in the basepath folder. The 'filename' parameter sould be relative to the basepath. The basepath is read from the 'data.dir.world' field in the configuration.

Jump to

Keyboard shortcuts

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