All seemed to be going fine, and I tried using an example from the C# docs for a foreach loop that only used the keys from the dictionary, but started seeing some problems with this and did a bunch of trouble-shooting with Burt both were getting the same errors.
Code: Select all
/*private static void Testing_OnNewDay()
{
Dictionary<int, ShopData>.KeyCollection sbKeys = ShopBuildingData.Keys;
foreach (int s in sbKeys)
{
Debug.LogFormat("Key = {0}", s);
}
}
Code: Select all
Error (584): Internal compiler error: Unexpected error when loading type `System.Collections.Generic.Dictionary<TKey,TValue>.KeyCollection.Enumerator'
Error (): 0(198,29): SaveDataTestingScript1.SaveDataTestingScript1.Testing_OnTransitionInterior(DaggerfallWorkshop.Game.PlayerEnterExit.TransitionEventArgs)
Code: Select all
public static void Testing_OnNewDay()
{
int dicCount = ShopBuildingData.Keys.Count;
Debug.Log("Key count: " + dicCount.ToString());
foreach( KeyValuePair<int, ShopData> kvp in ShopBuildingData )
{
Debug.LogFormat("Key = {0}, Value = {1}", kvp.Key.ToString(), kvp.Value.BuildingQuality.ToString());
}
}
So we are both not 100% sure why the first example was causing problem, but he thought that maybe somebody would know better on the forums, thanks for your time, hopefully this explains the context well enough.