< Summary

Class:DCL.ECSComponents.PBUiBackground
Assembly:Decentraland.Protocol.GeneratedCode
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/DecentralandProtocol/UiBackground.gen.cs
Covered lines:0
Uncovered lines:118
Coverable lines:118
Total lines:443
Line coverage:0% (0 of 118)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
PBUiBackground()0%2100%
get_Descriptor()0%2100%
PBUiBackground(...)0%56700%
Clone()0%2100%
PBUiBackground()0%2100%
Equals(...)0%2100%
Equals(...)0%72800%
GetHashCode()0%42600%
ToString()0%2100%
WriteTo(...)0%42600%
CalculateSize()0%42600%
MergeFrom(...)0%90900%
MergeFrom(...)0%1561200%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/DecentralandProtocol/UiBackground.gen.cs

#LineLine coverage
 1// <auto-generated>
 2//     Generated by the protocol buffer compiler.  DO NOT EDIT!
 3//     source: decentraland/sdk/components/ui_background.proto
 4// </auto-generated>
 5#pragma warning disable 1591, 0612, 3021
 6#region Designer generated code
 7
 8using pb = global::Google.Protobuf;
 9using pbc = global::Google.Protobuf.Collections;
 10using pbr = global::Google.Protobuf.Reflection;
 11using scg = global::System.Collections.Generic;
 12namespace DCL.ECSComponents {
 13
 14  /// <summary>Holder for reflection information generated from decentraland/sdk/components/ui_background.proto</summary
 15  public static partial class UiBackgroundReflection {
 16
 17    #region Descriptor
 18    /// <summary>File descriptor for decentraland/sdk/components/ui_background.proto</summary>
 19    public static pbr::FileDescriptor Descriptor {
 20      get { return descriptor; }
 21    }
 22    private static pbr::FileDescriptor descriptor;
 23
 24    static UiBackgroundReflection() {
 25      byte[] descriptorData = global::System.Convert.FromBase64String(
 26          string.Concat(
 27            "Ci9kZWNlbnRyYWxhbmQvc2RrL2NvbXBvbmVudHMvdWlfYmFja2dyb3VuZC5w",
 28            "cm90bxIbZGVjZW50cmFsYW5kLnNkay5jb21wb25lbnRzGiBkZWNlbnRyYWxh",
 29            "bmQvY29tbW9uL2NvbG9ycy5wcm90bxohZGVjZW50cmFsYW5kL2NvbW1vbi90",
 30            "ZXh0dXJlLnByb3RvGiVkZWNlbnRyYWxhbmQvY29tbW9uL2JvcmRlcl9yZWN0",
 31            "LnByb3RvIrgCCg5QQlVpQmFja2dyb3VuZBIvCgVjb2xvchgBIAEoCzIbLmRl",
 32            "Y2VudHJhbGFuZC5jb21tb24uQ29sb3I0SACIAQESNwoHdGV4dHVyZRgCIAEo",
 33            "CzIhLmRlY2VudHJhbGFuZC5jb21tb24uVGV4dHVyZVVuaW9uSAGIAQESSAoM",
 34            "dGV4dHVyZV9tb2RlGAMgASgOMjIuZGVjZW50cmFsYW5kLnNkay5jb21wb25l",
 35            "bnRzLkJhY2tncm91bmRUZXh0dXJlTW9kZRI8Cg50ZXh0dXJlX3NsaWNlcxgE",
 36            "IAEoCzIfLmRlY2VudHJhbGFuZC5jb21tb24uQm9yZGVyUmVjdEgCiAEBEgsK",
 37            "A3V2cxgFIAMoAkIICgZfY29sb3JCCgoIX3RleHR1cmVCEQoPX3RleHR1cmVf",
 38            "c2xpY2VzKkEKFUJhY2tncm91bmRUZXh0dXJlTW9kZRIPCgtOSU5FX1NMSUNF",
 39            "UxAAEgoKBkNFTlRFUhABEgsKB1NUUkVUQ0gQAkIUqgIRRENMLkVDU0NvbXBv",
 40            "bmVudHNiBnByb3RvMw=="));
 41      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
 42          new pbr::FileDescriptor[] { global::Decentraland.Common.ColorsReflection.Descriptor, global::Decentraland.Comm
 43          new pbr::GeneratedClrTypeInfo(new[] {typeof(global::DCL.ECSComponents.BackgroundTextureMode), }, null, new pbr
 44            new pbr::GeneratedClrTypeInfo(typeof(global::DCL.ECSComponents.PBUiBackground), global::DCL.ECSComponents.PB
 45          }));
 46    }
 47    #endregion
 48
 49  }
 50  #region Enums
 51  public enum BackgroundTextureMode {
 52    /// <summary>
 53    /// https://docs.unity3d.com/Manual/UIE-USS-SupportedProperties.html (Slicing section)
 54    /// https://forum.unity.com/threads/how-does-slicing-in-ui-tookkit-works.1235863/
 55    /// https://docs.unity3d.com/Manual/9SliceSprites.html
 56    /// https://developer.mozilla.org/en-US/docs/Web/CSS/border-image-slice
 57    /// </summary>
 58    [pbr::OriginalName("NINE_SLICES")] NineSlices = 0,
 59    /// <summary>
 60    /// CENTER enables the texture to be rendered centered in relation to the
 61    /// element. If the element is smaller than the texture then the background
 62    /// should use the element as stencil to cut off the out-of-bounds area
 63    /// </summary>
 64    [pbr::OriginalName("CENTER")] Center = 1,
 65    /// <summary>
 66    /// STRETCH enables the texture to cover all the area of the container,
 67    /// adopting its aspect ratio.
 68    /// </summary>
 69    [pbr::OriginalName("STRETCH")] Stretch = 2,
 70  }
 71
 72  #endregion
 73
 74  #region Messages
 75  public sealed partial class PBUiBackground : pb::IMessage<PBUiBackground>
 76  #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
 77      , pb::IBufferMessage
 78  #endif
 79  {
 080    private static readonly pb::MessageParser<PBUiBackground> _parser = new pb::MessageParser<PBUiBackground>(() => new 
 81    private pb::UnknownFieldSet _unknownFields;
 82    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
 83    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
 084    public static pb::MessageParser<PBUiBackground> Parser { get { return _parser; } }
 85
 86    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
 87    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
 88    public static pbr::MessageDescriptor Descriptor {
 089      get { return global::DCL.ECSComponents.UiBackgroundReflection.Descriptor.MessageTypes[0]; }
 90    }
 91
 92    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
 93    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
 94    pbr::MessageDescriptor pb::IMessage.Descriptor {
 095      get { return Descriptor; }
 96    }
 97
 98    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
 99    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
 0100    public PBUiBackground() {
 101      OnConstruction();
 0102    }
 103
 104    partial void OnConstruction();
 105
 106    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
 107    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
 0108    public PBUiBackground(PBUiBackground other) : this() {
 0109      color_ = other.color_ != null ? other.color_.Clone() : null;
 0110      texture_ = other.texture_ != null ? other.texture_.Clone() : null;
 0111      textureMode_ = other.textureMode_;
 0112      textureSlices_ = other.textureSlices_ != null ? other.textureSlices_.Clone() : null;
 0113      uvs_ = other.uvs_.Clone();
 0114      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
 0115    }
 116
 117    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
 118    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
 119    public PBUiBackground Clone() {
 0120      return new PBUiBackground(this);
 121    }
 122
 123    /// <summary>Field number for the "color" field.</summary>
 124    public const int ColorFieldNumber = 1;
 125    private global::Decentraland.Common.Color4 color_;
 126    /// <summary>
 127    /// default=(1.0, 1.0, 1.0, 1.0), pixel = color * sample2D(texture, uv)
 128    /// </summary>
 129    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
 130    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
 131    public global::Decentraland.Common.Color4 Color {
 0132      get { return color_; }
 133      set {
 0134        color_ = value;
 0135      }
 136    }
 137
 138    /// <summary>Field number for the "texture" field.</summary>
 139    public const int TextureFieldNumber = 2;
 140    private global::Decentraland.Common.TextureUnion texture_;
 141    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
 142    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
 143    public global::Decentraland.Common.TextureUnion Texture {
 0144      get { return texture_; }
 145      set {
 0146        texture_ = value;
 0147      }
 148    }
 149
 150    /// <summary>Field number for the "texture_mode" field.</summary>
 151    public const int TextureModeFieldNumber = 3;
 152    private global::DCL.ECSComponents.BackgroundTextureMode textureMode_ = global::DCL.ECSComponents.BackgroundTextureMo
 153    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
 154    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
 155    public global::DCL.ECSComponents.BackgroundTextureMode TextureMode {
 0156      get { return textureMode_; }
 157      set {
 0158        textureMode_ = value;
 0159      }
 160    }
 161
 162    /// <summary>Field number for the "texture_slices" field.</summary>
 163    public const int TextureSlicesFieldNumber = 4;
 164    private global::Decentraland.Common.BorderRect textureSlices_;
 165    /// <summary>
 166    /// default=(1/3, 1/3, 1/3, 1/3)
 167    /// </summary>
 168    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
 169    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
 170    public global::Decentraland.Common.BorderRect TextureSlices {
 0171      get { return textureSlices_; }
 172      set {
 0173        textureSlices_ = value;
 0174      }
 175    }
 176
 177    /// <summary>Field number for the "uvs" field.</summary>
 178    public const int UvsFieldNumber = 5;
 0179    private static readonly pb::FieldCodec<float> _repeated_uvs_codec
 180        = pb::FieldCodec.ForFloat(42);
 0181    private readonly pbc::RepeatedField<float> uvs_ = new pbc::RepeatedField<float>();
 182    /// <summary>
 183    /// default=[0,0,0,1,1,0,1,0]: starting from bottom-left vertex clock-wise
 184    /// </summary>
 185    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
 186    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
 187    public pbc::RepeatedField<float> Uvs {
 0188      get { return uvs_; }
 189    }
 190
 191    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
 192    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
 193    public override bool Equals(object other) {
 0194      return Equals(other as PBUiBackground);
 195    }
 196
 197    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
 198    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
 199    public bool Equals(PBUiBackground other) {
 0200      if (ReferenceEquals(other, null)) {
 0201        return false;
 202      }
 0203      if (ReferenceEquals(other, this)) {
 0204        return true;
 205      }
 0206      if (!object.Equals(Color, other.Color)) return false;
 0207      if (!object.Equals(Texture, other.Texture)) return false;
 0208      if (TextureMode != other.TextureMode) return false;
 0209      if (!object.Equals(TextureSlices, other.TextureSlices)) return false;
 0210      if(!uvs_.Equals(other.uvs_)) return false;
 0211      return Equals(_unknownFields, other._unknownFields);
 212    }
 213
 214    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
 215    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
 216    public override int GetHashCode() {
 0217      int hash = 1;
 0218      if (color_ != null) hash ^= Color.GetHashCode();
 0219      if (texture_ != null) hash ^= Texture.GetHashCode();
 0220      if (TextureMode != global::DCL.ECSComponents.BackgroundTextureMode.NineSlices) hash ^= TextureMode.GetHashCode();
 0221      if (textureSlices_ != null) hash ^= TextureSlices.GetHashCode();
 0222      hash ^= uvs_.GetHashCode();
 0223      if (_unknownFields != null) {
 0224        hash ^= _unknownFields.GetHashCode();
 225      }
 0226      return hash;
 227    }
 228
 229    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
 230    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
 231    public override string ToString() {
 0232      return pb::JsonFormatter.ToDiagnosticString(this);
 233    }
 234
 235    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
 236    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
 237    public void WriteTo(pb::CodedOutputStream output) {
 238    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
 239      output.WriteRawMessage(this);
 240    #else
 0241      if (color_ != null) {
 0242        output.WriteRawTag(10);
 0243        output.WriteMessage(Color);
 244      }
 0245      if (texture_ != null) {
 0246        output.WriteRawTag(18);
 0247        output.WriteMessage(Texture);
 248      }
 0249      if (TextureMode != global::DCL.ECSComponents.BackgroundTextureMode.NineSlices) {
 0250        output.WriteRawTag(24);
 0251        output.WriteEnum((int) TextureMode);
 252      }
 0253      if (textureSlices_ != null) {
 0254        output.WriteRawTag(34);
 0255        output.WriteMessage(TextureSlices);
 256      }
 0257      uvs_.WriteTo(output, _repeated_uvs_codec);
 0258      if (_unknownFields != null) {
 0259        _unknownFields.WriteTo(output);
 260      }
 261    #endif
 0262    }
 263
 264    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
 265    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
 266    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
 267    void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
 268      if (color_ != null) {
 269        output.WriteRawTag(10);
 270        output.WriteMessage(Color);
 271      }
 272      if (texture_ != null) {
 273        output.WriteRawTag(18);
 274        output.WriteMessage(Texture);
 275      }
 276      if (TextureMode != global::DCL.ECSComponents.BackgroundTextureMode.NineSlices) {
 277        output.WriteRawTag(24);
 278        output.WriteEnum((int) TextureMode);
 279      }
 280      if (textureSlices_ != null) {
 281        output.WriteRawTag(34);
 282        output.WriteMessage(TextureSlices);
 283      }
 284      uvs_.WriteTo(ref output, _repeated_uvs_codec);
 285      if (_unknownFields != null) {
 286        _unknownFields.WriteTo(ref output);
 287      }
 288    }
 289    #endif
 290
 291    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
 292    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
 293    public int CalculateSize() {
 0294      int size = 0;
 0295      if (color_ != null) {
 0296        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Color);
 297      }
 0298      if (texture_ != null) {
 0299        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Texture);
 300      }
 0301      if (TextureMode != global::DCL.ECSComponents.BackgroundTextureMode.NineSlices) {
 0302        size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) TextureMode);
 303      }
 0304      if (textureSlices_ != null) {
 0305        size += 1 + pb::CodedOutputStream.ComputeMessageSize(TextureSlices);
 306      }
 0307      size += uvs_.CalculateSize(_repeated_uvs_codec);
 0308      if (_unknownFields != null) {
 0309        size += _unknownFields.CalculateSize();
 310      }
 0311      return size;
 312    }
 313
 314    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
 315    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
 316    public void MergeFrom(PBUiBackground other) {
 0317      if (other == null) {
 0318        return;
 319      }
 0320      if (other.color_ != null) {
 0321        if (color_ == null) {
 0322          Color = new global::Decentraland.Common.Color4();
 323        }
 0324        Color.MergeFrom(other.Color);
 325      }
 0326      if (other.texture_ != null) {
 0327        if (texture_ == null) {
 0328          Texture = new global::Decentraland.Common.TextureUnion();
 329        }
 0330        Texture.MergeFrom(other.Texture);
 331      }
 0332      if (other.TextureMode != global::DCL.ECSComponents.BackgroundTextureMode.NineSlices) {
 0333        TextureMode = other.TextureMode;
 334      }
 0335      if (other.textureSlices_ != null) {
 0336        if (textureSlices_ == null) {
 0337          TextureSlices = new global::Decentraland.Common.BorderRect();
 338        }
 0339        TextureSlices.MergeFrom(other.TextureSlices);
 340      }
 0341      uvs_.Add(other.uvs_);
 0342      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
 0343    }
 344
 345    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
 346    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
 347    public void MergeFrom(pb::CodedInputStream input) {
 348    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
 349      input.ReadRawMessage(this);
 350    #else
 351      uint tag;
 0352      while ((tag = input.ReadTag()) != 0) {
 353        switch(tag) {
 354          default:
 0355            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
 0356            break;
 357          case 10: {
 0358            if (color_ == null) {
 0359              Color = new global::Decentraland.Common.Color4();
 360            }
 0361            input.ReadMessage(Color);
 0362            break;
 363          }
 364          case 18: {
 0365            if (texture_ == null) {
 0366              Texture = new global::Decentraland.Common.TextureUnion();
 367            }
 0368            input.ReadMessage(Texture);
 0369            break;
 370          }
 371          case 24: {
 0372            TextureMode = (global::DCL.ECSComponents.BackgroundTextureMode) input.ReadEnum();
 0373            break;
 374          }
 375          case 34: {
 0376            if (textureSlices_ == null) {
 0377              TextureSlices = new global::Decentraland.Common.BorderRect();
 378            }
 0379            input.ReadMessage(TextureSlices);
 0380            break;
 381          }
 382          case 42:
 383          case 45: {
 0384            uvs_.AddEntriesFrom(input, _repeated_uvs_codec);
 385            break;
 386          }
 387        }
 388      }
 389    #endif
 0390    }
 391
 392    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
 393    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
 394    [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
 395    void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
 396      uint tag;
 397      while ((tag = input.ReadTag()) != 0) {
 398        switch(tag) {
 399          default:
 400            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
 401            break;
 402          case 10: {
 403            if (color_ == null) {
 404              Color = new global::Decentraland.Common.Color4();
 405            }
 406            input.ReadMessage(Color);
 407            break;
 408          }
 409          case 18: {
 410            if (texture_ == null) {
 411              Texture = new global::Decentraland.Common.TextureUnion();
 412            }
 413            input.ReadMessage(Texture);
 414            break;
 415          }
 416          case 24: {
 417            TextureMode = (global::DCL.ECSComponents.BackgroundTextureMode) input.ReadEnum();
 418            break;
 419          }
 420          case 34: {
 421            if (textureSlices_ == null) {
 422              TextureSlices = new global::Decentraland.Common.BorderRect();
 423            }
 424            input.ReadMessage(TextureSlices);
 425            break;
 426          }
 427          case 42:
 428          case 45: {
 429            uvs_.AddEntriesFrom(ref input, _repeated_uvs_codec);
 430            break;
 431          }
 432        }
 433      }
 434    }
 435    #endif
 436
 437  }
 438
 439  #endregion
 440
 441}
 442
 443#endregion Designer generated code