db

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: 5 Imported by: 0

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/\>.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BattleDB

type BattleDB interface {
	CreateRequest(model.Request) (model.ID, error)
	LoadRequest(model.ID) (model.Request, error)
	SaveRequest(model.Request) error
	LoadRequestByBreeder(model.ID) ([]model.Request, error)
}

type BreederDB

type BreederDB interface {
	Create(model.Breeder) (model.ID, error)
	Load(model.ID) (model.Breeder, error)
	Save(model.Breeder) error
	LoadAll() ([]model.Breeder, error)
	Delete(model.ID) error
	SavePosition(breederID model.ID, position model.Vector2D) (err error)
}

type Container

type Container struct {
	SpeciesLoader SpeciesLoader
	BreederDB     BreederDB
	MonsterDB     MonsterDB
	BattleDB      BattleDB
}

type FileProvider

type FileProvider interface {
	ProvideFiles(basepath string) (map[string]map[string]io.Reader, error)
}

type ItemDB

type ItemDB interface {
	Add(breederID model.ID, itemName string, amount int) error
	Remove(breederID model.ID, itemName string, amount int) error

	//Returns every item and amount in the inventory of the breeder
	Inventory(breederID model.ID) (map[string]int, error)
}

type ItemLoader

type ItemLoader interface {
	Load() (map[string]*item.Base, error)
}

type MonsterDB

type MonsterDB interface {
	Create(model.Monster) (model.ID, error)
	Load(model.ID) (model.Monster, error)
	Save(model.Monster) error
	LoadTeamByBreederId(model.ID) ([]model.Monster, error)
	SaveTeamByBreederId(model.ID, []model.Monster) error
	Delete(model.ID) error
}

type MoveLoader

type MoveLoader interface {
	Load() (map[string]model.MoveBase, error)
}

type NotFoundError

type NotFoundError struct {
	Msg string
}

func (NotFoundError) Error

func (nfe NotFoundError) Error() string

func (NotFoundError) Is

func (nfe NotFoundError) Is(err error) bool

type SpeciesLoader

type SpeciesLoader interface {
	Load() (map[string]*model.Species, error)
}

type StatusLoader

type StatusLoader interface {
	Load() (map[string]*status.Base, error)
}

Directories

Path Synopsis
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.
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.
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.
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.
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.
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.
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.
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.

Jump to

Keyboard shortcuts

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