// Dust public static bool[] GetTabDust(float totalDust) { ScriptDustItemsContainer temp = new ScriptDustItemsContainer (); temp = ScriptDustItemsContainer.LoadDust (DustReadFileName); bool[] tabDust = new bool[(int)totalDust]; if (temp != null) { int i = 0; foreach (ScriptDustItems item in temp.Items) { tabDust [i] = item.Dustcollected; i++; } return tabDust; } else { for (int i = 0; i < totalDust; i++) { tabDust[i] = false; } return tabDust; } }
public void SetTabDust(bool[] tempTab, int tailleTab) { ScriptDustItemsContainer save = new ScriptDustItemsContainer (); ScriptDustItems saveItem ;//= new ScriptDustItems (); for (int i=0; i< tailleTab; i++) { saveItem = new ScriptDustItems (); saveItem.Dustcollected = tempTab[i]; save.Items.Add(saveItem); } save.WriteDust(DustWriteFileName); }