1
0
Fork 0
mirror of https://github.com/Luzifer/sii.git synced 2024-12-20 16:11:17 +00:00

Add new blocks

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

19
block_ferry_log.go Normal file
View file

@ -0,0 +1,19 @@
package sii
func init() {
RegisterBlock(&FerryLog{})
}
type FerryLog struct {
Entries []Ptr `sii:"entries"`
blockName string
}
func (FerryLog) Class() string { return "ferry_log" }
func (f *FerryLog) Init(class, name string) {
f.blockName = name
}
func (f FerryLog) Name() string { return f.blockName }

22
block_ferry_log_entry.go Normal file
View file

@ -0,0 +1,22 @@
package sii
func init() {
RegisterBlock(&FerryLogEntry{})
}
type FerryLogEntry struct {
Ferry Ptr `sii:"ferry"`
Connection Ptr `sii:"connection"`
LastVisit int64 `sii:"last_visit"`
UseCount int64 `sii:"use_count"`
blockName string
}
func (FerryLogEntry) Class() string { return "ferry_log_entry" }
func (f *FerryLogEntry) Init(class, name string) {
f.blockName = name
}
func (f FerryLogEntry) Name() string { return f.blockName }

22
block_profit_log.go Normal file
View file

@ -0,0 +1,22 @@
package sii
func init() {
RegisterBlock(&ProfitLog{})
}
type ProfitLog struct {
StatsData []Ptr `sii:"stats_data"`
AccDistanceFree int64 `sii:"acc_distance_free"`
AccDistanceOnJob int64 `sii:"acc_distance_on_job"`
HistoryAge *int64 `sii:"history_age"`
blockName string
}
func (ProfitLog) Class() string { return "profit_log" }
func (p *ProfitLog) Init(class, name string) {
p.blockName = name
}
func (p ProfitLog) Name() string { return p.blockName }

31
block_profit_log_entry.go Normal file
View file

@ -0,0 +1,31 @@
package sii
func init() {
RegisterBlock(&ProfitLogEntry{})
}
type ProfitLogEntry struct {
Revenue int64 `sii:"revenue"`
Wage int64 `sii:"wage"`
Maintenance int64 `sii:"maintenance"`
Fuel int64 `sii:"fuel"`
Distance int64 `sii:"distance"`
DistanceOnJob bool `sii:"distance_on_job"`
CargoCount int64 `sii:"cargo_count"`
Cargo string `sii:"cargo"`
SourceCity string `sii:"source_city"`
SourceCompany string `sii:"source_company"`
DestinationCity string `sii:"destination_city"`
DestinationCompany string `sii:"destination_company"`
TimestampDay int64 `sii:"timestamp_day"`
blockName string
}
func (ProfitLogEntry) Class() string { return "profit_log_entry" }
func (p *ProfitLogEntry) Init(class, name string) {
p.blockName = name
}
func (p ProfitLogEntry) Name() string { return p.blockName }