Пример #1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="game"></param>
        /// <param name="shipColor">The color that the highlights on the ship should be drawn.</param>
        /// <param name="contentName"></param>
        /// <param name="scale"></param>
        /// <param name="color"></param>
        /// <param name="spriteBatch"></param>
        /// <param name="gameObject">The game object that this is a view for.  Must be of type Ship.</param>
        public ShipView(Game game, Color shipOutlineColor, Content content, Color color, SpriteBatch spriteBatch, IShip ship)
            : base(game, content, color, spriteBatch, ship, ZIndexManager.getZIndex(ZIndexManager.drawnItemOrders.shipHull))
        {
            this.shipOutlineColor = shipOutlineColor;
            this.ship = ship;

            ship.ObjectDestroyed += this.ShipSankEventHandler;
            healthBarView = new HealthBarView(base.Game, spriteBatch, ship);
            Game.Components.Add(healthBarView);

            LeftCannonView = new CannonView(Game, Color.White, SpriteBatch, ship.LeftCannons.First());
            RightCannonView = new CannonView(Game, Color.White, SpriteBatch, ship.RightCannons.First());
        }
Пример #2
0
 public TowerView(Game game, Color color, SpriteBatch spriteBatch, Tower tower)
     : base(game, Content.Tower, color, spriteBatch, tower, ZIndexManager.getZIndex(ZIndexManager.drawnItemOrders.tower))
 {
     this.tower = tower;
     this.towerCannonView = new CannonView(game, color, spriteBatch, tower.Cannon);
 }