Пример #1
0
        public static Reporter CreateReporter(ReporterType reporterType)
        {
            switch (reporterType)
            {
            case ReporterType.LogInstallationsReporter:
                return(new LogInstallationsReporter());

            case ReporterType.LogLicensesReporter:
                return(new LogLicensesReporter());

            case ReporterType.LicensesBySoftCountReporter:
                return(new LicensesBySoftCountReporter());

            case ReporterType.InstallationsInfoReporter:
                return(new InstallationsInfoReporter());

            case ReporterType.DepartmentReporter:
                return(new DepartmentReporter());

            case ReporterType.PcReporter:
                return(new PcReporter());
            }
            throw new ReporterException(
                      string.Format(CultureInfo.InvariantCulture, "В фабрику ReporterFactory передан неизвестный тип {0}", reporterType));
        }
Пример #2
0
        public void InstantiateCourtGuest(ReporterType thisType)
        {
            GameObject         tmp        = null;
            ScenePointBehavior spawnPoint = spawnPointList.Find(x => x.gameObject.name == "Court Spawn");

            if (spawnPoint == null)
            {
                return;
            }

            switch (currentCourtGuest.reporterType)
            {
            case ReporterType.Soldier:
                tmp = characterPrefabsList.Find(x => x.reporterType == ReporterType.Soldier).prefab;
                tmp = GameObject.Instantiate(tmp, spawnPoint.transform.position, Quaternion.identity, null);
                currentCourtGuest.characterSpawned = tmp.GetComponent <BaseCharacter>();
                break;

            case ReporterType.Villager:
                tmp = characterPrefabsList.Find(x => x.reporterType == ReporterType.Villager).prefab;
                tmp = GameObject.Instantiate(tmp, spawnPoint.transform.position, Quaternion.identity, null);
                currentCourtGuest.characterSpawned = tmp.GetComponent <BaseCharacter>();
                break;
            }

            if (currentCourtGuest.characterSpawned != null)
            {
                currentCourtGuest.characterSpawned.SpawnInThisPosition(spawnPoint);
                currentCourtGuest.characterSpawned.OrderMovement(spawnPoint.neighborPoints[0], PreStartCourt);
            }
            else
            {
                Debug.LogError("Unable to obtain character for [" + currentCourtGuest.reporterType + "], unable to find prefab.");
            }
        }
Пример #3
0
        public CourtGuest CreateCourtGuest(ReporterType type)
        {
            CourtGuest tmp = new CourtGuest();

            tmp.reporterType = type;
            return(tmp);
        }
Пример #4
0
        private void RunDepReport(ReporterType reporterType, List <string> args)
        {
            var reporter = ReporterFactory.CreateReporter(reporterType);

            reporter.ReportOutputStreamResponse += reporter_ReportOutputStreamResponse;
            reporter.ReportComplete             += reporter_ReportComplete;
            reporter.ReportCanceled             += reporter_ReportCanceled;
            _reportCounter++;
            reporter.Run(args);
        }
Пример #5
0
        private void RunReport(ReporterType reporterType)
        {
            var reporter = ReporterFactory.CreateReporter(reporterType);

            reporter.ReportOutputStreamResponse += reporter_ReportOutputStreamResponse;
            reporter.ReportComplete             += reporter_ReportComplete;
            reporter.ReportCanceled             += reporter_ReportCanceled;
            _reportCounter++;
            reporter.Run();
        }
Пример #6
0
 private static IProgressReporter GetReporter(ReporterType reporterType)
 {
     switch (reporterType)
     {
         case ReporterType.TeamCity:
             return new TeamCityProgressReporter(Console.WriteLine);
         default:
             return new DefaultProgressReporter(Console.WriteLine);
     }
 }
Пример #7
0
        public static IReporter GetReporter(ReporterType type, ReporterOptions options)
        {
            var defaultReporter = new RemoteReporter.Builder()
                                  .WithSender(new UdpSender(options.RemoteHost, options.RemotePort, 0))
                                  .Build();

            switch (type)
            {
            case ReporterType.Remote:
                return(defaultReporter);

            default:
                return(defaultReporter);
            }
        }
Пример #8
0
        public void SpawnCourtGuest(ReporterType guestType)
        {
            if (currentCourtGuest != null)
            {
                CourtGuest newGuest = CreateCourtGuest(guestType);

                if (queuedGuestList == null)
                {
                    queuedGuestList = new List <CourtGuest>();
                }
                queuedGuestList.Add(newGuest);
            }
            else
            {
                currentCourtGuest = CreateCourtGuest(guestType);
            }

            InstantiateCourtGuest(currentCourtGuest.reporterType);
        }
Пример #9
0
 protected Reporter(ReporterType reporterType, ReportLevelType reportLevel)
 {
     ReporterType = reporterType;
     ReportLevel  = reportLevel;
 }
Пример #10
0
 private IReporter CreateReporter(ReporterType reporterType)
 {
     switch (reporterType)
     {
         case ReporterType.Plain:
             return new PlainTextReporter();
         case ReporterType.XunitXml:
             return new XUnitReporter();
         case ReporterType.XunitHtml:
             return new XUnitHtmlReporter();
         case ReporterType.AngularJs:
             return new AngularJsReporter();
     }
     throw new ArgumentException("Unknown reporter type: " + reporterType);
 }