/// <inheritdoc/> public string ToDelimitedString() { CultureInfo culture = CultureInfo.CurrentCulture; return(string.Format( culture, StringHelper.StringFormatSequence(0, 48, Configuration.FieldSeparator), Id, SequenceNumberTestObservationMasterFile.HasValue ? SequenceNumberTestObservationMasterFile.Value.ToString(Consts.NumericFormat, culture) : null, ProducersServiceTestObservationId?.ToDelimitedString(), PermittedDataTypes != null ? string.Join(Configuration.FieldRepeatSeparator, PermittedDataTypes) : null, SpecimenRequired, ProducerId?.ToDelimitedString(), ObservationDescription?.ToDelimitedString(), OtherServiceTestObservationIdsForTheObservation?.ToDelimitedString(), OtherNames != null ? string.Join(Configuration.FieldRepeatSeparator, OtherNames) : null, PreferredReportNameForTheObservation, PreferredShortNameOrMnemonicForTheObservation, PreferredLongNameForTheObservation, Orderability, IdentityOfInstrumentUsedToPerformThisStudy != null ? string.Join(Configuration.FieldRepeatSeparator, IdentityOfInstrumentUsedToPerformThisStudy.Select(x => x.ToDelimitedString())) : null, CodedRepresentationOfMethod != null ? string.Join(Configuration.FieldRepeatSeparator, CodedRepresentationOfMethod.Select(x => x.ToDelimitedString())) : null, PortableDeviceIndicator, ObservationProducingDepartmentSection != null ? string.Join(Configuration.FieldRepeatSeparator, ObservationProducingDepartmentSection.Select(x => x.ToDelimitedString())) : null, TelephoneNumberOfSection?.ToDelimitedString(), NatureOfServiceTestObservation, ReportSubheader?.ToDelimitedString(), ReportDisplayOrder, DateTimeStampForAnyChangeInDefinitionForTheObservation.HasValue ? DateTimeStampForAnyChangeInDefinitionForTheObservation.Value.ToString(Consts.DateTimeFormatPrecisionSecond) : null, EffectiveDateTimeOfChange.HasValue ? EffectiveDateTimeOfChange.Value.ToString(Consts.DateTimeFormatPrecisionSecond) : null, TypicalTurnAroundTime.HasValue ? TypicalTurnAroundTime.Value.ToString(Consts.NumericFormat) : null, ProcessingTime.HasValue ? ProcessingTime.Value.ToString(Consts.NumericFormat) : null, ProcessingPriority != null ? string.Join(Configuration.FieldRepeatSeparator, ProcessingPriority) : null, ReportingPriority, OutsideSitesWhereObservationMayBePerformed != null ? string.Join(Configuration.FieldRepeatSeparator, OutsideSitesWhereObservationMayBePerformed.Select(x => x.ToDelimitedString())) : null, AddressOfOutsideSites != null ? string.Join(Configuration.FieldRepeatSeparator, AddressOfOutsideSites.Select(x => x.ToDelimitedString())) : null, PhoneNumberOfOutsideSite?.ToDelimitedString(), ConfidentialityCode?.ToDelimitedString(), ObservationsRequiredToInterpretThisObservation?.ToDelimitedString(), InterpretationOfObservations?.ToDelimitedString(), ContraindicationsToObservations?.ToDelimitedString(), ReflexTestsObservations != null ? string.Join(Configuration.FieldRepeatSeparator, ReflexTestsObservations.Select(x => x.ToDelimitedString())) : null, RulesThatTriggerReflexTesting?.ToDelimitedString(), FixedCannedMessage?.ToDelimitedString(), PatientPreparation?.ToDelimitedString(), ProcedureMedication?.ToDelimitedString(), FactorsThatMayAffectTheObservation?.ToDelimitedString(), ServiceTestObservationPerformanceSchedule != null ? string.Join(Configuration.FieldRepeatSeparator, ServiceTestObservationPerformanceSchedule) : null, DescriptionOfTestMethods?.ToDelimitedString(), KindOfQuantityObserved?.ToDelimitedString(), PointVersusInterval?.ToDelimitedString(), ChallengeInformation?.ToDelimitedString(), RelationshipModifier?.ToDelimitedString(), TargetAnatomicSiteOfTest?.ToDelimitedString(), ModalityOfImagingMeasurement?.ToDelimitedString() ).TrimEnd(Configuration.FieldSeparator.ToCharArray())); }
public ChallengeInformation GetChallengeInfo(string name) { ChallengeInformation info = new ChallengeInformation(); foreach (ChallengeInformation ci in challengeInfos) { if (ci.LevelName == name) { info = ci; } } return(info); }
public void UpdateInfo() { ChallengeInformationText[] cits = FindObjectsOfType <ChallengeInformationText>(); ChallengeGenerator cg = FindObjectOfType <ChallengeGenerator>(); foreach (var cit in cits) { ChallengeInformation info = cg.GetChallengeInfo(cit.gameObject.name); if (info.Completed) { cit.tick.enabled = true; } } }
// Update is called once per frame void Update() { if (content.Count == 0) { content = FindObjectsOfType <ChallengeInformationText>().ToList(); } foreach (ChallengeInformationText cit in content) { if (cit.transform.position.x > Screen.width / 5 && cit.transform.position.x < (Screen.width / 5) * 4 && cit.name != activeChallenge) { activeChallenge = cit.name; ChallengeInformation info = FindObjectOfType <ChallengeGenerator>().GetChallengeInfo(cit.name); text.text = info.Letters[0].ToString() + info.Letters[1].ToString() + info.Letters[2].ToString() + "\n" + info.Target + "pts\n" + info.Time + "s"; } } }
public void GenerateChallenges() { if (!File.Exists(path)) { file = new FileStream(path, FileMode.Create, FileAccess.Write); file.Dispose(); SetupFile(path); } file = new FileStream(path, FileMode.Open, FileAccess.ReadWrite); file.Dispose(); string[] lines = File.ReadAllLines(path); parent.GetComponent <RectTransform>().sizeDelta = new Vector2((lines.Length + 1) * (Screen.width / 2), 300); for (int i = 0; i < lines.Length; ++i) { ChallengeInformation info = GetChallengeInformation(lines[i]); challengeInfos.Add(info); GameObject go = Instantiate(prefab); go.transform.SetParent(parent, false); go.GetComponent <RectTransform>().localPosition = new Vector3(localXPos, 0); Color color = Colors.Blue; switch (info.difficulty) { case Difficulty.Medium: color = Colors.Yellow; break; case Difficulty.Hard: color = Colors.Red; break; } go.GetComponent <Text>().text = info.LevelName; go.GetComponent <Text>().color = color; go.name = info.LevelName; localXPos += Screen.width / 3; } file.Close(); }
ChallengeInformation GetChallengeInformation(string line) { ChallengeInformation info = new ChallengeInformation(); string[] split = line.Split('\t'); info.LevelName = split[0]; info.Letters = new char[3] { split[1][0], split[2][0], split[3][0] }; switch (split[4]) { case "E": info.difficulty = Difficulty.Easy; break; case "M": info.difficulty = Difficulty.Medium; break; case "H": info.difficulty = Difficulty.Hard; break; } info.Target = int.Parse(split[5]); if (split[6] == "Y") { info.Completed = true; } else { info.Completed = false; } info.Time = int.Parse(split[7]); return(info); }
public void SetChallengeInfo(string name) { challengeInfo = challengeGenerator.GetChallengeInfo(name); }