Ejemplo n.º 1
0
    public string dll_path;// dll文件在运行期的目录

    // Use this for initialization
    void Start()
    {
        string[] names = GetControllersName();
        ControlLoader.controllers = new PlayerInterface.IControl[4];
        for (int i = 0; i < 4; i++)// 加载4个控制器
        {
            try
            {
                ControlLoader.controllers[i] = ControlLoader.Load(dll_path, names[i]);
            }
            catch (Exception e)
            {
                Debug.Log(e.Message);// TODO: 应采取其他措施显示错误
            }
        }
    }
Ejemplo n.º 2
0
        void LoadModel(string fileName)
        {
            ControlLoader loader  = new ControlLoader(fileName);
            Control       control = loader.LoadControl();

            _currentViewModel = new ViewModel(loader.DesignerFilename, control);

            if (control is Form form)
            {
                form.TopLevel = false;
                form.Left     = 0;
                form.Top      = 0;
                form.Show();
            }

            formPanel.Controls.Add(control);

            _currentViewModel.CurrentSelectionChanged += OnCurrentSelectionChanged;
        }
 public ProjectionInfoExtractor(ControlLoader controlLoader)
 {
     ControlLoader = controlLoader;
 }
Ejemplo n.º 4
0
 public PartScanner(Page page)
 {
     ControlLoader = new ControlLoader(page);
 }
Ejemplo n.º 5
0
 public PartScanner(Page page)
 {
     ControlLoader = new ControlLoader(page);
 }
Ejemplo n.º 6
0
        static void Main(string[] args)
        {
            //Default case goes here
            IGameFactory factory = new LevelCreator();
            //IGameFactory factory = new TestLevelCreeator();
            //IGameFactory factory = new GameDirectorLevel1Creator();

            // IGameFactory factory = new TestLevelCreator();
            Controller controller = new Controller();

            bool cheatMode = false;

            for (int i = 0; i < args.Length; i++)
            {
                if (string.Equals(args[i], "-level", StringComparison.CurrentCultureIgnoreCase))
                {
                    if (string.Equals(args[i + 1], "test", StringComparison.OrdinalIgnoreCase))
                    {
                        factory = new TestLevelCreator();
                    }
                    else if (string.Equals(args[i + 1], "level1"))
                    {
                        factory = new LevelCreator();
                    }
                    else
                    {
                        throw new Exception("Invalid level specified");
                    }

                    //skip the next entry in args
                    i++;
                }
                else if (string.Equals(args[i], "-keybinding", StringComparison.CurrentCultureIgnoreCase))
                {
                    try
                    {
                        ControlLoader loader = new ControlLoader(args[i + 1]);
                        controller.OnRebind += loader.OnLoadKeys;

                        loader.OnLoadKeys(controller, EventArgs.Empty);
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine("Failed to load keys, default will be used");
                    }

                    //skip the next entry in args
                    i++;
                }
                else if (string.Equals(args[i], "-cheatmode", StringComparison.CurrentCultureIgnoreCase))
                {
                    cheatMode = true;
                }
                else
                {
                    Console.WriteLine("Unknown parameter: " + args[i]);
                }
            }

            factory.setCheatMode(cheatMode);

            if (args.Length > 0)
            {
            }

            using (var game = new BHGame(factory, controller))
            {
                game.Run();
            }
        }
Ejemplo n.º 7
0
 public ProjectionScanner(ControlLoader controlLoader)
 {
     ControlLoader = controlLoader;
 }
Ejemplo n.º 8
0
 public ProjectionScanner(ControlLoader controlLoader)
 {
     ControlLoader = controlLoader;
 }