예제 #1
0
 public GameController()
 {
     this.view = new CellsCanvas(this);
     this.view.Show();
     this.displayController  =   NinjectGlobalKernel.GlobalKernel.Get<IDisplayController>();
     this.world              =   NinjectGlobalKernel.GlobalKernel.Get<IWorld>();
 }
예제 #2
0
 /// <summary>
 /// Constructs an instance of MainWindowController with handles to its view and the controllers
 /// </summary>
 /// <param name="mainWindow">Handle to the MainWindow which is the view for this controller</param>
 /// <param name="displayController">Handle to the controller for the displays that are hosted by the MainWindow</param>
 /// <param name="designController">Handle to the controller for the designs that are viewed by the MainWindow</param>
 public MainWindowController(IMainWindow mainWindow, IDisplayController displayController, IDesignController designController)
 {
     MainWindow = mainWindow;
     MainWindow.AttachMainWindowController(this);
     DisplayController = displayController;
     DesignController  = designController;
 }
예제 #3
0
 public BottomBarModel()
 {
     _displayController = ClassLocator.GetInstance <IDisplayController>();
     Debug.Assert(_displayController != null, "IDisplayController not found for BottomBarModel");
     UserMessage = "Initializing...";
     MessageType = MessageTypeEnum.Information;
 }
예제 #4
0
파일: World.cs 프로젝트: Timothep/Cells.net
        /// <summary>
        /// Constructor
        /// </summary>
        public World()
        {
            this.displayController  = NinjectGlobalKernel.GlobalKernel.Get<IDisplayController>();
            this.mapFactory = this.localKernel.Get<IMapFactory>();

            this.masterMap          = new Map(Settings.Default.WorldWidth, Settings.Default.WorldHeight);
            this.cells              = new List<IInternalCell>();
        }
예제 #5
0
 public GameController(IDisplayController displayController,
                       ILoadController loadController)
 {
     this.displayController = displayController;
     this.loadController    = loadController;
     commands  = InputCommand.GetAllCommands();
     scenes    = new Dictionary <string, IScene>();
     gameItens = loadController.LoadGameItens("/Scenes/json/game/items.json");
     Navigator = new Navigator(this);
     Player    = new Player(this, allItens: gameItens);
     MovePlayer("0", null, null);
 }
예제 #6
0
        /// <summary>
        /// Constructor
        /// </summary>
        public CellsCanvas(GameController controller)
        {
            InitializeComponent();

            this.displayController = NinjectGlobalKernel.GlobalKernel.Get<IDisplayController>();

            this.controller = controller;
            this.canvas = DrawBox.CreateGraphics();
            this.canvas.Clear(defaultBackgroundColor);

            PopulateBrains();
            PopulateMaps();
        }
예제 #7
0
    // Start is called before the first frame update
    void Start()
    {
        _videoPlayer = GetComponent <VideoPlayer>();

        display = DisplayController.ForDisplay(0);
        _fullScreen.onValueChanged.AddListener(delegate { FullScreen(); });

        _forward.onClick.AddListener(ForwardVideo);
        _backward.onClick.AddListener(BackwardVideo);

        _play.onValueChanged.AddListener(delegate { PlayPause(); });
        _restart.onClick.AddListener(Restart);

        PlayWebGL();
    }
예제 #8
0
        public MenuModel()
        {
            _displayController = ClassLocator.GetInstance <IDisplayController>();
            Debug.Assert(_displayController != null, "IDisplayController not found for MenuModel");

            MenuButtonCommands = new List <IButtonModel>()
            {
                new MenuButtonModel("Home", (s, a) =>
                {
                    _displayController.RevertDisplay();
                }),
                new MenuButtonModel("About", (s, a) =>
                {
                    _displayController.ChangeDisplay(typeof(IAboutViewModel), DisplayActionTypes.PushPreviousDisplay, true);
                }),
                new MenuButtonModel("Configuraton", (s, a) =>
                {
                    _displayController.ChangeDisplay(typeof(IConfigurationViewModel), DisplayActionTypes.PushPreviousDisplay, true);
                }),
            };
        }
예제 #9
0
        private void TelemetryTestForm_Load(object sender, EventArgs e)
        {
            try
            {
                SetLoadingFormState();

                _displayController = new DisplayController(this);
                _displayController.PropertyChanged      += _displayController_PropertyChanged;
                _displayController.ActiveDisplayChanged += _displayController_ActiveDisplayChanged;
                _displayController.DisplayAdded         += _displayController_DisplayAdded;
                _displayController.DisplayRemoved       += _displayController_DisplayRemoved;

                ClearSession();

                SetReadyFormState();
            }
            catch (Exception ex)
            {
                ExceptionHandler(ex);
            }
        }
예제 #10
0
        public async void Initialize()
        {
            ClassLocator.Register <IDisplayController>(() => new DisplayController());
            ClassLocator.Register <IBottomBarModel>(() => new BottomBarModel());
            _displayController = ClassLocator.GetInstance <IDisplayController>();
            _bottomBarModel    = ClassLocator.GetInstance <IBottomBarModel>();
            Debug.Assert(_displayController != null, "IDisplayController not found for BackEndSimulator");
            Debug.Assert(_bottomBarModel != null, "IBottomBarModel not found for BackEndSimulator");

            ClassLocator.Register <IMenuModel>(() => new MenuModel());
            ClassLocator.Register <IAboutModel>(() => new AboutModel());
            ClassLocator.Register <IConfigurationModel>(() => new ConfigurationModel());

            Initialized?.Invoke(this, new InitializedEventArgs());

            await Task.Run(() =>
            {
                Thread.Sleep(10000);
                _bottomBarModel.UpdateUserMessage("10 seconds have passed", MessageTypeEnum.Warning);
                // _displayController.ChangeDisplay(typeof(IAboutViewModel), true);
            });
        }
예제 #11
0
        public MainViewModel()
        {
            PrimaryViewModel = new SplashScreenViewModel {
                DisposeOfAfterUse = true
            };

            if (this.IsInDesignMode)
            {
                _bottomBarModel    = new BottomBarModelSimulator();
                _displayController = new DisplayControllerSimulator();
            }
            else
            {
                _displayController = ClassLocator.GetInstance <IDisplayController>();
                Debug.Assert(_displayController != null, nameof(IDisplayController) + " not found for " + GetType().Name);
                _displayController.ChangeDisplayEvent += DisplayChangeEventHandler;
                _bottomBarModel = ClassLocator.GetInstance <IBottomBarModel>();
                Debug.Assert(_bottomBarModel != null, nameof(IBottomBarModel) + " not found for " + GetType().Name);
                _bottomBarModel.UpdateEvent += UpdateUserMessageEventHandler;
            }
            UserMessage = _bottomBarModel.UserMessage;
            MessageType = _bottomBarModel.MessageType;
        }
예제 #12
0
 /// <summary>
 /// Saves the handle to the controller for this display
 /// </summary>
 /// <param name="controller">The handle to the controller to save</param>
 public void AttachController(IDisplayController controller)
 {
     Controller = controller;
 }
예제 #13
0
 public AboutModel()
 {
     _displayController = ClassLocator.GetInstance <IDisplayController>();
     Debug.Assert(_displayController != null, "IDisplayController not found for AboutModel");
 }