private uint findLowestFreeId() { for (uint i = 1; i < uint.MaxValue; i++) { if (!NPCPool.ContainsKey(i)) { return(i); } } throw new Exception("No free ids"); }