1
0
Fork 0
auts/generic_processor.v

35 lines
646 B
Coq
Raw Permalink Normal View History

2020-04-30 01:02:30 +02:00
module main
2020-04-30 02:16:58 +02:00
interface GenericProcessorI {
process(ob &Object)
}
2020-04-30 01:02:30 +02:00
struct GenericProcessor {
name string
}
struct GenericCrusherProcessor {
//GenericProcessor
mut:
name string
}
fn new_generic_crusher_processor() &GenericCrusherProcessor {
2020-09-05 13:06:27 +02:00
mut gcp := &GenericCrusherProcessor{}
2020-04-30 01:02:30 +02:00
gcp.name = "generic_crusher_processor"
return gcp
}
fn (gpc &GenericCrusherProcessor) process(ob &Object) {
println("processing object: ${ob.name}")
2020-04-30 02:16:58 +02:00
if ob.elem.name == "stone" {
println("> create smaller stones")
println("> create sand")
println("> (visual) create dust")
println("> (audio) emit sound")
} else {
println("nothing happens")
}
2020-04-30 01:02:30 +02:00
}