Documentation ¶
Overview ¶
Package with game area struct.
Index ¶
- Variables
- type Area
- func (a *Area) AddObject(o Object)
- func (a *Area) AddSubarea(sa *Area)
- func (a *Area) AllObjects() (objects []Object)
- func (a *Area) AllSubareas() (subareas []*Area)
- func (a *Area) Apply(data res.AreaData)
- func (a *Area) Data() res.AreaData
- func (a *Area) ID() string
- func (a *Area) Map() Map
- func (a *Area) NearObjects(x, y, maxrange float64) (obs []Object)
- func (a *Area) Objects() (objects []Object)
- func (a *Area) RemoveObject(o Object)
- func (a *Area) RemoveSubarea(sa *Area)
- func (a *Area) SightRangeObjects(x, y float64) (obs []Object)
- func (a *Area) Subareas() (areas []*Area)
- func (a *Area) Update(delta int64)
- func (a *Area) Weather() *Weather
- type Conditions
- type Layer
- type Map
- type Object
- type Respawn
- type Tile
- type Weather
Constants ¶
This section is empty.
Variables ¶
var PassableMapLayers = []string{"ground"}
List with names of the map layers on which the area objects can move.
Functions ¶
This section is empty.
Types ¶
type Area ¶
Area struct represents game world area.
func (*Area) AddSubarea ¶
AddSubareas adds specified area to subareas.
func (*Area) AllObjects ¶
AllObjects retuns list with all objects in area and subareas.
func (*Area) AllSubareas ¶
AllSubareas returns all subareas, including subareas of subareas
func (*Area) NearObjects ¶
NearObjects returns all objects within specified range from specified XY position.
func (*Area) RemoveObject ¶
RemoveObject removes specified object from area.
func (*Area) RemoveSubarea ¶
RemoveSubareas removes specified subobject.
func (*Area) SightRangeObjects ¶
SightRangeObjects retuns all objects that have specified XY position in their sight range.
type Conditions ¶
type Conditions string
Type for area weather conditions.
const ( Sunny Conditions = Conditions("weatherSunny") Rain = Conditions("weatherRain") )
type Layer ¶
type Layer struct {
// contains filtered or unexported fields
}
Struct for area map layer.
type Map ¶
type Map struct {
// contains filtered or unexported fields
}
Struct for area map.
func (Map) PositionLayer ¶
PositionLayer returns visible layer on specified XY position on the map.
type Object ¶
type Object interface { effect.Target Update(d int64) Live() bool Respawn() int64 AreaID() string SetAreaID(s string) SightRange() float64 Moving() bool DestPoint() (float64, float64) Interrupt() BaseMoveCooldown() int64 MoveCooldown() int64 SetMoveCooldown(c int64) }
Interface for area objects.
type Respawn ¶
type Respawn struct {
// contains filtered or unexported fields
}
Struct for area respawn.
func (*Respawn) Data ¶
func (r *Respawn) Data() res.RespawnData
Data returns data resource for respawn.
type Weather ¶
type Weather struct { Conditions Conditions // contains filtered or unexported fields }
Struct for area weather.