예제 #1
0
 public override void ToCString(StringBuilder builder, string macroName)
 {
     builder.AppendLine(string.Format("BBSeriesMacro {0} = new BBSeriesMacro();", macroName));
     string[] fieldNames = new string[] { "times", "duration", "delay" };
     foreach (string fieldName in fieldNames)
     {
         FieldInfo fieldInfo = GetType().GetField(fieldName, BindingFlags.GetField | BindingFlags.Instance | BindingFlags.Public);
         builder.Append(string.Format("{0}.{1} = ", macroName, fieldName));
         BBUtil.ConcatMemberString(builder, fieldInfo.FieldType, fieldInfo.GetValue(this));
         builder.AppendLine(";");
     }
     builder.AppendLine(string.Format("{0}.items = new BBMacro[{1}];", macroName, items.Length));
     for (int i = 0; i < items.Length; i++)
     {
         string itemMacroName = macroName + "_" + i;
         items[i].ToCString(builder, itemMacroName);
         builder.AppendLine(string.Format("{0}.items[{1}] = {2};", macroName, i, itemMacroName));
     }
     if (next != null)
     {
         string nextMacroName = macroName + "_n";
         next.ToCString(builder, nextMacroName);
         builder.AppendLine(string.Format("{0}.next = {1};", macroName, nextMacroName));
     }
 }
예제 #2
0
 public void ToCString(StringBuilder builder, string configName)
 {
     builder.AppendLine(string.Format("BBConfig {0} = new BBConfig();", configName));
     string[] fieldNames = new string[] { "axisType", "clipRatio", "screenWidth", "screenHeight", "device", "monitoringButtons", "monitoringKeyboard" };
     foreach (string fieldName in fieldNames)
     {
         FieldInfo fieldInfo = GetType().GetField(fieldName, BindingFlags.GetField | BindingFlags.Instance | BindingFlags.Public);
         builder.Append(string.Format("{0}.{1} = ", configName, fieldName));
         BBUtil.ConcatMemberString(builder, fieldInfo.FieldType, fieldInfo.GetValue(this));
         builder.AppendLine(";");
     }
 }
예제 #3
0
파일: BBMacro.cs 프로젝트: SylarLi/BBTester
 public virtual void ToCString(StringBuilder builder, string macroName)
 {
     builder.AppendLine(string.Format("BBMacro {0} = new BBMacro();", macroName));
     string[] fieldNames = new string[] { "code", "button", "key", "data", "times", "duration", "delay", "script", "scriptData" };
     foreach (string fieldName in fieldNames)
     {
         FieldInfo fieldInfo = GetType().GetField(fieldName, BindingFlags.GetField | BindingFlags.Instance | BindingFlags.Public);
         builder.Append(string.Format("{0}.{1} = ", macroName, fieldName));
         BBUtil.ConcatMemberString(builder, fieldInfo.FieldType, fieldInfo.GetValue(this));
         builder.AppendLine(";");
     }
     if (next != null)
     {
         string nextMacroName = macroName + "_n";
         next.ToCString(builder, nextMacroName);
         builder.AppendLine(string.Format("{0}.next = {1};", macroName, nextMacroName));
     }
 }