1
0
Fork 0
auts/elems.v

75 lines
1.4 KiB
Coq
Raw Normal View History

2020-04-30 00:20:08 +02:00
module main
2020-04-30 11:32:03 +02:00
enum ElemType {
2020-05-09 19:05:06 +02:00
none_ // None/Empty
2020-04-30 11:32:03 +02:00
//// Primary form
2020-05-09 19:05:06 +02:00
wood sand stone coal clay iron
2020-04-30 14:02:14 +02:00
// rock -> stone (?)
2020-04-30 11:32:03 +02:00
// Liquid
2020-05-09 19:05:06 +02:00
water oil lava
2020-04-30 11:32:03 +02:00
// Gas(?)
2020-05-09 19:05:06 +02:00
vapour methane
2020-04-30 11:32:03 +02:00
// Extra(?)
2020-05-09 19:05:06 +02:00
soil biomass silt
2020-04-30 11:32:03 +02:00
//// Secondary form
2020-05-09 19:05:06 +02:00
glass concrete brick steel plastic cement
2020-04-30 14:02:14 +02:00
// Liquid
// XXX simplify: no need for special-state concrete,
// use basic type
//liquid_concrete,
//// Compounds(?)
// Ores
2020-05-09 19:05:06 +02:00
iron_ore
aluminium_ore // Bauxite
gold_ore
silver_ore
platinum_ore // (?)
copper_ore
nickel_ore // Garnierite
zinc_ore
lead_ore
uranium_ore
2020-04-30 14:02:14 +02:00
//alumina, // Aluminium oxide
// Construction
// XXX add only as a subtype of concrete? only useful for recycling information...
2020-05-09 19:05:06 +02:00
reinforced_concrete // Approx 90% concrete, 10% steel (on average)
2020-04-30 11:32:03 +02:00
}
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 14:02:14 +02:00
liquid 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-09-05 13:06:27 +02:00
/*
2020-04-30 02:16:58 +02:00
e := &Elem{
//when_crushed_effects: []Effect{},
//when_crushed_out_elems: []Elem{},
//generic_processor0: none,
}
2020-09-05 13:06:27 +02:00
*/
e := &Elem{}
2020-04-30 00:20:08 +02:00
return e
}