mouse

package
v0.0.0-...-156f350 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package mouse handles all mouse-oriented interactions.

Index

Constants

This section is empty.

Variables

View Source
var ModeFromString = map[string]Mode{
	"Normal":    Normal,
	"Storage":   Storage,
	"SleepHall": SleepHall,
	"Farm":      Farm,
	"Brewery":   Brewery,
	"Bar":       Bar,
	"Library":   Library,
	"Delete":    Delete,
}

Functions

func FuncOverRange

func FuncOverRange(mp *m.Map, start, end int, f func(*m.Map, int, int))

FuncOverRange runs over a map between the start and end points against the supplied function.

func MouseIdx

func MouseIdx() int

func TileRange

func TileRange(start, end int) (int, int, int, int)

TileRange returns a two-dimensional range between start and end, regardless of direction.

Types

type Mode

type Mode int

Mode enum for managing mouse action state.

const (
	Normal Mode = iota
	Storage
	SleepHall
	Farm
	Brewery
	Bar
	Library
	Delete
)

Mode enum.

func (Mode) String

func (m Mode) String() string

type System

type System struct {
	Mode Mode
	// contains filtered or unexported fields
}

System for handling all functionality by mouse.

func NewSystem

func NewSystem() *System

func (*System) Handle

func (s *System) Handle(mp *m.Map, rs *room.Service, dwarves *[]*dwarf.Dwarf) string

Handle all the mouse interactivity.

Jump to

Keyboard shortcuts

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