using System.Collections; using System.Collections.Generic; using System.Text.RegularExpressions; using System.Text; using System; using System.Linq; using System.IO; using System.Diagnostics; using Godot; using Rokojori.Extensions; namespace Rokojori.Extensions; public static class DictionaryExtensions { public static V GetOr( this Dictionary map, K key, V orValue ) { if ( map.ContainsKey( key ) ) { return map[ key ]; } return orValue; } public static void ForEach( this Dictionary map, Action callback ) { foreach ( var item in map ) { callback( item.Key, item.Value ); } } public static void ForEachKey( this Dictionary map, Action callback ) { foreach ( var item in map ) { callback( item.Key ); } } }