2019-08-17 17:35:48 +02:00
|
|
|
tool
|
2019-08-12 15:58:42 +02:00
|
|
|
extends Object
|
|
|
|
class_name MMGenContext
|
|
|
|
|
2019-08-17 17:35:48 +02:00
|
|
|
var renderer : MMGenRenderer
|
2019-08-12 15:58:42 +02:00
|
|
|
var variants : Dictionary = {}
|
|
|
|
|
2019-08-17 17:35:48 +02:00
|
|
|
func _init(r : MMGenRenderer):
|
|
|
|
renderer = r
|
|
|
|
|
2019-08-12 15:58:42 +02:00
|
|
|
func has_variant(generator):
|
|
|
|
return variants.has(generator)
|
|
|
|
|
|
|
|
func get_variant(generator, uv):
|
|
|
|
var rv = -1
|
|
|
|
if variants.has(generator):
|
|
|
|
rv = variants[generator].find(uv)
|
|
|
|
if rv == -1:
|
2019-09-10 21:01:08 +02:00
|
|
|
variants[generator].push_back(uv)
|
2019-08-12 15:58:42 +02:00
|
|
|
else:
|
|
|
|
variants[generator] = [uv]
|
|
|
|
return rv
|