コード例 #1
0
    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;
        }
    }
コード例 #2
0
 public void AssignRandomPersonality()
 {
     foreach (object key in ReferenceMaterial.RandomPersonalities(ReferenceMaterial.personalitiesDictionary).Take(Random.Range(1, 3)))
     {
         if (!personalities.Contains(key))
         {
             personalities.Add(key);
         }
     }
 }
コード例 #3
0
 public void AssignRandomTraits()
 {
     foreach (object key in ReferenceMaterial.RandomTraits(ReferenceMaterial.traitsDictionary).Take(Random.Range(0, 3)))
     {
         if (!traits.Contains(key))
         {
             traits.Add(key);
         }
     }
 }
コード例 #4
0
 public string GenerateMessageFromPersonality(string personality)
 {
     return(ReferenceMaterial.PickMessageForPersonality(personality));
 }
コード例 #5
0
 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();
 }
コード例 #6
0
        /// <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)));
                        }
                    }
                }
            }
        }