Example #1
0
        public void WriteRemarkInXLM(Guid id, int personId)
        {
            var loader = new ObjectLoader(_repository);

            loader.Load(objects =>
            {
                CreateXmlFile(objects.ToList().Reasons(personId, id));
                //CreateXmlFile(objects.ToList().Reasons(personId, id), $@"D:\\Import\\persons.xml");
            }, type => true, id);
        }
Example #2
0
File: Arena.cs Project: exts/ld44
        public override void _Ready()
        {
            Game.WavesCleared   = 0;
            Game.EnemiesCleared = 0;

            CurrentWaveTime = MaxWaveTime;

            // custom cursor
            Input.SetMouseMode(Input.MouseMode.Hidden);
            _cursor = GetNode <Node2D>("Cursor");

            _player = GetNode <Player>("Player");
            _player.Connect(nameof(Player.Reloading), this, nameof(ShowReloadingIcon));
            _player.Connect(nameof(Player.SpawnBullet), this, nameof(SpawnBullet));
            _player.Connect(nameof(Player.ReloadingDone), this, nameof(HideReloadingIcon));
            _player.CenterPlayer();
            _currentAmmo = _player.CurrentAmmo;

            _currentWave = GetNode <CurrentWave>("CurrentWave");
            _currentWave.Connect("WaveStart", this, nameof(WaveStart));

            _ammoContainer = GetNode <HBoxContainer>("Ammo/Container");
            _ammoReloading = GetNode <AmmoReloading>("Ammo/Reloading");

            _enemyContainer = GetNode <Node2D>("Enemies");

            _waveTimer = GetNode <Timer>("Timers/WaveTimer");
            _waveTimer.Connect("timeout", this, nameof(HandleCurrentWave));

            _spawnTimer = GetNode <Timer>("Timers/SpawnTimer");
            _spawnTimer.Connect("timeout", this, nameof(SpawnMonsters));

            _hpbar = GetNode <HealthBar>("HealthBar");

            _spawnPoints = GetNode <Node2D>("SpawnPoints");
            SetupSpawnPointsInSpawner();

            _enemyObject         = ObjectLoader.Load("Data/Objects/Enemy");
            _bulletObject        = ObjectLoader.Load("Data/Objects/Bullet");
            _ammoEmptyObject     = ObjectLoader.Load("Data/Objects/UI/AmmoEmpty");
            _ammoAvailableObject = ObjectLoader.Load("Data/Objects/UI/AmmoAvailable");

            DrawAmmoUiElements();
            _currentWave.Start();
        }
Example #3
0
        public override void Initialize(Dictionary <string, Dictionary <string, GameObject> > preloadedObjects)
        {
            instance = this;

            //new Test();
            //return;

            #region VerifyVersion
            Logger.Log("Load Global Json");
            ItemSettings global = SerializeHelper.LoadGlobalSettings <ItemSettings>();
            if (global != null)
            {
                if (global.mod_version > Version)
                {
                    new ErrorPanel($"Require Version:{global.mod_version},BUT you Version:{Version}\n(你的MOD版本该更新了)");
                    throw new FileLoadException("Try To Load an newer json data in an older mod,please update mod");
                }

                ItemData = global;
                Logger.Log("Loaded Json");
            }
            #endregion

            #region Init GameObject
            ObjectLoader.Load(preloadedObjects);
            BehaviourProcessor.RegisterBehaviour <Particle>();
            BehaviourProcessor.RegisterBehaviour <Draw>();
            BehaviourProcessor.RegisterBehaviour <OtherBehaviour>();
            BehaviourProcessor.RegisterBehaviour <AreaBehaviour>();
            BehaviourProcessor.RegisterBehaviour <MovablePlatform>();
            BehaviourProcessor.RegisterBehaviour <ModifyGameItem>();
            BehaviourProcessor.RegisterBehaviour <Mana>();
            BehaviourProcessor.RegisterBehaviour <AudioBehaviours>();
            BehaviourProcessor.RegisterBehaviour <OneShotBehaviour>();
            BehaviourProcessor.RegisterBehaviour <Scope>();
            BehaviourProcessor.RegisterBehaviour <Bench>();
            BehaviourProcessor.RegisterSharedBehaviour <DefaultBehaviour>();
            BehaviourProcessor.RegisterSharedBehaviour <UnVisableBehaviour>();
            BehaviourProcessor.RegisterSharedBehaviour <DelayResizableBehaviour>();
            #endregion

            #region InitGUI
            UIObj = new GameObject();
            UIObj.AddComponent <GUIController>();
            UnityEngine.Object.DontDestroyOnLoad(UIObj);
            GUIController.Instance.BuildMenus();
            #endregion

            #region SetupCallBack
            SelectGetter  = GetKeyPress;
            SelectGetter += PickPanel.SelectFocus;
            UnityEngine.SceneManagement.SceneManager.sceneLoaded += SpawnFromSettings;
            UnityEngine.SceneManagement.SceneManager.sceneLoaded += ShowRespawn;
            UnityEngine.SceneManagement.SceneManager.sceneLoaded += AutoSaveModification;
            On.GameManager.PositionHeroAtSceneEntrance           += HeroOutBoundSave;
            ModHooks.Instance.LanguageGetHook     += DLanguage.MyLanguage;
            ModHooks.Instance.ApplicationQuitHook += SaveJson;
            if (Settings.CreateMode)
            {
                ModHooks.Instance.HeroUpdateHook += OperateItem;
            }
            #endregion

            UserLicense.ShowLicense();
        }
