{"record":{"id":"1d77088d99d34688","repo":"stride3d/stride","slug":"indices-for-thickness-run-from-0-to-5-inclusive","errorCode":null,"errorMessage":"Indices for Thickness run from 0 to 5, inclusive.","messagePattern":"Indices for Thickness run from 0 to 5, inclusive\\.","errorType":"exception","errorClass":"ArgumentOutOfRangeException","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.UI/Thickness.cs","lineNumber":146,"sourceCode":"        /// 2 for the Front component, 3 for the Right component, 4 for the Bottom component, 5 for the Back component.</param>\n        /// <returns>The value of the component at the specified index.</returns>\n        /// <exception cref=\"System.ArgumentOutOfRangeException\">Thrown when the <paramref name=\"index\"/> is out of the range [0, 5].</exception>\n        [DataMemberIgnore]\n        public float this[int index]\n        {\n            get\n            {\n                switch (index)\n                {\n                    case 0: return Left;\n                    case 1: return Top;\n                    case 2: return Front;\n                    case 3: return Right;\n                    case 4: return Bottom;\n                    case 5: return Back;\n                }\n\n                throw new ArgumentOutOfRangeException(nameof(index), $\"Indices for {nameof(Thickness)} run from {0} to {5}, inclusive.\");\n            }\n        }\n\n        public bool Equals(Thickness other)\n        {\n            return Back.Equals(other.Back) && Bottom.Equals(other.Bottom)\n                && Front.Equals(other.Front) && Left.Equals(other.Left)\n                && Right.Equals(other.Right) && Top.Equals(other.Top);\n        }\n\n        public override bool Equals(object obj)\n        {\n            if (ReferenceEquals(null, obj)) return false;\n            return obj is Thickness && Equals((Thickness)obj);\n        }\n\n        public override int GetHashCode()\n        {","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.UI/Thickness.cs#L128-L164","documentation":"Thrown by the Thickness indexer (this[int]) when index is outside [0, 5]. The indexer maps indices to the six components of the 3D thickness: 0=Left, 1=Top, 2=Front, 3=Right, 4=Bottom, 5=Back (as documented). Any other index cannot be resolved to a component, so an ArgumentOutOfRangeException with this message is thrown, matching the declared <exception> doc.","triggerScenarios":"Thrown at sources/engine/Stride.UI/Thickness.cs:146 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Validate or clamp the index to the [0, 5] range before using the Thickness indexer (0=Left, 1=Top, 2=Front, 3=Right, 4=Bottom, 5=Back).","Replace dynamic indexer access with the named properties (Left, Top, Right, Bottom, Front, Back) whenever the component is known at compile time.","Use a bounded for-loop (for i in 0..5) instead of an unbounded or data-driven index when iterating components."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}