objects

package
v0.0.0-...-ac9a988 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: GPL-2.0 Imports: 4 Imported by: 8

Documentation

Overview

Package with utils for module objects.

Index

Constants

View Source
const (
	ElementNone   Element = Element("elementNone")
	ElementFire           = Element("elementFire")
	ElementFrost          = Element("elementFrost")
	ElementNature         = Element("elementNature")
)

Variables

This section is empty.

Functions

func Equals

func Equals(ob1, ob2 serial.Serialer) bool

Equals checks whether two specified objects represents the same game object.

func Range

func Range(ob1, ob2 Positioner) float64

Range returns range between two objects.

Types

type Element

type Element string

Struct for object effect types.

type Experiencer

type Experiencer interface {
	Killable
	SetExperience(v int)
	Experience() int
	MaxExperience() int
	Level() int
}

Interfece for objects with experience points.

type Killable

type Killable interface {
	serial.Serialer
	SetHealth(v int)
	Health() int
	MaxHealth() int
	Live() bool
}

Interface for objects with health points.

type Killer

type Killer interface {
	serial.Serialer
	AddKill(k res.KillData)
	Kills() []res.KillData
}

Interface for objects with kill records.

type Log

type Log struct {
	// contains filtered or unexported fields
}

Struct for character log.

func NewLog

func NewLog() *Log

NewLog creates new log.

func (*Log) Add

func (l *Log) Add(message Message)

Add adds new message to log.

func (*Log) Apply

func (l *Log) Apply(data res.ObjectLogData)

Apply applies specified data on the object log.

func (*Log) Channel

func (l *Log) Channel() chan Message

Channel returns log channel.

func (*Log) Clear

func (l *Log) Clear()

Clear clears log messages.

func (*Log) Data

func (l *Log) Data() (data res.ObjectLogData)

Data creates data resource for object log.

func (*Log) Messages

func (l *Log) Messages() []Message

Messages returns all messages from log.

type Logger

type Logger interface {
	serial.Serialer
	ChatLog() *Log
}

Interface for objects with log channels.

type Magician

type Magician interface {
	Killable
	SetMana(v int)
	Mana() int
	MaxMana() int
}

Interface for objects with mana points.

type Message

type Message res.ObjectLogMessageData

Struct for character log message.

func NewMessage

func NewMessage(text string, translated bool) Message

NewMessage creates new message. Message time will be set to current system time.

func (Message) String

func (m Message) String() string

String returns message text.

type Positioner

type Positioner interface {
	serial.Serialer
	SetPosition(x, y float64)
	Position() (x, y float64)
}

Interface for all object with position on game world map.

type Resilience

type Resilience struct {
	Normal int
	Fire   int
	Frost  int
	Nature int
	Magic  int
}

Struct for object resiliences.

Jump to

Keyboard shortcuts

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