Example #4
0
        public void Initialize(DbSchema schema)
        {
            // TODO: locking
            Stopwatch fullTime    = Stopwatch.StartNew();
            Stopwatch partialTime = Stopwatch.StartNew();

            this.Logger.Write("Database creation started...");

            this.EnsureInitializedDatabase();

            // Temporary dictionary
            Dictionary <string, ITable> tables = new Dictionary <string, ITable>();

            this.Logger.Write("Creating tables...");
            partialTime.Restart();

            foreach (DbTableInfo tableInfo in schema.Tables)
            {
                ITable table = DatabaseReflectionHelper.CreateTable(
                    this.Internal,
                    tableInfo.EntityType,
                    (IKeyInfo)tableInfo.PrimaryKeyInfo,
                    tableInfo.IdentityField,
                    tableInfo.ConstraintFactories);

                tables.Add(tableInfo.TableName, table);
            }

            this.Logger.Write(
                "Tables created in {0:0.0} ms",
                partialTime.Elapsed.TotalMilliseconds);

            this.Logger.Write("Adding initial data...");
            partialTime.Restart();

            // Add initial data to the tables
            using (ITableDataLoaderFactory loaderFactory = this.CreateDataLoaderFactory())
            {
                foreach (DbTableInfo tableInfo in schema.Tables)
                {
                    // Get the table reference from the temporary dictionary
                    ITable table = tables[tableInfo.TableName];

                    // Return initial entity data and materialize them
                    IEnumerable <object> data = ObjectLoader.Load(loaderFactory, tableInfo);

                    DatabaseReflectionHelper.InitializeTableData(table, data);
                }
            }

            this.Logger.Write(
                "Initial data added in {0:0.0} ms",
                partialTime.Elapsed.TotalMilliseconds);

            this.Logger.Write("Building additional indexes...");
            partialTime.Restart();

            foreach (DbTableInfo tableInfo in schema.Tables)
            {
                ITable table = tables[tableInfo.TableName];

                foreach (IKeyInfo key in tableInfo.UniqueKeys)
                {
                    DatabaseReflectionHelper.CreateIndex(table, key, true);
                }

                foreach (IKeyInfo key in tableInfo.ForeignKeys)
                {
                    DatabaseReflectionHelper.CreateIndex(table, key, false);
                }
            }

            this.Logger.Write(
                "Additional indexes built in {0:0.0} ms",
                partialTime.Elapsed.TotalMilliseconds);

            this.Logger.Write("Creating and verifying associations...");
            partialTime.Restart();

            foreach (DbRelationInfo relation in schema.Relations)
            {
                DatabaseReflectionHelper.CreateAssociation(this.Internal, relation);
            }

            this.Logger.Write(
                "Associations created and verfied in {0:0.0} ms",
                partialTime.Elapsed.TotalMilliseconds);

            this.Logger.Write(
                "Database creation finished in {0:0.0} ms",
                fullTime.Elapsed.TotalMilliseconds);
        }
Example #5
0
    void Start()
    {
        ObjectLoader loader = model.AddComponent <ObjectLoader> ();

        loader.Load(@"/model/path/", "model.obj");
    }