refactor: put all info about different unit types into UnitTypes map

This commit is contained in:
5684185+vsariola@users.noreply.github.com
2026-03-15 10:29:24 +02:00
parent 8ea9d3a191
commit 6a331f7a57
8 changed files with 392 additions and 331 deletions

View File

@ -262,7 +262,7 @@ func (b *bytecodeBuilder) operand(operands ...int) {
// defOperands appends the operands to the stream for all parameters that can be
// modulated and set
func (b *bytecodeBuilder) defOperands(unit sointu.Unit) {
for _, v := range sointu.UnitTypes[unit.Type] {
for _, v := range sointu.UnitTypes[unit.Type].Params {
if v.CanModulate && v.CanSet {
b.Operands = append(b.Operands, byte(unit.Parameters[v.Name]))
}