2020-04-30 00:20:08 +02:00
|
|
|
module main
|
|
|
|
|
2020-04-30 11:32:03 +02:00
|
|
|
enum ElemType {
|
|
|
|
none_, // None/Empty
|
|
|
|
|
|
|
|
//// Primary form
|
|
|
|
wood, sand, stone, coal, clay,
|
|
|
|
// Liquid
|
|
|
|
water, oil,
|
|
|
|
// Gas(?)
|
|
|
|
vapour, methane,
|
|
|
|
// Extra(?)
|
|
|
|
biomass,
|
|
|
|
|
|
|
|
//// Secondary form
|
|
|
|
glass, concrete, brick
|
|
|
|
}
|
|
|
|
|
2020-04-30 00:20:08 +02:00
|
|
|
struct Elem {
|
|
|
|
mut:
|
|
|
|
name string
|
2020-04-30 11:32:03 +02:00
|
|
|
elem_type ElemType
|
2020-04-30 00:20:08 +02:00
|
|
|
density int // XXX per bit?
|
|
|
|
flameable bool
|
2020-04-30 02:16:58 +02:00
|
|
|
|
|
|
|
// when
|
|
|
|
//when_crushed_fn fn()
|
|
|
|
//when_crushed_effects []Effect
|
|
|
|
//when_crushed_out_elems []Elem
|
|
|
|
|
|
|
|
// list of processors
|
|
|
|
//generic_processors []GenericProcessorI // XXX no interface arrays
|
|
|
|
//generic_processors map[string]GenericProcessorI
|
|
|
|
//generic_processor0 &GenericProcessorI
|
|
|
|
//generic_processor0 &GenericCrusherProcessor
|
2020-04-30 00:20:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
fn new_elem() &Elem {
|
2020-04-30 02:16:58 +02:00
|
|
|
e := &Elem{
|
|
|
|
//when_crushed_effects: []Effect{},
|
|
|
|
//when_crushed_out_elems: []Elem{},
|
|
|
|
//generic_processor0: none,
|
|
|
|
}
|
2020-04-30 00:20:08 +02:00
|
|
|
return e
|
|
|
|
}
|