/// <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 void ConvertToString()
        {
            var i1 = new Integer32(10);

            Assert.Equal("10", i1.ToString());
        }