예제 #1
0
        private static void AppendTriggerable(this StringBuilder builder, Triggerable triggerable)
        {
            builder.AppendLine("   [TRIGGERABLE]");

            builder.AppendFormat("      <STRING>Name:{0}\r\n", triggerable.Name);
            builder.AppendFormat("      <STRING>File:{0}\r\n", triggerable.File);

            builder.AppendLine("   [/TRIGGERABLE]");
        }
예제 #2
0
        private static Triggerable ReadTriggerable(ref StringReader reader, ref int lineNumber)
        {
            Triggerable triggerable = new Triggerable();

            string line;
            int startLine = lineNumber;
            bool[] hasSet = new bool[2];

            while ((line = reader.ReadLine()) != null)
            {
                lineNumber++;

                if (line == "[/TRIGGERABLE]")
                {
                    break;
                }
                else if (line.StartsWith("<STRING>Name:"))
                {
                    line = line.Replace("<STRING>Name:", "").Trim();

                    triggerable.Name = line;
                    hasSet[0] = true;
                }
                else if (line.StartsWith("<STRING>File:"))
                {
                    line = line.Replace("<STRING>File:", "").Trim();

                    triggerable.File = line;
                    hasSet[1] = true;
                }
				else if(line.StartsWith("//") || line.StartsWith("#"))
				{
					continue;
				}
                else
                {
                    throw new TxtConverterException(String.Format("Unknown unit property. (Line: {0})", lineNumber));
                }
            }

            Validate(hasSet, startLine);

            return triggerable;
        }
예제 #3
0
 private void WriteTriggerable(Triggerable triggerable)
 {
     WriteString(triggerable.File);
     WriteString(triggerable.Name);
 }
예제 #4
0
        private Triggerable ReadTriggerable()
        {
            Triggerable triggerable = new Triggerable();

            triggerable.File = ReadString();
            triggerable.Name = ReadString();

            return triggerable;
        }