public void quickUpdate() { pointSortedTeamList.Clear(); foreach (Team t in HomeScreenScript.scheduleList1) { pointSortedTeamList.Add(t); } foreach (Team t in HomeScreenScript.scheduleList2) { pointSortedTeamList.Add(t); } LeagueTablePointsComparer pointsComparer = new LeagueTablePointsComparer(); pointSortedTeamList.Sort(pointsComparer); for (int i = 0; i < pointSortedTeamList.Count; i++) { Team teamEntry = pointSortedTeamList[i] as Team; GameObject teamPlate = Instantiate(teamPlatePrefab) as GameObject; teamPlate.GetComponent <TeamPlateScript>().Initialize(teamEntry, i + 1); teamPlate.transform.SetParent(gameObject.transform, false); if (teamEntry.name == HomeScreenScript.playerTeamName) { playerPosition = ReferenceMaterial.AddOrdinal(i + 1); teamPlate.GetComponentInChildren <Image>().color = UnityEngine.Color.green; } } if (HomeScreenScript.matchesPlayed == 60) { gameObject.transform.GetChild(0).GetComponent <Image>().color = Color.yellow; } }
public void AssignRandomPersonality() { foreach (object key in ReferenceMaterial.RandomPersonalities(ReferenceMaterial.personalitiesDictionary).Take(Random.Range(1, 3))) { if (!personalities.Contains(key)) { personalities.Add(key); } } }
public void AssignRandomTraits() { foreach (object key in ReferenceMaterial.RandomTraits(ReferenceMaterial.traitsDictionary).Take(Random.Range(0, 3))) { if (!traits.Contains(key)) { traits.Add(key); } } }
public string GenerateMessageFromPersonality(string personality) { return(ReferenceMaterial.PickMessageForPersonality(personality)); }
public void Initialize(Team t, int index) { gameObject.GetComponentsInChildren <Text>()[0].text = "<b>" + ReferenceMaterial.AddOrdinal(index) + "</b> " + t.name; gameObject.GetComponentsInChildren <Text>()[1].text = t.points.ToString(); }
/// <summary> /// Checks the ADX samples. /// </summary> /// <param name="document">The ADX document.</param> private void CheckSamples(ADX document) { // Is there a samples section defined ? if (document.Samples == null) { this.Add(new ValidationResult(ErrorCodes.Samples, ErrorLevel.Error, Languages.Strings.valNoSamples)); return; } // Are there samples in the samples section ? if (document.Samples.Sample == null) { this.Add(new ValidationResult(ErrorCodes.Samples, ErrorLevel.Error, Languages.Strings.valNoSamplesListed)); return; } // // Check if each sample is defined correctly // foreach (Sample sample in document.Samples.Sample) { // Is the ID defined ? if (String.IsNullOrEmpty(sample.Id)) { this.Add(new ValidationResult(ErrorCodes.Samples, ErrorLevel.Error, Languages.Strings.valSampleExistsWithNoId)); } else { // Is the Type defined ? if (String.IsNullOrEmpty(sample.Type) && !(sample is ReferenceMaterial)) { this.Add(new ValidationResult(ErrorCodes.Samples, ErrorLevel.Warning, String.Format(Languages.Strings.valSampleExistsWithNoType, sample.Id))); } // Is the Status defined ? if (sample.Status == SampleStatus.Unspecified) { this.Add(new ValidationResult(ErrorCodes.Samples, ErrorLevel.Error, String.Format(Languages.Strings.valSampleHasAnUnspecifiedStatus, sample.Id))); } // Is this a standard or blank ? if (sample is ReferenceMaterial) { ReferenceMaterial rm = sample as ReferenceMaterial; if (rm.Category == ReferenceMaterialCategory.Unspecified) { this.Add(new ValidationResult(ErrorCodes.Samples, ErrorLevel.Error, String.Format(Languages.Strings.valRefMatHasAnUnspecifiedCategory, sample.Id))); } } // Check if a QA/QC sample has been hidden as a normal sample... else { String compressedSampleId = sample.Id.ToUpper().Replace(" ", ""); if ( compressedSampleId.EndsWith("D") || compressedSampleId.Contains("-DUPLICATE") || compressedSampleId.Contains("-DUP") || compressedSampleId.Contains("-D") || compressedSampleId.Contains("DUP") || compressedSampleId.EndsWith("R") || compressedSampleId.Contains("-REP") || compressedSampleId.Contains("-REPEAT") || compressedSampleId.Contains("-R") || compressedSampleId.Contains("DUP") || compressedSampleId.EndsWith("CRD") || compressedSampleId.Contains("/") || compressedSampleId.Contains("BLK") || compressedSampleId.Contains("BLANK") || compressedSampleId.Contains("STD") ) { this.Add(new ValidationResult(ErrorCodes.Samples, ErrorLevel.Warning, String.Format(Languages.Strings.valSamplePotentialQAQCListedAsSample, sample.Id))); } } } } }