layer

package
v0.0.0-...-15a57b5 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ContainerPadding = 1
	ContainerStyle   = lipgloss.NewStyle().
						Padding(ContainerPadding)

	MainContentBlock = ContainerStyle.Copy().Border(lipgloss.NormalBorder(), true)
	SidebarBlock     = ContainerStyle.Copy().Border(lipgloss.NormalBorder(), true)
)

Functions

func Chunk

func Chunk(slice []Upgrade, chunkSize int) [][]Upgrade

func List

func List(upgrades []Upgrade) []string

Types

type Achievement

type Achievement interface {
	Tick()
	Done() bool
	Effect()
	Unlocked() bool
	Model() *ModelAchievement
}

type Layer

type Layer interface {
	Tick()               // Run on each tick
	TickAmount() float64 // Amount generated on each tick

	Prestige()               // Run when player wants to prestige the layer
	PrestigeAmount() float64 // Amount generated when prestiged

	Reset() // Called when the layer needs to be reseted

	Update(msg tea.Msg) (Layer, tea.Cmd)
	View() string
	Model() *Model
	UpdateProgramContext(ctx *context.ProgramContext)
}

type LayerMsg

type LayerMsg interface {
	GetLayerId() int
}

type LayerTickMsg

type LayerTickMsg struct {
	LayerId int
}

func (LayerTickMsg) GetLayerId

func (msg LayerTickMsg) GetLayerId() int

type Layers

type Layers struct {
	Points Layer

	PrestigePoints Layer

	Boosters   Layer
	Generators Layer
}

type Milestone

type Milestone interface {
	Tick()
	Done() bool
	Unlocked() bool
	Model() *ModelMilestone
}

type Model

type Model struct {
	Name string // Name of the layer
	Id   int    // Unique ID of the layer
	Tier int    // Tier of the layer

	Unlocked bool              // Has the layer been unlocked?
	Required map[Layer]float64 // Required layers and amount to unlock it

	Layers *Layers // Every layers used, to easily access them

	Amount      float64 // Current amount
	AmountTotal float64 // Total amount generated
	AmountBest  float64 // Best amount reached

	Achievements []Achievement // All layer achievements
	Milestones   []Milestone   // All layer milestones
	Upgrades     []Upgrade     // All layer upgrades

	Ctx *context.ProgramContext // Program context
	// contains filtered or unexported fields
}

func (*Model) CheckUnlock

func (m *Model) CheckUnlock() bool

func (*Model) GetDimensions

func (m *Model) GetDimensions() constants.Dimensions

func (*Model) ListUpgradeAvailable

func (m *Model) ListUpgradeAvailable() bool

func (*Model) ListUpgradeEnabled

func (m *Model) ListUpgradeEnabled() []Upgrade

func (*Model) SaveBestAmount

func (m *Model) SaveBestAmount()

func (*Model) SetDimensions

func (m *Model) SetDimensions(dimensions constants.Dimensions)

func (*Model) UpdateProgramContext

func (m *Model) UpdateProgramContext(ctx *context.ProgramContext)

func (*Model) ViewLocked

func (m *Model) ViewLocked() string

type ModelAchievement

type ModelAchievement struct {
	Name        string
	Description string
	Achieved    bool
	Layers      *Layers
}

type ModelMilestone

type ModelMilestone struct {
	Name                   string
	Description            string
	RequirementDescription string
	Reached                bool
	Layers                 *Layers
}

type ModelUpgrade

type ModelUpgrade struct {
	Name        string
	Description string
	Amount      uint
	Cost        float64
	Enabled     bool
	Layers      *Layers
}

func (*ModelUpgrade) Buy

func (m *ModelUpgrade) Buy(currency *Model)

func (*ModelUpgrade) View

func (m *ModelUpgrade) View(upgrade Upgrade) string

type Upgrade

type Upgrade interface {
	Tick()
	TickAmount() float64
	Effect() string

	Buy()

	Unlocked() bool

	Model() *ModelUpgrade
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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