public void SaveFeeling(string path, FeelingInterface feeling) { // try to append new feeling to existing xml on device // if there is none create one try { TSC = TunneStructContainer.Load(path); TunneStruct[] temp = TSC.TunneStructArray; TSC.TunneStructArray = new TunneStruct[temp.Length + 1]; for (int i = 0; i < temp.Length; i++) { TSC.TunneStructArray[i] = temp[i]; } TSC.TunneStructArray[temp.Length] = (TunneStruct)feeling; TSC.Save(path); } catch (Exception e) { TunneStructContainer TSC = new TunneStructContainer(); List <FeelingInterface> feelingList = new List <FeelingInterface>(); feelingList.Add(feeling); TSC.Save(path, feelingList); // Debug.Log(e.ToString()); } }
public void UpdateCurrentFeeling(FeelingInterface FI) { currentFeeling = FI; if (feelingText1.text == "") { currentFeelings[0] = FI; feelingText1.text = currentFeelings[0].feeling; } else if (feelingText2.text == "") { currentFeelings[1] = FI; feelingText2.text = currentFeelings[1].feeling; } else if (feelingText3.text == "") { currentFeelings[2] = FI; feelingText3.text = currentFeelings[2].feeling; } }
public void addToListOfFeelings(FeelingInterface feel) { listOfFeelings.Add(feel); howManyFeelings++; }