model

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2021 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HarborGrain  = &Harbor{Name: "2:1 Grain", Resource: *Grain}
	HarborBrick  = &Harbor{Name: "2:1 Brick", Resource: *Brick}
	HarborOre    = &Harbor{Name: "2:1 Ore", Resource: *Ore}
	HarborWool   = &Harbor{Name: "2:1 Wool", Resource: *Wool}
	HarborLumber = &Harbor{Name: "2:1 Lumber", Resource: *Lumber}
	HarborAll    = &Harbor{Name: "3:1", Resource: *All}
	HarborNone   = &Harbor{Name: "None", Resource: *None}

	Harbors = harbors{
		Grain.Code:  *HarborGrain,
		Lumber.Code: *HarborLumber,
		All.Code:    *HarborAll,
		None.Code:   *HarborNone,
		Wool.Code:   *HarborWool,
		Ore.Code:    *HarborOre,
		Brick.Code:  *HarborBrick,
	}
)
View Source
var (
	Desert   = &Landscape{Name: "Desert", Resource: *None}
	Field    = &Landscape{Name: "Field", Resource: *Grain}
	Forest   = &Landscape{Name: "Forest", Resource: *Lumber}
	Pasture  = &Landscape{Name: "Pasture", Resource: *Wool}
	Mountain = &Landscape{Name: "Mountain", Resource: *Ore}
	Hill     = &Landscape{Name: "Hill", Resource: *Brick}

	Landscapes = landscapes{
		Grain.Code:  *Field,
		Lumber.Code: *Forest,
		None.Code:   *Desert,
		Wool.Code:   *Pasture,
		Ore.Code:    *Mountain,
		Brick.Code:  *Hill,
	}
)
View Source
var (
	NumberEmpty = &Number{Number: 0, Score: 1, Code: "z"} // Desert or Sea tiles
	Number2     = &Number{Number: 2, Score: 27, Code: "a"}
	Number3     = &Number{Number: 3, Score: 55, Code: "b"}
	Number4     = &Number{Number: 4, Score: 83, Code: "c"}
	Number5     = &Number{Number: 5, Score: 111, Code: "d"}
	Number6     = &Number{Number: 6, Score: 139, Code: "e"}
	Number8     = &Number{Number: 8, Score: 139, Code: "f"}
	Number9     = &Number{Number: 9, Score: 111, Code: "g"}
	Number10    = &Number{Number: 10, Score: 83, Code: "h"}
	Number11    = &Number{Number: 11, Score: 55, Code: "i"}
	Number12    = &Number{Number: 12, Score: 27, Code: "j"}

	// Numbers map container all the numbers for searching by code
	Numbers = numbers{
		NumberEmpty.Code: *NumberEmpty,
		Number2.Code:     *Number2,
		Number3.Code:     *Number3,
		Number4.Code:     *Number4,
		Number5.Code:     *Number5,
		Number6.Code:     *Number6,
		Number8.Code:     *Number8,
		Number9.Code:     *Number9,
		Number10.Code:    *Number10,
		Number11.Code:    *Number11,
		Number12.Code:    *Number12,
	}
)
View Source
var (
	All    = &Resource{"All", "0"}
	Lumber = &Resource{"Lumber", "1"}
	Wool   = &Resource{"Wool", "2"}
	Grain  = &Resource{"Grain", "3"}
	Brick  = &Resource{"Brick", "4"}
	Ore    = &Resource{"Ore", "5"}
	None   = &Resource{"None", "6"} // Desert
)

Functions

This section is empty.

Types

type Harbor

type Harbor struct {
	Name string
	Resource
}

Harbor is a Catan harbor, consisting out of a simple name, and the resource it has the trade benefit for

type Landscape

type Landscape struct {
	Name string
	Resource
}

Landscape is the Catan landscape type, such as Forest, Mountain Each has a name (for readability), and a code for compact data transfer/processing

type Number

type Number struct {
	Number int
	Score  int
	Code   string
}

Number the number fiche that comes on top the Tile Also has a Score, which is the probability score of the number being rolled with two dices

type Resource

type Resource struct {
	Name string
	Code string
}

type Tile

type Tile struct {
	Landscape Landscape
	Number    Number
	Harbor    Harbor
}

Tile the tiles that make up the Catan game board A tile consists out of a Landscape, a Number, and a Harbor The Resource is for easier processing/printing

Jump to

Keyboard shortcuts

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