nano

package
v0.0.0-...-07010e4 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bot

type Bot struct {
	ID       int
	Position Vector
	Radius   int
}

func ParseBot

func ParseBot(s string, id int) (*Bot, error)

func (*Bot) FirstIntersectionPoint

func (b *Bot) FirstIntersectionPoint(ob *Bot) Vector

func (*Bot) InRange

func (b *Bot) InRange(pos Vector) bool

func (*Bot) Intersect

func (b *Bot) Intersect(obots ...*Bot) *Intersection

func (*Bot) Intersects

func (b *Bot) Intersects(ob *Bot) bool

type Intersection

type Intersection struct {
	Bots []*Bot
}

func (*Intersection) FirstPoint

func (i *Intersection) FirstPoint() Vector

func (*Intersection) Hash

func (i *Intersection) Hash() string

func (*Intersection) Intersects

func (i *Intersection) Intersects(ob *Bot) bool

func (*Intersection) Smallest

func (is *Intersection) Smallest()

type Vector

type Vector struct {
	X, Y, Z int
}

func (Vector) Add

func (v Vector) Add(ov Vector) Vector

func (Vector) Dir

func (v Vector) Dir(toV Vector) Vector

func (Vector) Distance

func (v Vector) Distance(ov Vector) int

func (Vector) IsZero

func (v Vector) IsZero() bool

func (Vector) Len

func (v Vector) Len() int

func (Vector) Mult

func (v Vector) Mult(n int) Vector

func (Vector) String

func (v Vector) String() string

func (Vector) Sub

func (v Vector) Sub(ov Vector) Vector

Jump to

Keyboard shortcuts

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