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 17:17:23 +01:00
parent 5a85cb3d3b
commit 850214a205
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E
4 changed files with 142 additions and 0 deletions

31
block_job_info.go Normal file
View file

@ -0,0 +1,31 @@
package sii
func init() {
RegisterBlock(&JobInfo{})
}
type JobInfo struct {
Cargo Ptr `sii:"cargo"`
SourceCompany Ptr `sii:"source_company"`
TargetCompany Ptr `sii:"target_company"`
IsArticulated bool `sii:"is_articulated"`
IsCargoMarketJob bool `sii:"is_cargo_market_job"`
StartTime int64 `sii:"start_time"`
PlannedDistanceKM int64 `sii:"planned_distance_km"`
FerryTime int64 `sii:"ferry_time"`
FerryPrice int64 `sii:"ferry_price"`
Urgency *int64 `sii:"urgency"`
Special Ptr `sii:"special"`
UnitCount int64 `sii:"units_count"`
FillRatio float32 `sii:"fill_ratio"`
blockName string
}
func (JobInfo) Class() string { return "job_info" }
func (j *JobInfo) Init(class, name string) {
j.blockName = name
}
func (j JobInfo) Name() string { return j.blockName }

49
block_player_job.go Normal file
View file

@ -0,0 +1,49 @@
package sii
func init() {
RegisterBlock(&PlayerJob{})
}
type PlayerJob struct {
CompanyTruck Ptr `sii:"company_truck"`
CompanyTrailer Ptr `sii:"company_trailer"`
TargetPlacement Placement `sii:"target_placement"`
TargetPlacementMedium Placement `sii:"target_placement_medium"`
TargetPlacementHard Placement `sii:"target_placement_hard"`
TargetPlacementRigid Placement `sii:"target_placement_rigid"`
SourcePlacement Placement `sii:"source_placement"`
SelectedTarget int64 `sii:"selected_target"` // Needs verification
TimeLowerLimit int64 `sii:"time_lower_limit"`
TimeUpperLimit int64 `sii:"time_upper_limit"`
JobDistance int64 `sii:"job_distance"`
FuelConsumed float32 `sii:"fuel_consumed"`
LastReportedFuel float32 `sii:"last_reported_fuel"`
TotalFines int64 `sii:"total_fines"` // Needs verification
IsTrailerLoaded bool `sii:"is_trailer_loaded"`
OnlineJobID *int64 `sii:"online_job_id"` // Needs verification
OnlineJobTrailerModel Ptr `sii:"online_job_trailer_model"`
AutoloadUsed bool `sii:"autoload_used"`
Cargo Ptr `sii:"cargo"` // External pointer
SourceCompany Ptr `sii:"source_company"`
TargetCompany Ptr `sii:"target_company"`
IsArticulated bool `sii:"is_articulated"`
IsCargoMarketJob bool `sii:"is_cargo_market_job"`
StartTime int64 `sii:"start_time"`
PlannedDistanceKM int64 `sii:"planned_distance_km"`
FerryTime int64 `sii:"ferry_time"`
FerryPrice int64 `sii:"ferry_price"`
Urgency *int64 `sii:"urgency"`
Special Ptr `sii:"special"`
UnitCount int64 `sii:"units_count"`
FillRatio float32 `sii:"fill_ratio"`
blockName string
}
func (PlayerJob) Class() string { return "player_job" }
func (p *PlayerJob) Init(class, name string) {
p.blockName = name
}
func (p PlayerJob) Name() string { return p.blockName }

32
block_trailer.go Normal file
View file

@ -0,0 +1,32 @@
package sii
func init() {
RegisterBlock(&Trailer{})
}
type Trailer struct {
TrailerDefinition Ptr `sii:"trailer_definition"`
CargoMass int64 `sii:"cargo_mass"`
CargoDamage float32 `sii:"cargo_damage"` // Needs verification
VirtualRearWheelsOffset int64 `sii:"virtual_rear_wheels_offset"` // Needs verification
SlaveTrailer Ptr `sii:"slave_trailer"`
IsPrivate bool `sii:"is_private"`
Accessories []Ptr `sii:"accessories"`
Odometer int64 `sii:"odometer"`
OdometerFloatPart float32 `sii:"odometer_float_part"`
TripFuelL int64 `sii:"trip_fuel_l"` // Needs verification
TripFuel int64 `sii:"trip_fuel"` // Needs verification
TripDistanceKM int64 `sii:"trip_distance_km"` // Needs verification
TripDistance int64 `sii:"trip_distance"` // Needs verification
LicensePlate string `sii:"license_plate"`
blockName string
}
func (Trailer) Class() string { return "trailer" }
func (t *Trailer) Init(class, name string) {
t.blockName = name
}
func (t Trailer) Name() string { return t.blockName }

30
block_trailer_def.go Normal file
View file

@ -0,0 +1,30 @@
package sii
func init() {
RegisterBlock(&TrailerDef{})
}
type TrailerDef struct {
Trailer string `sii:"trailer"`
GrossTrailerWeightLimit int64 `sii:"gross_trailer_weight_limit"`
ChassisMass int64 `sii:"chassis_mass"`
BodyMass int64 `sii:"body_mass"`
Axles int64 `sii:"axles"`
Volume int64 `sii:"volume"`
BodyType Ptr `sii:"body_type"`
ChainType Ptr `sii:"chain_type"`
CountryValidity int64 `sii:"country_validity"` // Needs verification
MassRatio []float32 `sii:"mass_ratio"`
Length float32 `sii:"length"`
SourceName string `sii:"source_name"`
blockName string
}
func (TrailerDef) Class() string { return "trailer_def" }
func (t *TrailerDef) Init(class, name string) {
t.blockName = name
}
func (t TrailerDef) Name() string { return t.blockName }