Initial commit

This commit is contained in:
tbS
2025-08-01 23:28:27 +02:00
commit 7120c81089
44 changed files with 4084 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
using System.Collections.Generic;
namespace Valheim_Dashboard;
public class AtomTable
{
private static readonly Dictionary<string, ushort> AtomDictionary = new();
private static ushort CurrentAtomValue = 1; // Startwert für Atoms
public static ushort AddAtom(string atomString)
{
lock (AtomDictionary)
{
if (AtomDictionary.ContainsKey(atomString))
{
return AtomDictionary[atomString];
}
ushort newAtom = CurrentAtomValue++;
AtomDictionary[atomString] = newAtom;
return newAtom;
}
}
public static ushort FindAtom(string atomString)
{
lock (AtomDictionary)
{
if (AtomDictionary.TryGetValue(atomString, out ushort atom))
{
return atom;
}
// Rückgabe 0 wie bei `GlobalFindAtom` in Windows, wenn nicht gefunden
return 0;
}
}
}