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; }
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>(); }
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"); } }
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); }
public MainViewModel(IDataService dataService, IGameApp app, IGamePayload payload) { _dataService = dataService; _app = app; _payload = payload; }
public GameController(ICacheInfra cache, IGameApp gameApp) { _cache = cache; _gameApp = gameApp; }