Пример #1
0
        // --- インターフェース関数 ---
        /// <summary>プラグインが読み込まれたときに呼び出される関数</summary>
        /// <param name="properties">読み込み時にプラグインに提供されるプロパティ</param>
        /// <returns>プラグインが正常にロードされたかどうか</returns>
        public bool Load(LoadProperties properties)
        {
            string dllPath = System.Reflection.Assembly.GetExecutingAssembly().Location;
            string cfgPath = System.IO.Path.ChangeExtension(dllPath, ".cfg");

            this.LoadConfig = LoadConfig.GetInstance();
            LoadConfig.LoadCfgFile(cfgPath);

            string dllDirectory = System.IO.Path.GetDirectoryName(dllPath);
            string notchPath    = System.IO.Path.Combine(dllDirectory, "Notch", "Notch.txt");

            this.LoadPerform = LoadPerform.GetInstance();
            LoadPerform.LoadCfgFile(notchPath);

            this.LoadCurrent = LoadCurrent.GetInstance();
            LoadCurrent.LoadPowerCfg(LoadPerform.power_current_path_);
            LoadCurrent.LoadBrakeCfg(LoadPerform.brake_current_path_);

            this.LoadSwitch = LoadSwitch.GetInstance();
            string dllName   = System.IO.Path.GetFileNameWithoutExtension(dllPath);
            string exCfgPath = System.IO.Path.Combine(dllDirectory, dllName + "_openbve.cfg");

            LoadSwitch.LoadCfgFile(exCfgPath);

            properties.Panel     = new int[272];
            properties.AISupport = AISupport.None;
            this.Train           = new Train(properties.Panel, properties.PlaySound);
            return(true);
        }
Пример #2
0
 // --- コンストラクタ ---
 /// <summary>
 /// 静的コンストラクタ
 /// </summary>
 static LoadSwitch()
 {
     load_switch_   = new LoadSwitch();
     switch_config_ = new SwitchConfig[ALL_SWITCH];
     for (int i = 0; i < ALL_SWITCH; i++)
     {
         switch_config_[i] = new SwitchConfig();
     }
 }