Esempio n. 1
0
        public CommandController(List<CommandBase> commands, SpaceCraftBase spaceCraft, EventManager eventManager)
            : base(spaceCraft)
        {
            _queuedCommands = new List<CommandBase>();
            _activeCommands = new List<CommandBase>();

            foreach (CommandBase command in commands)
            {
                _queuedCommands.Add(command);

                command.LoadEventManager(eventManager);
            }
        }
Esempio n. 2
0
        private void LoadGui()
        {
            _eventManager = new EventManager(new Point(RenderUtils.ScreenWidth / 2, 50), 5, 0.25);

            _progradeButton   = new ProgradeButton(new Point(RenderUtils.ScreenWidth - 160, RenderUtils.ScreenHeight - 105));
            _retrogradeButton = new RetrogradeButton(new Point(RenderUtils.ScreenWidth - 160, RenderUtils.ScreenHeight - 45));

            _gauges = new List <IGauge>
            {
                new NavBall(new Point(RenderUtils.ScreenWidth - 75, RenderUtils.ScreenHeight - 75)),
                _progradeButton,
                _retrogradeButton,
                new ThrustGauge(new Point(RenderUtils.ScreenWidth - 195, RenderUtils.ScreenHeight - 75)),
                new Scale(new Point(75, RenderUtils.ScreenHeight - 25))
            };
        }
Esempio n. 3
0
        private void LoadGui()
        {
            _eventManager = new EventManager(new Point(RenderUtils.ScreenWidth / 2, 50), 5, 0.25);

            _progradeButton = new ProgradeButton(new Point(RenderUtils.ScreenWidth - 160, RenderUtils.ScreenHeight - 105));
            _retrogradeButton = new RetrogradeButton(new Point(RenderUtils.ScreenWidth - 160, RenderUtils.ScreenHeight - 45));

            _gauges = new List<IGauge>
            {
                new NavBall(new Point(RenderUtils.ScreenWidth - 75, RenderUtils.ScreenHeight - 75)),
                _progradeButton,
                _retrogradeButton,
                new ThrustGauge(new Point(RenderUtils.ScreenWidth - 195, RenderUtils.ScreenHeight - 75)),
                new Scale(new Point(75, RenderUtils.ScreenHeight - 25))
            };
        }
Esempio n. 4
0
 public void LoadEventManager(EventManager eventManager)
 {
     EventManager = eventManager;
 }
Esempio n. 5
0
        public void InitializeController(EventManager eventManager)
        {
            string commandPath = Path.Combine(CraftDirectory, CommandFileName);

            if (File.Exists(commandPath))
            {
                List<CommandBase> commands = CommandManager.Load(commandPath);

                Controller = new CommandController(commands, this, eventManager);
            }
            else
            {
                Controller = new SimpleFlightController(this);
            }
        }