예제 #1
0
        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);
        }
예제 #2
0
 private void DestroyLoader()
 {
     GameInitialized.RemoveAllListeners();
     ServiceLocatorInitialized.RemoveAllListeners();
     Debug.Log("GameLoader was destroyed.");
     Destroy(gameObject);
 }
예제 #3
0
    private void Awake()
    {
        Debug.Log("Game loader instantiated.");
        GameInitialized.AddListener(OnGameInitialized);
        ServiceLocatorInitialized.AddListener(OnServiceLocatorInitialized);

        ServiceLocator.InitializeServiceLocator();
    }
예제 #4
0
        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);
        }
예제 #5
0
        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();
        }
예제 #6
0
 public static void InvokeGameInitialized()
 {
     GameInitialized?.Invoke();
 }
예제 #7
0
 public virtual void TriggerGameInitialized()
 {
     GameInitialized?.SafeInvoke(this, EventArgs.Empty);
 }
예제 #8
0
 internal static void RaiseGameInitialized()
 {
     GameInitialized?.Invoke(null, EventArgs.Empty);
 }
예제 #9
0
 private void Start()
 {
     GameInitialized.Invoke();
 }