public ICollection <string> ReadEndCodeA(string airline, string startcode)
        {
            ICollection <string> destinationCode = _fIDataRead.ReadEndCodeA(airline, startcode);

            FLog.FD("FLogicQueries.GetDeastinationCode()", destinationCode);
            return(destinationCode);
        }
        public int countFlights()
        {
            int flights = _fIDataRead.countFlights();

            FLog.FD("countFlights()", flights);
            return(flights);
        }
        public Flight ReadFlight(string Id)
        {
            Flight flight = _fIDataRead.ReadFlight(Id);

            FLog.FD("FlogicQueries.GetFlight()", flight);
            return(flight);
        }
        /// <summary>
        /// If given instance's class has defines given attribute, return desire property.
        /// </summary>
        /// <returns>Value of desire property in given attribute</returns>
        public static T GetAttributeProperty <T>(object instance, Type attributeType, string propertyName)
        {
            FAssert.IsNotNull(instance);
            FAssert.IsNotNull(attributeType);
            FAssert.IsFalse(string.IsNullOrEmpty(propertyName));
            FAssert.IsTrue(attributeType.IsSubclassOf(typeof(Attribute)));

            Type instanceType = instance.GetType();

            FAssert.IsTrue(HasDefinedAttribute(instanceType, attributeType));

            PropertyInfo propertyInfo = attributeType.GetProperty(propertyName, BINDING_FLAGS);

            FAssert.IsNotNull(propertyInfo);

            try
            {
                Attribute attribute = instanceType.GetCustomAttribute(attributeType);

                return((T)propertyInfo.GetValue(attribute));
            }
            catch (InvalidCastException exception)
            {
                FLog.Error(CLASS_TYPE.Name, exception.Message);

                return(default);
Esempio n. 5
0
        private async void OnSceneLoaded(EventArgs arg)
        {
            FSceneLoadedEventArg eventArg = (FSceneLoadedEventArg)arg;

            CLevelConfiguration metadata = FindObjectOfType <CLevelConfiguration>();

            if (metadata == null)
            {
                FLog.Warning(CLASS_TYPE.Name, $"Cannot find scene metadata `S{eventArg.Scene.name}`");
            }
            else if (metadata.GameMode == null)
            {
                FLog.Warning(CLASS_TYPE.Name, $"GameMode is not sat for this level.");
            }
            else
            {
                _currentGameMode = Activator.CreateInstance(metadata.GameMode.Type) as IGameMode;

                await _currentGameMode?.PreInitializeAsync();

                await _currentGameMode?.InitializeAsync();

                await _currentGameMode?.BeginPlayAsync();

                FEventManager.Publish(FEventManager.ON_GAME_MODE_LOADED);
            }
        }
        public ICollection <string> ReadAirlines(string start, string end)
        {
            ICollection <string> airline = _fIDataRead.ReadAirlines(start, end);

            FLog.FD("FLogicQueries.GetAirlines()", airline);
            return(airline);
        }
Esempio n. 7
0
        public async Task UnregisterAsync(IInitializableObject initializable)
        {
            if (_initializablesHolder.Contains(initializable) == false)
            {
                FLog.Warning(CLASS_TYPE.Name, $"{initializable.Name} has not registered but wants to unregister itself.");

                return;
            }

            await initializable.UninitializeAsync();

            _registeredObjects.Remove(initializable);

            _initializablesHolder.Remove(initializable);

            if (initializable is ITickableObject tickable)
            {
                if (_ticksHolder.Contains(tickable))
                {
                    UnregisterTick(tickable);
                }

                if (_lateTicksHolder.Contains(tickable))
                {
                    UnregisterLateTick(tickable);
                }

                if (_fixedTicksHolder.Contains(tickable))
                {
                    UnregisterFixedTick(tickable);
                }
            }
        }
        public ICollection <string> ReadStartA(string airline, string end)
        {
            ICollection <string> start = _fIDataRead.ReadStartA(airline, end);

            FLog.FD("FLogicQueries.GetStart()", start);
            return(start);
        }
Esempio n. 9
0
        private void StopRecording()
        {
            RecordingNeeded = false;
            isRecording     = false;
            FLog.Log("L1 of stop....");
            // System.Threading.Thread.Sleep((int)(2 * NUD_Exposure.Value*1000)+100);
            try
            {
                //System.Threading.Thread.Sleep((int)(2 * (AbsValExp?.Value ?? 0) * 1000) + 100);
                System.Threading.Thread.Sleep(500);
            }
            catch
            {
                System.Threading.Thread.Sleep(500);
                FLog.Log("Can't read exposure...");
            }

            FLog.Log("L2 of stop....");
            if (writer_ffmpeg != null)
            {
                if (writer_ffmpeg.IsOpen) //запись закрывается в ImageAvalible, но если вдруг не закрылась, то тут
                {
                    try { writer_ffmpeg.Close(); FLog.Log("L2_special_closing of stop...."); } catch { FLog.Log("Error on L3...."); }
                }
            }
            //enabling all the staff
            Switch_state_of_ctrls();
            mainViewModel.VideoCapturing = false;
            FLog.Log("L3 of stop....");
        }
Esempio n. 10
0
        internal CViewMain(CViewModelMainFlight viewModelMainFlight, CViewModelMainShipInfo viewModelMainShipInfo,
                           CViewFilterFlight viewFoundFlight, CViewAdministrationFlight viewAdministrationFlight,
                           CViewAdministrationShipInfo cViewAdministrationShipInfo, CViewFilterShipInfo viewFilterShipInfo, CViewUpdateFlight cViewUpdateFlight, CViewUpdateShipInfo cViewUpdateShipInfo)
        {
            FLog.FD("CViewMain.Ctor()", "");
            InitializeComponent();
            // Change cultureInfo in all XAML View, e.z. to de-DE
            this.Language = XmlLanguage.GetLanguage(Thread.CurrentThread.CurrentUICulture.Name);
            var language = CultureInfo.CurrentUICulture.Name;

            FrameworkElement.LanguageProperty.OverrideMetadata(
                typeof(FrameworkElement),
                new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(language)));

            _viewModelMainFlight         = viewModelMainFlight;
            _viewModelMainShipInfo       = viewModelMainShipInfo;
            _viewFilterShipInfo          = viewFilterShipInfo;
            _viewFilterFlight            = viewFoundFlight;
            _viewAdministrationFlight    = viewAdministrationFlight;
            _cViewAdministrationShipInfo = cViewAdministrationShipInfo;
            _cViewUpdateFlight           = cViewUpdateFlight;
            _cViewUpdateShipInfo         = cViewUpdateShipInfo;
            DataContext        = viewModelMainFlight;
            _selectedModelMain = viewModelMainFlight;
            //Load Page
            pageloader.Content = _viewFilterFlight;
            //Menue itemcolor
            airplane_btn.Foreground = Brushes.DarkSlateBlue;
        }
        public ICollection <string> ReadStartCodeA(string airline, string endcode)
        {
            ICollection <string> startCode = _fIDataRead.ReadStartCodeA(airline, endcode);

            FLog.FD("FLogicQueries.GetStartCode()", startCode);
            return(startCode);
        }
        public ICollection <string> ReadEndA(string airline, string start)
        {
            ICollection <string> destination = _fIDataRead.ReadEndA(airline, start);

            FLog.FD("FLogicQueries.GetDestination()", destination);
            return(destination);
        }
 internal CViewModelUpdateFlight(CServiceSearchFlight serviceSearch, CServiceOfferFlight serviceOffer, CViewModelMainFlight viewModelMainFlight)
 {
     FLog.FD("CViewModelUpdateFlight.Ctor()", "");
     _viewModelMainFlight = viewModelMainFlight;
     _serviceSearch       = serviceSearch;
     _serviceOffer        = serviceOffer;
     InitializeFlight();
 }
Esempio n. 14
0
    static void OnLogCallback(string InContent, string InTraceBack, LogType InType)
    {
        FLog log = new FLog();

        log.content = InContent;
        log.track   = InTraceBack;
        log.logType = InType;
        mWriteTxt.Add(log);
    }
Esempio n. 15
0
        public static void Init()
        {
            Form = new FLog();
            var hWnd = Form.Handle;

            Form.FormClosing += delegate(object sender, FormClosingEventArgs e) {
                e.Cancel = true;
                ((FLog)sender).Hide();
            };
        }
Esempio n. 16
0
        public static async Task UnloadSceneAsycn(Scene scene)
        {
            TaskCompletionSource <bool> taskCompletionSource = new TaskCompletionSource <bool>();

            AsyncOperation asyncOperation = USceneManager.UnloadSceneAsync(scene);

            asyncOperation.completed += (AsyncOperation ao) => taskCompletionSource.SetResult(ao.isDone);

            await taskCompletionSource.Task;

            FLog.Info(CLASS_TYPE.Name, $"Scene `{scene.name}` has been unloaded.");
        }
Esempio n. 17
0
 static public int get_logType(IntPtr l)
 {
     try {
         FLog self = (FLog)checkSelf(l);
         pushValue(l, true);
         pushEnum(l, (int)self.logType);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Esempio n. 18
0
 static public int get_track(IntPtr l)
 {
     try {
         FLog self = (FLog)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.track);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Esempio n. 19
0
        public static async Task LoadSceneAsync(string sceneName, LoadSceneMode loadSceneMode)
        {
            TaskCompletionSource <bool> taskCompletionSource = new TaskCompletionSource <bool>();

            AsyncOperation asyncOperation = USceneManager.LoadSceneAsync(sceneName, loadSceneMode);

            asyncOperation.completed += (AsyncOperation ao) => taskCompletionSource.SetResult(ao.isDone);

            await taskCompletionSource.Task;

            FLog.Info(CLASS_TYPE.Name, $"Scene `{USceneManager.GetSceneByName(sceneName).name}` has been loaded.");
        }
Esempio n. 20
0
File: RNG.cs Progetto: qpham01/web
 public static int CombatDice()
 {
     if (combatResults.Count > 0)
     {
         FLog.Info("Combat dice value size {0}", combatResults.Count);
         return(combatResults.Dequeue());
     }
     else
     {
         return(RNG.Dice(100));
     }
 }
Esempio n. 21
0
        public void RegisterLateTick(ITickableObject tickable)
        {
            if (_lateTicksHolder.Contains(tickable))
            {
                FLog.Warning(CLASS_TYPE.Name, $"{tickable.Name} already registered for late tick.");

                return;
            }

            _registeredLateTicks.Add(tickable);

            _lateTicksHolder.Add(tickable);
        }
Esempio n. 22
0
 static public int constructor(IntPtr l)
 {
     try {
         FLog o;
         o = new FLog();
         pushValue(l, true);
         pushValue(l, o);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Esempio n. 23
0
        public void RegisterFixedTick(ITickableObject tickable)
        {
            if (_fixedTicksHolder.Contains(tickable))
            {
                FLog.Warning(CLASS_TYPE.Name, $"{tickable.Name} already registered for fixed tick.");

                return;
            }

            _registeredFixedTick.Add(tickable);

            _fixedTicksHolder.Add(tickable);
        }
Esempio n. 24
0
        public void UnregisterFixedTick(ITickableObject tickable)
        {
            if (_fixedTicksHolder.Contains(tickable) == false)
            {
                FLog.Warning(CLASS_TYPE.Name, $"{tickable.Name} has not registered for fixed tick but wants to unregister.");

                return;
            }

            _registeredFixedTick.Remove(tickable);

            _fixedTicksHolder.Remove(tickable);
        }
Esempio n. 25
0
        /// <summary>
        /// Register a service with given instance as singleton in ServiceLocator.
        /// </summary>
        /// <typeparam name="TService">Service type</typeparam>
        /// <param name="service">Service instance</param>
        public static void Register <TService>(object service) where TService : class
        {
            FAssert.IsNotNull(service, "Service instance can't be null.");

            FAssert.IsNotNull(service as TService, $"`{service.GetType().Name}` Service instance doesn't implemented `{typeof(TService).Name}` interface.");

            Type serviceType = typeof(TService);

            FAssert.IsFalse(_registeredServices.ContainsKey(serviceType), $"`{service.GetType().Name}` service is already registered.");

            _registeredServices.Add(serviceType, service);

            FLog.Info(CLASS_TYPE.Name, $"`{serviceType.Name}` service has been registered. Service instance is `{service.GetType().Name}`.");
        }
Esempio n. 26
0
 static public int set_logType(IntPtr l)
 {
     try {
         FLog self = (FLog)checkSelf(l);
         UnityEngine.LogType v;
         checkEnum(l, 2, out v);
         self.logType = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Esempio n. 27
0
 static public int set_track(IntPtr l)
 {
     try {
         FLog          self = (FLog)checkSelf(l);
         System.String v;
         checkType(l, 2, out v);
         self.track = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Esempio n. 28
0
 private void Run()
 {
     _counter = 0;
     while (true)
     {
         if (_timer.Ended())
         {
             ++_counter;
             OnRefresh();
             GamePanel.Refresh();
             FLog.Info("repaint" + _counter);
         }
     }
     // ReSharper disable once FunctionNeverReturns
 }
 public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
 {
     culture = new CultureInfo(Thread.CurrentThread.CurrentCulture.ToString());
     if (value != null)
     {
         string str = value.ToString();
         if (str == null)
         {
             return("");
         }
         FLog.FD("CDateToStringConverter.Convert()", " DateString: " + str);
         return(str.Substring(0, 10));
     }
     return("");
 }
Esempio n. 30
0
        /// <summary>
        /// Persist a game object that means it will not destroy between levels.
        /// </summary>
        /// <param name="gameObject">Desire game object to make it persistent.</param>
        public static void MakePersistent(GameObject gameObject)
        {
            if (gameObject == null)
            {
                FLog.Error(CLASS_TYPE.Name, $"Given game object to making it persistent is null. it is not accepted.");
                return;
            }

            if (gameObject.GetComponent <CPersistent>() != null)
            {
                FLog.Warning(CLASS_TYPE.Name, $"`{gameObject.name}` has marked as persistent already.");
                return;
            }

            gameObject.AddComponent <CPersistent>();
        }