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:
parent
ab32292dfe
commit
a73cada4f5
4 changed files with 82 additions and 0 deletions
21
block_economy_event.go
Normal file
21
block_economy_event.go
Normal 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 }
|
19
block_economy_event_queue.go
Normal file
19
block_economy_event_queue.go
Normal 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 }
|
20
block_gps_waypoint_storage.go
Normal file
20
block_gps_waypoint_storage.go
Normal 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
22
block_registry.go
Normal 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 }
|
Loading…
Reference in a new issue