protected override void Initialize() { // Must be initialized. required by Content loading and rendering (will add itself to the Services) // note that MonoGame requires this to be initialized in the constructor, while WpfInterop requires it to // be called inside Initialize (before base.Initialize()) _graphicsDeviceManager = new WpfGraphicsDeviceService(this); _spriteBatch = new SpriteBatch(_graphicsDeviceManager.GraphicsDevice); _graphicsDeviceManager.GraphicsDevice.PresentationParameters.BackBufferWidth = 758; _graphicsDeviceManager.GraphicsDevice.PresentationParameters.BackBufferHeight = 729; // Must be called after the WpfGraphicsDeviceService instance was created base.Initialize(); GameInitialized?.Invoke(this, EventArgs.Empty); _baseSceneRenderTarget = new RenderTarget2D( GraphicsDevice, GraphicsDevice.PresentationParameters.BackBufferWidth, GraphicsDevice.PresentationParameters.BackBufferHeight); _normalMapRenderTarget = new RenderTarget2D( GraphicsDevice, GraphicsDevice.PresentationParameters.BackBufferWidth, GraphicsDevice.PresentationParameters.BackBufferHeight); _worldMatrix = Matrix.CreateTranslation(new Vector3(-new Vector2(0, 0), 0.0f)); _mouse = new WpfMouse(this); }
private void DestroyLoader() { GameInitialized.RemoveAllListeners(); ServiceLocatorInitialized.RemoveAllListeners(); Debug.Log("GameLoader was destroyed."); Destroy(gameObject); }
private void Awake() { Debug.Log("Game loader instantiated."); GameInitialized.AddListener(OnGameInitialized); ServiceLocatorInitialized.AddListener(OnServiceLocatorInitialized); ServiceLocator.InitializeServiceLocator(); }
protected override void Initialize() { // Must be initialized. required by Content loading and rendering (will add itself to the Services) // note that MonoGame requires this to be initialized in the constructor, while WpfInterop requires it to // be called inside Initialize (before base.Initialize()) _graphicsDeviceManager = new WpfGraphicsDeviceService(this); _spriteBatch = new SpriteBatch(_graphicsDeviceManager.GraphicsDevice); // Must be called after the WpfGraphicsDeviceService instance was created base.Initialize(); GameInitialized?.Invoke(this, EventArgs.Empty); }
private void StartInitializeGame() { GetController <PlayerController>().InitializePlayer(); if (_matchManager.MatchType == Enumerators.MatchType.LOCAL) { GetController <AIController>().InitializePlayer(); } GetController <SkillsController>().InitializeSkills(); GetController <BattlegroundController>().InitializeBattleground(); if (IsTutorial) { IsSpecificGameplayBattleground = true; CurrentTurnPlayer = _tutorialManager.CurrentTutorial.PlayerTurnFirst ? CurrentPlayer : OpponentPlayer; GetController <PlayerController>().SetHand(); GetController <CardsController>().StartCardDistribution(); } else { IsSpecificGameplayBattleground = false; CurrentTurnPlayer = Random.Range(0, 100) > 50 ? CurrentPlayer : OpponentPlayer; OpponentPlayer.SetFirstHand(false); _uiManager.DrawPopup <PlayerOrderPopup>(new object[] { CurrentPlayer.SelfHero, OpponentPlayer.SelfHero }); } IsGameEnded = false; GameInitialized?.Invoke(); }
public static void InvokeGameInitialized() { GameInitialized?.Invoke(); }
public virtual void TriggerGameInitialized() { GameInitialized?.SafeInvoke(this, EventArgs.Empty); }
internal static void RaiseGameInitialized() { GameInitialized?.Invoke(null, EventArgs.Empty); }
private void Start() { GameInitialized.Invoke(); }