コード例 #1
0
    public override void AppendTo(ref SpanWriter writer, OrderedHashSet <string> strings, ref int entries, ref int switches)
    {
        var textIndex = strings.GetOrAdd(InitialText ?? "");

        writer.WriteAscii($"{{ textentry {X} {Y} {Width} {Height} {Hue} {EntryID} {textIndex} }}");
        entries++;
    }
コード例 #2
0
ファイル: GumpHtml.cs プロジェクト: AsYlum-/ModernUO
    public override void AppendTo(ref SpanWriter writer, OrderedHashSet <string> strings, ref int entries, ref int switches)
    {
        var textIndex  = strings.GetOrAdd(Text ?? "");
        var background = Background ? "1" : "0";
        var scrollbar  = Scrollbar ? "1" : "0";

        writer.WriteAscii($"{{ htmlgump {X} {Y} {Width} {Height} {textIndex} {background} {scrollbar} }}");
    }
コード例 #3
0
        public int UsingOrderedHashSet()
        {
            var ordered = new OrderedHashSet <string>();

            for (int i = 0; i < _iterations.Length / 2; i++)
            {
                ordered.GetOrAdd(_iterations[i]).ToString();
            }

            for (int i = 0; i < _iterations.Length; i++)
            {
                ordered.GetOrAdd(_iterations[i]).ToString();
            }

            foreach (var str in ordered)
            {
                str.ToString();
            }

            return(ordered.Count);
        }
コード例 #4
0
 public override void AppendTo(ref SpanWriter writer, OrderedHashSet <string> strings, ref int entries, ref int switches)
 {
     writer.Write((ushort)0x7B20); // "{ "
     writer.Write(LayoutName);
     writer.WriteAscii(' ');
     writer.WriteAscii(X.ToString());
     writer.WriteAscii(' ');
     writer.WriteAscii(Y.ToString());
     writer.WriteAscii(' ');
     writer.WriteAscii(Hue.ToString());
     writer.WriteAscii(' ');
     writer.WriteAscii(strings.GetOrAdd(Text).ToString());
     writer.Write((ushort)0x207D); // " }"
 }
コード例 #5
0
        public int UsingOrderedHashSet()
        {
            for (int i = 0; i < iterations / 2; i++)
            {
                _ordered.GetOrAdd(i.ToString());
            }

            for (int i = 0; i < iterations; i++)
            {
                _ordered.GetOrAdd(i.ToString());
            }

            for (int i = 0; i < iterations * 2; i++)
            {
                _ordered.GetOrAdd(i.ToString());
            }

            foreach (var str in _ordered)
            {
                str.ToString();
            }

            return(_ordered.Count);
        }
コード例 #6
0
ファイル: GumpHtml.cs プロジェクト: lduguid/ModernUO
 public override void AppendTo(ref SpanWriter writer, OrderedHashSet <string> strings, ref int entries, ref int switches)
 {
     writer.Write((ushort)0x7B20);                   // "{ "
     writer.Write(LayoutName);
     writer.Write((byte)0x20);                       // ' '
     writer.WriteAscii(X.ToString());
     writer.Write((byte)0x20);                       // ' '
     writer.WriteAscii(Y.ToString());
     writer.Write((byte)0x20);                       // ' '
     writer.WriteAscii(Width.ToString());
     writer.Write((byte)0x20);                       // ' '
     writer.WriteAscii(Height.ToString());
     writer.Write((byte)0x20);                       // ' '
     writer.WriteAscii(strings.GetOrAdd(Text).ToString());
     writer.Write((byte)0x20);                       // ' '
     writer.Write((byte)(Background ? 0x31 : 0x30)); // 1 or 0
     writer.Write((byte)0x20);                       // ' '
     writer.Write((byte)(Scrollbar ? 0x31 : 0x30));  // 1 or 0
     writer.Write((ushort)0x207D);                   // " }"
 }
コード例 #7
0
ファイル: GumpTextEntry.cs プロジェクト: lduguid/ModernUO
        public override void AppendTo(ref SpanWriter writer, OrderedHashSet <string> strings, ref int entries, ref int switches)
        {
            writer.Write((ushort)0x7B20); // "{ "
            writer.Write(LayoutName);
            writer.Write((byte)0x20);     // ' '
            writer.WriteAscii(X.ToString());
            writer.Write((byte)0x20);     // ' '
            writer.WriteAscii(Y.ToString());
            writer.Write((byte)0x20);     // ' '
            writer.WriteAscii(Width.ToString());
            writer.Write((byte)0x20);     // ' '
            writer.WriteAscii(Height.ToString());
            writer.Write((byte)0x20);     // ' '
            writer.WriteAscii(Hue.ToString());
            writer.Write((byte)0x20);     // ' '
            writer.WriteAscii(EntryID.ToString());
            writer.Write((byte)0x20);     // ' '
            writer.WriteAscii(strings.GetOrAdd(InitialText).ToString());
            writer.Write((ushort)0x207D); // " }"

            entries++;
        }
コード例 #8
0
ファイル: GumpTextEntry.cs プロジェクト: lduguid/ModernUO
 public override string Compile(OrderedHashSet <string> strings) =>
 $"{{ textentry {X} {Y} {Width} {Height} {Hue} {EntryID} {strings.GetOrAdd(InitialText)} }}";
コード例 #9
0
ファイル: GumpHtml.cs プロジェクト: lduguid/ModernUO
 public override string Compile(OrderedHashSet <string> strings) =>
 $"{{ htmlgump {X} {Y} {Width} {Height} {strings.GetOrAdd(Text)} {(Background ? 1 : 0)} {(Scrollbar ? 1 : 0)} }}";
コード例 #10
0
 public override string Compile(OrderedHashSet <string> strings) => $"{{ text {X} {Y} {Hue} {strings.GetOrAdd(Text)} }}";
コード例 #11
0
    public override void AppendTo(ref SpanWriter writer, OrderedHashSet <string> strings, ref int entries, ref int switches)
    {
        var textIndex = strings.GetOrAdd(Text ?? "");

        writer.WriteAscii($"{{ text {X} {Y} {Hue} {textIndex} }}");
    }
コード例 #12
0
 public override string Compile(OrderedHashSet <string> strings) =>
 $"{{ croppedtext {X} {Y} {Width} {Height} {Hue} {strings.GetOrAdd(Text ?? "")} }}";