1
0
Fork 0
mirror of https://github.com/Luzifer/sii.git synced 2024-12-21 00:21:15 +00:00

Add new blocks

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2019-12-11 18:38:23 +01:00
parent ab32292dfe
commit a73cada4f5
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E
4 changed files with 82 additions and 0 deletions

21
block_economy_event.go Normal file
View file

@ -0,0 +1,21 @@
package sii
func init() {
RegisterBlock(&EconomyEvent{})
}
type EconomyEvent struct {
Time int64 `sii:"time"`
UnitLink Ptr `sii:"unit_link"`
Param int64 `sii:"param"`
blockName string
}
func (EconomyEvent) Class() string { return "economy_event" }
func (e *EconomyEvent) Init(class, name string) {
e.blockName = name
}
func (e EconomyEvent) Name() string { return e.blockName }

View file

@ -0,0 +1,19 @@
package sii
func init() {
RegisterBlock(&EconomyEventQueue{})
}
type EconomyEventQueue struct {
Data []Ptr `sii:"data"`
blockName string
}
func (EconomyEventQueue) Class() string { return "economy_event_queue" }
func (e *EconomyEventQueue) Init(class, name string) {
e.blockName = name
}
func (e EconomyEventQueue) Name() string { return e.blockName }

View file

@ -0,0 +1,20 @@
package sii
func init() {
RegisterBlock(&GPSWaypointStorage{})
}
type GPSWaypointStorage struct {
NavNodePosition [3]float32 `sii:"nav_node_position"`
Direction Ptr `sii:"direction"`
blockName string
}
func (GPSWaypointStorage) Class() string { return "gps_waypoint_storage" }
func (g *GPSWaypointStorage) Init(class, name string) {
g.blockName = name
}
func (g GPSWaypointStorage) Name() string { return g.blockName }

22
block_registry.go Normal file
View file

@ -0,0 +1,22 @@
package sii
func init() {
RegisterBlock(&Registry{})
}
type Registry struct {
Data []int64 `sii:"data"`
Valid []bool `sii:"valid"`
Keys []int64 `sii:"keys"`
Index []int64 `sii:"index"`
blockName string
}
func (Registry) Class() string { return "registry" }
func (r *Registry) Init(class, name string) {
r.blockName = name
}
func (r Registry) Name() string { return r.blockName }