add LICENSE
This commit is contained in:
parent
fb8892ceb2
commit
fb06ce0a6b
|
@ -0,0 +1,21 @@
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2020 Dawid Wysokiński
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
|
@ -0,0 +1,3 @@
|
||||||
|
# map-generator
|
||||||
|
|
||||||
|
[TribalWars](https://www.tribalwars.net/en-dk/) server map generation package.
|
|
@ -24,22 +24,28 @@ const (
|
||||||
type Marker struct {
|
type Marker struct {
|
||||||
Larger bool
|
Larger bool
|
||||||
Villages []*models.Village `json:"villages" gqlgen:"villages" xml:"villages"`
|
Villages []*models.Village `json:"villages" gqlgen:"villages" xml:"villages"`
|
||||||
Color string `json:"color" gqlgen:"color" xml:"color"`
|
// Color in HEX format
|
||||||
|
Color string `json:"color" gqlgen:"color" xml:"color"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
Markers []*Marker
|
Markers []*Marker
|
||||||
Destination io.Writer
|
Destination io.Writer
|
||||||
MapSize int
|
// Default 1000x1000
|
||||||
ContinentGrid bool
|
MapSize int
|
||||||
ContinentNumbers bool
|
ContinentGrid bool
|
||||||
BackgroundColor string
|
ContinentNumbers bool
|
||||||
GridLineColor string
|
// BackgroundColor in HEX format
|
||||||
|
BackgroundColor string
|
||||||
|
// GridLineColor in HEX format
|
||||||
|
GridLineColor string
|
||||||
|
// ContinentNumberColor in HEX format
|
||||||
ContinentNumberColor string
|
ContinentNumberColor string
|
||||||
Scale float32
|
Scale float32
|
||||||
CenterX int
|
CenterX int
|
||||||
CenterY int
|
CenterY int
|
||||||
Quality int
|
// Quality of image (1-100)
|
||||||
|
Quality int
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cfg *Config) init() {
|
func (cfg *Config) init() {
|
||||||
|
@ -55,7 +61,7 @@ func (cfg *Config) init() {
|
||||||
if cfg.MapSize <= 0 {
|
if cfg.MapSize <= 0 {
|
||||||
cfg.MapSize = defaultMapSize
|
cfg.MapSize = defaultMapSize
|
||||||
}
|
}
|
||||||
if cfg.Quality <= 0 {
|
if cfg.Quality <= 0 || cfg.Quality > 100 {
|
||||||
cfg.Quality = defaultQuality
|
cfg.Quality = defaultQuality
|
||||||
}
|
}
|
||||||
if cfg.Scale < 1 {
|
if cfg.Scale < 1 {
|
||||||
|
|
Reference in New Issue