Ejemplo n.º 1
0
 public LevelController(EditorController editorController, LevelView levelView)
 {
     _editorController = editorController;
     _levelView        = levelView;
     _levelView.setController(this);
     _keysPressed      = new bool[255];
     _keysChecked      = new bool[255];
     Application.Idle += new EventHandler(update);
     //Application.Idle += new EventHandler(draw);
     _levelView.FindForm().KeyDown += new System.Windows.Forms.KeyEventHandler(Parent_KeyDown);
     _levelView.FindForm().KeyUp   += new System.Windows.Forms.KeyEventHandler(Parent_KeyUp);
 }
Ejemplo n.º 2
0
 public LevelController(EditorController editorController, LevelView levelView)
 {
     _editorController = editorController;
     _levelView = levelView;
     _levelView.setController(this);
     _keysPressed = new bool[255];
     _keysChecked = new bool[255];
     Application.Idle += new EventHandler(update);
     //Application.Idle += new EventHandler(draw);
     _levelView.FindForm().KeyDown += new System.Windows.Forms.KeyEventHandler(Parent_KeyDown);
     _levelView.FindForm().KeyUp += new System.Windows.Forms.KeyEventHandler(Parent_KeyUp);
 }
Ejemplo n.º 3
0
        public SelectItem(EditorController controller)
        {
            InitializeComponent();

            // Populate item uids
            ResourceManager.loadAllItems(new FileStream(ResourceManager.itemPath, FileMode.Open));
            ResourceManager.loadAllBlueprints(new FileStream(ResourceManager.blueprintPath, FileMode.Open));
            List<XElement> resources = ResourceManager.itemResources;
            resources.AddRange(ResourceManager.blueprintResources);
            resources.AddRange(ResourceManager.blueprintScrapResources);
            List<string> uids = new List<string>(from resource in resources select resource.Attribute("uid").Value);
            itemUIDs.DataSource = uids;
        }
Ejemplo n.º 4
0
        public BlueprintController(EditorController controller, BlueprintView blueprintView)
            : base()
        {
            _editorController = controller;
            _blueprints = new BindingList<EditorBlueprint>();
            _view = blueprintView;
            _view.setController(this);

            // Load blueprints
            ResourceManager.loadAllBlueprints(new FileStream(ResourceManager.blueprintPath, FileMode.Open));
            List<XElement> blueprintResources = ResourceManager.blueprintResources;
            foreach (XElement data in blueprintResources)
                _blueprints.Add(initializeBlueprint(data));
        }
Ejemplo n.º 5
0
        public CircuitController(EditorController editorController, CircuitsView circuitsView)
            : base()
        {
            _editorController = editorController;
            _view = circuitsView;
            _circuits = new BindingList<EditorCircuit>();
            _view.setController(this);
            List<XElement> circuitData;

            // Initialize resources
            ResourceManager.loadAllCircuits(new FileStream(ResourceManager.circuitPath, FileMode.Open));
            circuitData = ResourceManager.circuitResources;
            foreach (XElement data in circuitData)
                _circuits.Add(new EditorCircuit(data));
        }
Ejemplo n.º 6
0
        public CircuitController(EditorController editorController, CircuitsView circuitsView) : base()
        {
            _editorController = editorController;
            _view             = circuitsView;
            _circuits         = new BindingList <EditorCircuit>();
            _view.setController(this);
            List <XElement> circuitData;

            // Initialize resources
            ResourceManager.loadAllCircuits(new FileStream(ResourceManager.circuitPath, FileMode.Open));
            circuitData = ResourceManager.circuitResources;
            foreach (XElement data in circuitData)
            {
                _circuits.Add(new EditorCircuit(data));
            }
        }
Ejemplo n.º 7
0
        public BlueprintController(EditorController controller, BlueprintView blueprintView)
            : base()
        {
            _editorController = controller;
            _blueprints       = new BindingList <EditorBlueprint>();
            _view             = blueprintView;
            _view.setController(this);

            // Load blueprints
            ResourceManager.loadAllBlueprints(new FileStream(ResourceManager.blueprintPath, FileMode.Open));
            List <XElement> blueprintResources = ResourceManager.blueprintResources;

            foreach (XElement data in blueprintResources)
            {
                _blueprints.Add(initializeBlueprint(data));
            }
        }
Ejemplo n.º 8
0
        public MaterialController(EditorController editorController, MaterialView materialView)
        {
            _editorController = editorController;
            _materialView     = materialView;
            _materials        = new BindingList <EditorMaterial>();
            List <XElement> materialData;

            // Load materials
            ResourceManager.loadAllMaterials(new FileStream(ResourceManager.materialPath, FileMode.Open));
            materialData = ResourceManager.materialResources;
            foreach (XElement data in materialData)
            {
                _materials.Add(new EditorMaterial(data));
            }

            // Initialize material view
            materialView.setController(this);
        }
Ejemplo n.º 9
0
        public BackgroundController(EditorController editorController, BackgroundView view)
        {
            _editorController = editorController;
            _view             = view;
            _backgrounds      = new BindingList <EditorBackground>();
            List <XElement> backgroundData;

            ResourceManager.loadAllBackgrounds(new FileStream(ResourceManager.backgroundPath, FileMode.Open));

            _view.controller = this;

            backgroundData = ResourceManager.backgroundResources;
            foreach (XElement data in backgroundData)
            {
                _backgrounds.Add(new EditorBackground(data));
            }

            _view.backgrounds = _backgrounds;
        }
Ejemplo n.º 10
0
 // setController
 public void setController(EditorController controller)
 {
     _controller = controller;
 }