-
Notifications
You must be signed in to change notification settings - Fork 0
Collections Dictionary
Home | API by Category | Complete API Index | API Compatibility
| Field | Value |
|---|---|
| Full name | Electron2D.Collections.Dictionary |
| Namespace | Electron2D.Collections |
| Kind | class |
| Category | Math and Data |
Stores mutable key/value pairs where both keys and values are Electron2D.Variant.
public sealed class Electron2D.Collections.Dictionary : System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<Electron2D.Variant, Electron2D.Variant>>, System.Collections.IEnumerableProfile: Electron2D 0.1.0 2D
Status: Partial / Not verified
Out of profile: yes
Godot reference: Dictionary
Mutable reference-like Variant key/value map for the 0.1 closed Variant type set.
This type is intentionally limited to Electron2D.Variant keys and
Electron2D.Variant values so the supported value set stays closed.
The container itself is reference-like: assigning the same instance to multiple variants stores the same mutable dictionary object.
This type is not synchronized. External synchronization is required when the same instance is mutated from multiple threads.
This type is available since Electron2D 0.1.0 Preview.
Electron2D.Collections.ArrayElectron2D.Variant
| Member | Kind | Summary |
|---|---|---|
Count |
Property | Gets the number of key/value pairs stored in the dictionary. |
Item |
Property | Gets or sets the value stored for a key. |
Electron2D.Collections.Dictionary() |
Constructor | Initializes a new instance of the Dictionary type. |
Add(Electron2D.Variant, Electron2D.Variant) |
Method | Adds a key/value pair to the dictionary. |
Clear() |
Method | Removes all key/value pairs from the dictionary. |
ContainsKey(Electron2D.Variant) |
Method | Checks whether the dictionary contains a key. |
GetEnumerator() |
Method | Returns an enumerator over the current key/value pairs. |
Remove(Electron2D.Variant) |
Method | Removes a key and its value. |
ToString() |
Method | Returns a diagnostic string representation of this dictionary. |
TryGetValue(Electron2D.Variant, Electron2D.Variant&) |
Method | Attempts to read a value without throwing when the key is missing. |
Kind: Property
public System.Int32 Count { get; }Gets the number of key/value pairs stored in the dictionary.
This value changes when Electron2D.Collections.Dictionary.Add(Electron2D.Variant,Electron2D.Variant), Electron2D.Collections.Dictionary.Remove(Electron2D.Variant) or
Electron2D.Collections.Dictionary.Clear mutates the container.
The current number of stored key/value pairs.
This property is not synchronized. External synchronization is required when the same instance is accessed from multiple threads.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Collections.Dictionary
Kind: Property
public Electron2D.Variant this[Electron2D.Variant key] { get; set; }Gets or sets the value stored for a key.
The getter reads the live mutable container. The setter adds or replaces
the value associated with key.
-
key: The key to read or write.
The value stored for key.
The value at the specified index.
-
System.Collections.Generic.KeyNotFoundException: Thrown when the getter is used andkeyis not present.
This indexer is not synchronized. External synchronization is required when the same instance is accessed from multiple threads.
This indexer is available since Electron2D 0.1.0 Preview.
Electron2D.Collections.Dictionary.Add(Electron2D.Variant,Electron2D.Variant)Electron2D.Collections.Dictionary.ContainsKey(Electron2D.Variant)
Kind: Constructor
public Electron2D.Collections.Dictionary()Initializes a new instance of the Dictionary type.
The new instance follows the lifetime and validation rules of its declaring type.
This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.
This API is available since Electron2D 0.1.0 Preview.
Electron2D.Collections.Dictionary
Kind: Method
public System.Void Add(Electron2D.Variant, Electron2D.Variant)(Electron2D.Variant key, Electron2D.Variant value)Adds a key/value pair to the dictionary.
Use the indexer to replace an existing value. This method is strict and rejects duplicate keys.
-
key: The key to add. -
value: The value to store forkey.
-
System.ArgumentException: Thrown whenkeyalready exists.
This method is not synchronized. External synchronization is required when the same instance is mutated from multiple threads.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Collections.Dictionary.ContainsKey(Electron2D.Variant)Electron2D.Collections.Dictionary.Remove(Electron2D.Variant)
Kind: Method
public System.Void Clear()()Removes all key/value pairs from the dictionary.
Existing references to this Electron2D.Collections.Dictionary observe the same
mutable instance after it has been cleared.
This method is not synchronized. External synchronization is required when the same instance is mutated from multiple threads.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Collections.Dictionary.Count
Kind: Method
public System.Boolean ContainsKey(Electron2D.Variant)(Electron2D.Variant key)Checks whether the dictionary contains a key.
This method does not throw when key is missing.
-
key: The key to search for.
true if the key is present; otherwise, false.
This method is not synchronized. External synchronization is required when the same instance is accessed from multiple threads.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Collections.Dictionary.TryGetValue(Electron2D.Variant,Electron2D.Variant@)
Kind: Method
public System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<Electron2D.Variant, Electron2D.Variant>> GetEnumerator()()Returns an enumerator over the current key/value pairs.
The enumerator follows the behavior of the underlying CLR dictionary. Mutating this container while enumerating it invalidates the enumerator.
An enumerator over key/value pairs.
This method is not synchronized. External synchronization is required when the same instance may be mutated while it is being enumerated.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Collections.Dictionary.TryGetValue(Electron2D.Variant,Electron2D.Variant@)
Kind: Method
public System.Boolean Remove(Electron2D.Variant)(Electron2D.Variant key)Removes a key and its value.
Removing a missing key is a no-op and returns false.
-
key: The key to remove.
true if the key was found and removed; otherwise, false.
This method is not synchronized. External synchronization is required when the same instance is mutated from multiple threads.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Collections.Dictionary.Add(Electron2D.Variant,Electron2D.Variant)Electron2D.Collections.Dictionary.Clear
Kind: Method
public System.String ToString()()Returns a diagnostic string representation of this dictionary.
The result is intended for diagnostics and logs. It is not a stable serialization format.
A comma-separated list of key/value pairs wrapped in braces.
This method is not synchronized. External synchronization is required when the same instance may be mutated while the string is being built.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Collections.Dictionary
Kind: Method
public System.Boolean TryGetValue(Electron2D.Variant, Electron2D.Variant&)(Electron2D.Variant key, Electron2D.Variant& value)Attempts to read a value without throwing when the key is missing.
This method is the non-throwing read path for optional dictionary keys.
-
key: The key to search for. -
value: Receives the stored value when the key is present; otherwise receivesdefault(Variant).
true if the key is present; otherwise, false.
This method is not synchronized. External synchronization is required when the same instance is accessed from multiple threads.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Collections.Dictionary.ContainsKey(Electron2D.Variant)
Electron2D 0.1.0 Preview API reference. Generated from 175 public runtime types.