Exemplo n.º 1
0
        public ResourcesLeftView(ContentManager contentManager, ResourcesViewModel resourcesViewModel)
            : base(resourcesViewModel, 170, 377)
        {
            var resourcesLeftImageView = new SpriteView
            {
                PositionX = 0, PositionY = 0, SizeX = 170, SizeY = 377, SourceX = 170, SourceY = 377,
                Texture   = contentManager.Load <Texture2D>("ResourcesLeftImage")
            };

            Items.Add(resourcesLeftImageView);
        }
Exemplo n.º 2
0
        public GameView(ContentManager contentManager, GameViewModel gameViewModel)
            : base(gameViewModel, 1280, 720)
        {
            var gameBorderImageView = new SpriteView
            {
                PositionX = 0, PositionY = 0, SizeX = 1280, SizeY = 720, SourceX = 1280, SourceY = 720,
                Texture   = contentManager.Load <Texture2D>("GameBorderImage")
            };

            var gameBackgroundImageView = new SpriteView
            {
                PositionX = 0, PositionY = 0, SizeX = 1280, SizeY = 720, SourceX = 1280, SourceY = 720,
                Texture   = contentManager.Load <Texture2D>("GameBackgroundImage")
            };

            var resourcesLeftView = new ResourcesLeftView(contentManager, gameViewModel.ResourcesLeft)
            {
                PositionX = 2, PositionY = 9, SizeX = 170, SizeY = 377
            };

            var resourcesRightView = new ResourcesRightView(contentManager, gameViewModel.ResourcesRight)
            {
                PositionX = 1109, PositionY = 9, SizeX = 170, SizeY = 377
            };

            var buildingsLeftView = new BuildingsLeftView(contentManager, gameViewModel.BuildingsLeft)
            {
                PositionX = 121, PositionY = 42, SizeX = 300, SizeY = 488
            };

            var buildingsRightView = new BuildingsRightView(contentManager, gameViewModel.BuildingsRight)
            {
                PositionX = 871, PositionY = 42, SizeX = 300, SizeY = 488
            };

            var cardSetView = new CardSetView(contentManager, gameViewModel.CardSet)
            {
                PositionX = 5, PositionY = 384, SizeX = 1270, SizeY = 315
            };

            Items.Add(gameBackgroundImageView);
            Items.Add(resourcesLeftView);
            Items.Add(resourcesRightView);
            Items.Add(buildingsLeftView);
            Items.Add(buildingsRightView);
            Items.Add(cardSetView);
            Items.Add(gameBorderImageView);
        }
Exemplo n.º 3
0
        public BuildingsLeftView(ContentManager contentManager, BuildingsViewModel buildingsViewModel)
            : base(buildingsViewModel, 300, 488)
        {
            var towerLeftImageView = new SpriteView
            {
                PositionX = 0, PositionY = 224, SizeX = 300, SizeY = 488, SourceX = 300, SourceY = 114,
                Texture   = contentManager.Load <Texture2D>("TowerLeftImage")
            };

            var wallLeftImageView = new SpriteView
            {
                PositionX = 0, PositionY = 321, SizeX = 300, SizeY = 488, SourceX = 300, SourceY = 17,
                Texture   = contentManager.Load <Texture2D>("WallLeftImage")
            };

            Items.Add(towerLeftImageView);
            Items.Add(wallLeftImageView);
        }
Exemplo n.º 4
0
        public CardView(ContentManager contentManager, CardViewModel cardViewModel)
            : base(cardViewModel, 200, 279)
        {
            this.contentManager = contentManager;

            cardBackgroundImageView = new SpriteView
            {
                PositionX = 0, PositionY = 0, SizeX = 200, SizeY = 279, SourceX = 200, SourceY = 279,
                Texture   = contentManager.Load <Texture2D>($"Card{ ViewModel.Resource }BackgroundImage")
            };

            cardImageView = new SpriteView
            {
                PositionX = 20, PositionY = 56, SizeX = 160, SizeY = 108, SourceX = 160, SourceY = 108,
                Texture   = contentManager.Load <Texture2D>($"Card{ ViewModel.Identifier }Image")
            };

            Items.Add(cardBackgroundImageView);
            Items.Add(cardImageView);

            var dragHandlerVisitor = new DragHandlerVisitor(this);

            HandlerVisitors.Add(dragHandlerVisitor);
        }