Skip to content

Commit 78bf4e9

Browse files
Evan ComtesseEvan Comtesse
authored andcommitted
feat: added contains functions to GuiContainers
1 parent 7ae892f commit 78bf4e9

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

src/RayGUI.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace RayGUI_cs
99
/// <summary>RayGUI instance of the library.</summary>
1010
public unsafe class RayGUI
1111
{
12-
public const string VERSION = "2.0.4";
12+
public const string VERSION = "2.0.4.1";
1313

1414
internal const int MAX_TAG_LENGTH = 25;
1515
internal const int TICKBOX_SIZE = 16;

src/RayGUI_cs.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
8-
<Version>2.0.4</Version>
8+
<Version>2.0.4.1</Version>
99
<PackageId>RayGUI-cs</PackageId>
1010
<Author>FlamingRiot</Author>
1111
<Company>FlamingRiot</Company>

src/code/components/GuiContainer.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,22 @@ public void ForEach(Action<Component> action)
4747
_components.Values.ToList().ForEach(action);
4848
}
4949

50+
/// <summary>Checks whether a component exists or not in the container.</summary>
51+
/// <param name="key">Component to look for.</param>
52+
/// <returns><see langword="true"/> if exists. <see langword="false"/> otherwise.</returns>
53+
public bool ContainsComponent(Component component)
54+
{
55+
return _components.ContainsValue(component);
56+
}
57+
58+
/// <summary>Checks whether a component's key exists or not in the container.</summary>
59+
/// <param name="key">Key to look for.</param>
60+
/// <returns><see langword="true"/> if exists. <see langword="false"/> otherwise.</returns>
61+
public bool ContainsKey(string key)
62+
{
63+
return _components.ContainsKey(key);
64+
}
65+
5066
/// <summary>Sets the roundness for each component of the GUI.</summary>
5167
/// <param name="roundness">Roundness to set.</param>
5268
public void SetDefaultRoundness(float roundness)

0 commit comments

Comments
 (0)