public RouletteGame(IWheel wheel, ITableLoader tableLoader)
        {
            _wheel       = wheel;
            _tableLoader = tableLoader;

            LoadTable();
        }
        void OnTableThread(object state)
        {
#if UNITY_EDITOR
            RTLog.LogFormat(LogCat.Table, "Begin Thread[{0}]", mThreadState.name);
#endif
            try
            {
                while (mThreadState.isAlive)
                {
                    ITableLoader loader = null;
                    lock (mLock)
                    {
                        IsLoading = mLoaders.Count > 0;
                        if (!IsLoading)
                        {
                            //mThread = null;
                            mThreadState.isAlive = false;
                            break;
                        }
                        loader = mLoaders.Dequeue();
                        mTaskQueue.Remove(loader.Identify);
                    }
                    if (mThreadState.isAlive)
                    {
                        MainThread.RunOnMainThread(loader.StartLoad);
                    }
                    while (mThreadState.isAlive && !loader.IsReady)
                    {
#if UNITY_EDITOR
                        if (!MainThread.IsInitilized)
                        {
                            mThreadState.isAlive = false;
                        }
                        MainThread.RunOnMainThread((x) => { if (!Application.isPlaying)
                                                            {
                                                                x.isAlive = false;
                                                            }
                                                   }, mThreadState);
#endif
                        Thread.Sleep(200);
                    }
                    if (mThreadState.isAlive)
                    {
                        loader.LoadAsTable();
                    }
                }
            }
            catch (System.Exception e)
            {
                RTLog.LogError(LogCat.Table, e.ToString());
            }
            finally
            {
                Abort();
                MainThread.RunOnMainThread(NotifyComplete);
#if UNITY_EDITOR
                RTLog.LogFormat(LogCat.Table, "End Thread[{0}]", mThreadState.name);
#endif
            }
        }
Exemple #3
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="T:System.Object" /> class.
 /// </summary>
 private TablesManager(ITableLoader<MSSQLTable<TableContent, ColumnContent>> loader, string tableContext, string tableGroup = null, string tableSubGroup = null)
 {
     _loader = loader;
     _tableContext = tableContext;
     _tableGroup = tableGroup;
     _tableSubGroup = tableSubGroup;
 }
Exemple #4
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="T:System.Object" /> class.
 /// </summary>
 private TablesManager(ITableLoader <MSSQLTable <TableContent, ColumnContent> > loader, string tableContext, string tableGroup = null, string tableSubGroup = null)
 {
     _loader        = loader;
     _tableContext  = tableContext;
     _tableGroup    = tableGroup;
     _tableSubGroup = tableSubGroup;
 }
 public TextTransformer(
     ITableLoader tableLoader,
     ITableSaver tableSaver,
     ITableTransformer tableTransformer)
 {
     this.tableLoader      = tableLoader ?? throw new ArgumentNullException(nameof(tableLoader));
     this.tableSaver       = tableSaver ?? throw new ArgumentNullException(nameof(tableSaver));
     this.tableTransformer = tableTransformer ?? throw new ArgumentNullException(nameof(tableTransformer));
 }
Exemple #6
0
 public bool Init(ITableLoader <K, V> loader, string sourcePath, string fileName, string targetPath = "")
 {
     return(loader.Run(sourcePath, fileName, targetPath, ref _rows));
 }
Exemple #7
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="T:System.Object" /> class.
 /// </summary>
 private TablesManager(ITableLoader<MSSQLTable<TableContent, ColumnContent>> loader, string tableGroupFilter)
 {
     _loader = loader;
     _tableGroupFilter = tableGroupFilter;
 }
 /// <summary>
 /// 初始化一个<see cref="PackageLoader"/>类型的实例
 /// </summary>
 /// <param name="tableLoader">数据表加载器</param>
 /// <param name="referenceLoader">引用加载器</param>
 public PackageLoader(ITableLoader tableLoader, IReferenceLoader referenceLoader)
 {
     _tableLoader     = tableLoader;
     _referenceLoader = referenceLoader;
 }
Exemple #9
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="T:System.Object" /> class.
 /// </summary>
 private TablesManager(ITableLoader <MSSQLTable <TableContent, ColumnContent> > loader, string tableGroupFilter)
 {
     _loader           = loader;
     _tableGroupFilter = tableGroupFilter;
 }
Exemple #10
0
 public LimitedRouletteGame(IWheel wheel, ITableLoader tableLoader) : base(wheel, tableLoader)
 {
 }