public void Next() { if (builder == null) { builder = new EffectBuilder(currentCompilerNode); } FieldData nextFieldData = currentCompilerNode.GetNextFieldData(); if (nextFieldData == null) { if (currentCompilerNode.parent == null) { Last(); return; } else { currentCompilerNode = currentCompilerNode.parent; Next(); return; } } currentFieldData = nextFieldData; // handling for auxiliary bytes if (Array.IndexOf(currentFieldData.attributes, "auxiliary") != -1) { string typeString = currentFieldData.returnType.ToString(); Instruction instruction = EffectData.GetEffectDataByName(typeString).instruction; currentCompilerNode.Add( new EffectBuilderItem(new List <byte> { (byte)instruction }) ); Next(); return; } SetState(); }
public void SubmitSelection() { string selection = dropdown.options[dropdown.value].text; EffectData data = EffectData.GetEffectDataByName(selection); EffectBuilderItem newNode = data != null ? new EffectBuilderItem(data) : null; // handling for enums if (currentCompilerNode != null) { string typeString = currentFieldData.returnType.ToString(); if (typeString.StartsWith("ENUM")) { EnumRepesentation enumRepesentation = EnumRepesentation.EnumLookup(typeString); Instruction enumInstruction = enumRepesentation.getInstruction(); EffectData effectDataForEnumInstruction = EffectData.GetEffectDataByInstruction(enumInstruction); EffectBuilderItem compilerNode = new EffectBuilderItem(effectDataForEnumInstruction); currentCompilerNode.Add(compilerNode); byte enumValue = (byte)enumRepesentation.getIndex(selection); compilerNode.Add(new EffectBuilderItem(new List <byte> { enumValue })); Next(); return; } else if (newNode != null) { currentCompilerNode.Add(newNode); } } if (newNode != null) { currentCompilerNode = newNode; } Next(); }