public override void FromString(string aString) { if(sponsorMaterial==null) { sponsorMaterial = (Material) Resources.Load ("Sponsors/SponsorMaterial"); } Debug.Log ("Decoding: "+aString); string s = Base64.Base64Decode(aString); string[] split = s.Split(new char[] {'|'}); base.FromString(split[0]); string currentContracts1 = Base64.Base64Decode(split[1]); string[] currentContractsSplit = currentContracts1.Split(new char[] {'%'}); for(int i =0;i<currentContractsSplit.Length;i++) { string[] thisContractString = currentContractsSplit[i].Split(new char[] {'|'}); //public SponsorPlacedRelationshipRecord(string aPosition,int aSponsorID,float aValue,int aRemaining,int aCurrentRelationshipValue) { if(thisContractString.Length==5) currentContracts.Add(new SponsorPlacedRelationshipRecord(thisContractString[1],Convert.ToInt32(thisContractString[4]),(float) Convert.ToDouble(thisContractString[3]),Convert.ToInt32(thisContractString[2]),Convert.ToInt32(thisContractString[0]))); } string sponsorRelationships1 = Base64.Base64Decode(split[2]); string[] spons = sponsorRelationships1.Split(new char[] {'%'}); for(int i = 0;i<spons.Length;i++) { string[] split1 = spons[i].Split(new char[] {'|'}); if(split1.Length==2) { int sponsorID = Convert.ToInt32(split1[1]); int relationshipValue = Convert.ToInt32(split1[0]); if(this.teamName=="Omega") { Debug.Log ("Break"); } SponsorRelationshipRecord r = new SponsorRelationshipRecord(sponsorID,relationshipValue); r.currentRelationshipValue = relationshipValue; this.sponsorRelationships.Add(r); } } }
public int randSort(SponsorRelationshipRecord name1, SponsorRelationshipRecord name2) { return UnityEngine.Random.Range(-1,1); }
public void addSponsorContract(ESponsorPosition aPosition,SponsorRelationshipRecord aRecord,int aValue,int aRaces) { currentContracts.Add(new SponsorPlacedRelationshipRecord(aPosition,aRecord.record,aValue,aRaces)); }