2020-04-30 00:20:08 +02:00
|
|
|
module main
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
println("main()")
|
|
|
|
|
|
|
|
mut e := new_elem()
|
|
|
|
e.name = "wood"
|
|
|
|
e.density = 100
|
|
|
|
e.flameable = true
|
|
|
|
_ = e
|
|
|
|
|
|
|
|
println("e: ${e}")
|
|
|
|
|
|
|
|
mut e2 := new_elem()
|
|
|
|
e2.name = "sand"
|
|
|
|
e2.density = 2000
|
|
|
|
|
|
|
|
println("e2: ${e2}")
|
|
|
|
|
|
|
|
mut e3 := new_elem()
|
|
|
|
e3.name = "glass"
|
|
|
|
e3.density = 2200
|
|
|
|
|
|
|
|
mut e4 := new_elem()
|
|
|
|
e4.name = "stone"
|
|
|
|
e4.density = 8000
|
|
|
|
|
|
|
|
//
|
|
|
|
// Effects
|
|
|
|
//
|
|
|
|
|
|
|
|
ef := new_effect()
|
|
|
|
ef.name = "melt"
|
|
|
|
ef.in_elem = e2
|
|
|
|
ef.out_elem = e3
|
|
|
|
ef.cond_temp = 5000
|
|
|
|
|
|
|
|
println("ef: ${ef}")
|
|
|
|
|
|
|
|
//
|
|
|
|
// Objects
|
|
|
|
//
|
|
|
|
|
|
|
|
ob := new_object()
|
|
|
|
ob.name = "stone1"
|
|
|
|
ob.dim_x = 2
|
|
|
|
ob.dim_y = 2
|
|
|
|
ob.dim_z = 2
|
|
|
|
ob.elem = e4
|
|
|
|
|
|
|
|
println("ob: ${ob}")
|
|
|
|
|
2020-04-30 00:34:02 +02:00
|
|
|
//
|
|
|
|
// Processors
|
|
|
|
//
|
|
|
|
|
|
|
|
prc := new_processor()
|
|
|
|
prc.name = "crushed_stone"
|
|
|
|
prc.in_elem = e4
|
|
|
|
prc.out_elem = e4
|
|
|
|
prc.output_factor = 0.6
|
|
|
|
prc.req_electricity = true
|
|
|
|
prc.req_power = 1000
|
|
|
|
|
|
|
|
println("prc: ${prc}")
|
|
|
|
|
|
|
|
//
|
|
|
|
// Universal Processors?
|
|
|
|
//
|
|
|
|
|
2020-04-30 00:20:08 +02:00
|
|
|
println("done")
|
|
|
|
}
|