Exemplo n.º 1
0
        private static void Main()
        {
            try
            {
                Console.ForegroundColor = ConsoleColor.Green;

                Console.WriteLine($"Searching for '{Constants.LogEventsFileName}' in '{Directory.GetCurrentDirectory()}'");

                var sourceFilePath = GetSourceFilePath();
                Console.WriteLine($"Found at '{sourceFilePath}'");

                var classNamespace = NamespaceRetriever.GetFileNamespace(Directory.GetCurrentDirectory(), sourceFilePath);
                Console.WriteLine($"Generated namespace '{classNamespace}'");

                var eventsData = EventLoader.LoadEvents(sourceFilePath);
                Console.WriteLine($"Found {eventsData.Length} event definitions");

                var result = LoggerExtensionsGenerator.Generate(eventsData, classNamespace);

                var targetFilePath = GetTargetFilePath(sourceFilePath);
                Console.WriteLine($"Saving file as '{targetFilePath}'");

                File.WriteAllText(targetFilePath, result);
            }
            catch (Exception ex)
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine(ex.Message);
            }
            finally
            {
                Console.ResetColor();
            }
Exemplo n.º 2
0
        private void InitializeChapter(int chapterId)
        {
            this.chapterId = chapterId;
            // Load Field Map
            chapterDefinition = DefinitionStore.Instance.LoadChapter(chapterId);
            gameField         = new GameField(chapterDefinition);

            // Load Events
            EventLoader eventLoader = EventLoaderFactory.GetEventLoader(chapterId, eventManager);

            eventLoader.LoadEvents();
        }
Exemplo n.º 3
0
 /// <summary>
 /// </summary>
 /// <returns> </returns>
 public EventCollection <T> GetView(bool bypassCache)
 {
     return(_loader.LoadEvents(bypassCache));
 }