/// <inheritdoc/>
        public override string?ToString()
        {
            return(DataType switch
            {
                StormGameEventDataType.Bool => Boolean?.ToString(),
                StormGameEventDataType.Integer32 => Integer32?.ToString(),
                StormGameEventDataType.UnsignedInteger32 => UnsignedInteger32?.ToString(),
                StormGameEventDataType.UnsignedInteger64 => UnsignedInteger64?.ToString(),
                StormGameEventDataType.Blob => Blob != null ? @$ "" "{Blob}" "" : null,
                StormGameEventDataType.Array => Array != null ? $"[{string.Join(", ", Array.Select(i => i?.ToString()))}]" : null,
                StormGameEventDataType.Structure => Structure != null ? $"{{{string.Join(", ", Structure.Select(i => i?.ToString()))}}}" : null,
                StormGameEventDataType.BitArray => BitArray != null ? $"[{string.Join(", ", BitArray.Select(i => i.ToString()))}]" : null,

                _ => string.Empty,
            });
示例#2
0
        public static void TestUnsignedInteger32GetMutatorMinNullOptional()
        {
            const Dhgms.Nucleotide.Model.Info.CollectionType CollectionType = Dhgms.Nucleotide.Model.Info.CollectionType.GenericLinkedList;
            const string Name = "Name";
            const string Description = "Description";
            const bool Optional = false;

            UnsignedInteger32 instance = new UnsignedInteger32(
                CollectionType,
                Name,
                Description,
                Optional,
                null,
                255,
                true,
                null);

            Console.Write(instance.GetMutator());
        }
示例#3
0
        public static void TestUnsignedInteger32ConstructorBasicArguments()
        {
            const Dhgms.Nucleotide.Model.Info.CollectionType CollectionType = Dhgms.Nucleotide.Model.Info.CollectionType.GenericLinkedList;
            const string Name = "Name";
            const string Description = "Description";
            const bool Optional = false;

            UnsignedInteger32 instance = new UnsignedInteger32(
                CollectionType,
                Name,
                Description,
                Optional,
                null,
                null,
                true,
                null);

            Assert.Equal(CollectionType, instance.Collection);
            Assert.Equal(Name, instance.Name);
            Assert.Equal(Description, instance.Description);
            Assert.Equal(Optional, instance.Optional);
        }
示例#4
0
 public void Visit(UnsignedInteger32 value)
 {
     value.TypedValue = mBitsReader.ReadUInt32(value.BitsCount);
 }