void Awake()
 {
     app = CreateGameApp();
     app.Awake();
     Application.lowMemory += app.OnMemoryWarnning;
     DontDestroyOnLoad(this);
 }
        public GameAppWrapper(IGameApp original, Int32 Id, String name)
        {
            this.original = original;

            this.original.GameExit += original_GameExit;
            this.Id       = Id;
            this.GameName = name;
        }
Esempio n. 3
0
        public void register(IGameApp game, String GameName)
        {
            GameAppWrapper newGameWrapper = new GameAppWrapper(game, registeredGames, GameName);

            newGameWrapper.LaunchGameCommand = new DelegateCommand(
                param => { LaunchGame(this, (Int32)param); });
            ++registeredGames;
            Games.Add(newGameWrapper);
        }
        public void SetupTests()
        {
            var container = new TinyIoCContainer();

            Resolver.ResetResolver(new TinyResolver(container));

            _app = Substitute.For <IGameApp>();
            container.Register(_app);

            container.Register <IDataService, DataService>();

            container.Register <ILoginViewModel, LoginViewModel>();
            _subject = container.Resolve <ILoginViewModel>();
        }
Esempio n. 5
0
        private void LaunchNewGame(object sender, IGameApp e)
        {
            GameAppWrapper wrap = (GameAppWrapper)e;

            if (this._currentGame == null)
            {
                _window.Hide();
                this._currentGame           = wrap;
                this._currentGame.GameExit += GameExit;
                wrap.Initialize();
                wrap.OpenWindow();
            }
            else
            {
                throw new InvalidOperationException("A game is still running!");
            }
        }
        private void onLoadModule()
        {
            OpenFileDialog dlg = new OpenFileDialog();

            dlg.Filter          = "Module file|.dll";
            dlg.CheckPathExists = true;
            dlg.Multiselect     = false;
            DialogResult dr = dlg.ShowDialog();

            if (dr == DialogResult.OK)
            {
                String   filename = dlg.FileName;
                IGameApp gameApp  = Activator.CreateInstanceFrom(filename, "GameApp").Unwrap() as IGameApp;
                model.register(gameApp, "Egyedi Játék");
                OnPropertyChanged("GameList");
            }
        }
Esempio n. 7
0
        public LoginViewModel(IDataService dataService, IGameApp gameApp)
        {
#if DEBUG
            Username = "******";
            Password = "******";
#endif
            LoginCommand = new Command(o =>
            {
                if (dataService.Login(Username, Password))
                {
                    gameApp.OpenPage(typeof(IMainViewModel));
                }
                else
                {
                    ErrorMessage = "Unable to login user";
                }
            }, CredentialsAreOk);
        }
Esempio n. 8
0
 public MainViewModel(IDataService dataService, IGameApp app, IGamePayload payload)
 {
     _dataService = dataService;
     _app         = app;
     _payload     = payload;
 }
Esempio n. 9
0
 public GameController(ICacheInfra cache, IGameApp gameApp)
 {
     _cache   = cache;
     _gameApp = gameApp;
 }