コード例 #1
0
        private void LoadListPlanesAndShips()
        {
            var planes = PlaneCollection.GetPlanes();
            var ships  = ShipCollection.GetShips();

            planes.AddRange(ships);
            vehicles = planes;
        }
コード例 #2
0
ファイル: Player.cs プロジェクト: NevermoreDCE/Dalek
 public Player(SerializationInfo info, StreamingContext context)
 {
     this._name = (string)info.GetValue("Name", typeof(string));
     this._empireName = (string)info.GetValue("EmpireName", typeof(string));
     this._iconSet = (string)info.GetValue("IconSet", typeof(string));
     this.Ships = (ShipCollection)info.GetValue("Ships", typeof(ShipCollection));
     this.IsTurnComplete = (bool)info.GetValue("IsTurnComplete", typeof(bool));
     initIcon();
 }
コード例 #3
0
        private List <Ship> ShipSelector(int selectedNation, int selectedRank)
        {
            this.selectedNation = selectedNation;
            this.selectedRank   = selectedRank;
            List <Ship> shipsAll = ShipCollection.GetShip();
            var         shipvar  = from s in shipsAll
                                   where s.NationId == selectedNation
                                   where s.RankId == selectedRank
                                   select s;

            return(shipvar.ToList <Ship>());
        }
コード例 #4
0
ファイル: Player.cs プロジェクト: NevermoreDCE/Dalek
        public Player(string Name, string EmpireName, string IconSet, bool IsAI, int Aggressiveness)
        {
            this._name = Name;
            this._empireName = EmpireName;
            this._iconSet = IconSet;
            this._isAI = IsAI;
            this._aggressiveness = Aggressiveness;
            this.Ships = new ShipCollection();
            this.IsTurnComplete = false;

            initIcon();
        }
コード例 #5
0
ファイル: GameRoot.cs プロジェクト: lgallucci/LouGames
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            Art.Load(Content);

            // TODO: use this.Content to load your game content here
            ship        = new Ship(Art.Ship, ScaleToHighDPI(shipSize), ScaleToHighDPI(shipSize));
            ship.Height = 125; ship.Width = 100;

            swarm      = new ShipCollection(Art.Swarm, ScaleToHighDPI(swarmSize), ScaleToHighDPI(swarmSize));
            starsFront = new RollingSprite(Art.StarsFront, ScaleToHighDPI(1.1f), ScaleToHighDPI(1f), screenWidth, screenHeight);
            starsBack  = new RollingSprite(Art.StarsBack, ScaleToHighDPI(1.1f), ScaleToHighDPI(1f), screenWidth, screenHeight);
            lives      = new LivesPanel(Art.Ship, ScaleToHighDPI(.4f), ScaleToHighDPI(.4f));
        }
コード例 #6
0
ファイル: StarShooter.cs プロジェクト: lgallucci/LouGames
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // TODO: use this.Content to load your game content here
            ship        = new Ship(Content.Load <Texture2D>("ship"), Content.Load <Texture2D>("lazer"), Content.Load <Texture2D>("swarm_explode"), ScaleToHighDPI(shipSize), ScaleToHighDPI(shipSize));
            ship.Height = 125; ship.Width = 100;

            swarm           = new ShipCollection(Content.Load <Texture2D>("swarm"), Content.Load <Texture2D>("lazer"), Content.Load <Texture2D>("swarm_explode"), ScaleToHighDPI(swarmSize), ScaleToHighDPI(swarmSize));
            starsFront      = new RollingSprite(Content.Load <Texture2D>("starsFront"), ScaleToHighDPI(1.1f), ScaleToHighDPI(1f), screenWidth, screenHeight);
            starsBack       = new RollingSprite(Content.Load <Texture2D>("starsBack"), ScaleToHighDPI(1.1f), ScaleToHighDPI(1f), screenWidth, screenHeight);
            lives           = new LivesPanel(Content.Load <Texture2D>("ship"), ScaleToHighDPI(.4f), ScaleToHighDPI(.4f));
            scoreFont       = Content.Load <SpriteFont>("Score");
            stateFont       = Content.Load <SpriteFont>("GameState");
            stateFontMedium = Content.Load <SpriteFont>("GameStateMedium");
            gameOverTexture = Content.Load <Texture2D>("game-over");
        }
コード例 #7
0
        private void _InfoSpinnerRank_ItemSelected(object sender, AdapterView.ItemSelectedEventArgs e)
        {
            selectedRank = ranks[e.Position].Id;

            if (selectedNation == 100 && selectedRank == 100)
            {
                ships       = ShipCollection.GetShip();
                AdapterShip = new ShipAdapter(this, ships);
                _InfoSpinnerShip.Adapter = AdapterShip;
            }
            else
            if (selectedNation == 100)
            {
                List <Ship> shipsAll = ShipCollection.GetShip();
                var         shipvar  = from s in shipsAll
                                       where s.RankId == selectedRank
                                       select s;
                ships       = shipvar.ToList <Ship>();
                AdapterShip = new ShipAdapter(this, ships);
                _InfoSpinnerShip.Adapter = AdapterShip;
            }
            else
            if (selectedRank == 100)
            {
                List <Ship> shipsAll = ShipCollection.GetShip();
                var         shipvar  = from s in shipsAll
                                       where s.NationId == selectedNation
                                       select s;
                ships       = shipvar.ToList <Ship>();
                AdapterShip = new ShipAdapter(this, ships);
                _InfoSpinnerShip.Adapter = AdapterShip;
            }
            else
            {
                ships       = ShipSelector(selectedNation, selectedRank);
                AdapterShip = new ShipAdapter(this, ships);
                _InfoSpinnerShip.Adapter = AdapterShip;
            }
        }
コード例 #8
0
 private void ListShower()
 {
     if (selectedNation == 100 && selectedRank == 100)
     {
         shipsToListView          = ShipCollection.GetShip();
         TheBestlistView          = new ListViewTheBestShipAdapter(this, shipsToListView);
         _TheBestListView.Adapter = TheBestlistView;
     }
     else
     if (selectedNation == 100)
     {
         List <Ship> shipsAll = ShipCollection.GetShip();
         var         shipvar  = from s in shipsAll
                                where s.RankId == selectedRank
                                select s;
         shipsToListView          = shipvar.ToList <Ship>();
         TheBestlistView          = new ListViewTheBestShipAdapter(this, shipsToListView);
         _TheBestListView.Adapter = TheBestlistView;
     }
     else
     if (selectedRank == 100)
     {
         List <Ship> shipsAll = ShipCollection.GetShip();
         var         shipvar  = from s in shipsAll
                                where s.NationId == selectedNation
                                select s;
         shipsToListView          = shipvar.ToList <Ship>();
         TheBestlistView          = new ListViewTheBestShipAdapter(this, shipsToListView);
         _TheBestListView.Adapter = TheBestlistView;
     }
     else
     {
         shipsToListView          = ShipSelector(selectedNation, selectedRank);
         TheBestlistView          = new ListViewTheBestShipAdapter(this, shipsToListView);
         _TheBestListView.Adapter = TheBestlistView;
     }
 }
コード例 #9
0
        private void TaskSelector()
        {
            if (SelectedPotentialTaskShip == 1)
            {
                List <Ship> shipsAll = ShipCollection.GetShip();
                double      step     = 1.0;
                var         shipvar  = from s in shipsAll
                                       where s.BR <= selectedShipBR + step && s.BR >= selectedShipBR - step && s.NationId != selectedNation
                                       orderby s.MainCaliberSize descending
                                       select s;
                shipspotential        = shipvar.ToList <Ship>();
                AdapterListView       = new ListViewInfoShipAdapter(this, shipspotential);
                _InfoListView.Adapter = AdapterListView;
            }

            if (SelectedPotentialTaskShip == 2)
            {
                List <Ship> shipsAll = ShipCollection.GetShip();
                double      step     = 1.0;
                var         shipvar  = from s in shipsAll
                                       where s.BR <= selectedShipBR + step && s.BR >= selectedShipBR - step && s.NationId != selectedNation
                                       orderby s.MainCaliberItem descending
                                       select s;
                shipspotential        = shipvar.ToList <Ship>();
                AdapterListView       = new ListViewInfoShipAdapter(this, shipspotential);
                _InfoListView.Adapter = AdapterListView;
            }

            if (SelectedPotentialTaskShip == 3)
            {
                List <Ship> shipsAll = ShipCollection.GetShip();
                double      step     = 1.0;
                var         shipvar  = from s in shipsAll
                                       where s.BR <= selectedShipBR + step && s.BR >= selectedShipBR - step && s.NationId != selectedNation
                                       orderby s.MainCaliberTNT descending
                                       select s;
                shipspotential        = shipvar.ToList <Ship>();
                AdapterListView       = new ListViewInfoShipAdapter(this, shipspotential);
                _InfoListView.Adapter = AdapterListView;
            }

            if (SelectedPotentialTaskShip == 4)
            {
                List <Ship> shipsAll = ShipCollection.GetShip();
                double      step     = 1.0;
                var         shipvar  = from s in shipsAll
                                       where s.BR <= selectedShipBR + step && s.BR >= selectedShipBR - step && s.NationId != selectedNation
                                       orderby s.MaxSpeed descending
                                       select s;
                shipspotential        = shipvar.ToList <Ship>();
                AdapterListView       = new ListViewInfoShipAdapter(this, shipspotential);
                _InfoListView.Adapter = AdapterListView;
            }

            if (SelectedPotentialTaskShip == 5)
            {
                List <Ship> shipsAll = ShipCollection.GetShip();
                double      step     = 1.0;
                var         shipvar  = from s in shipsAll
                                       where s.BR <= selectedShipBR + step && s.BR >= selectedShipBR - step && s.NationId != selectedNation
                                       orderby s.TorpedoItem descending
                                       select s;
                shipspotential        = shipvar.ToList <Ship>();
                AdapterListView       = new ListViewInfoShipAdapter(this, shipspotential);
                _InfoListView.Adapter = AdapterListView;
            }

            if (SelectedPotentialTaskShip == 6)
            {
                List <Ship> shipsAll = ShipCollection.GetShip();
                double      step     = 1.0;
                var         shipvar  = from s in shipsAll
                                       where s.BR <= selectedShipBR + step && s.BR >= selectedShipBR - step && s.NationId != selectedNation
                                       orderby s.TorpedoTNT descending
                                       select s;
                shipspotential        = shipvar.ToList <Ship>();
                AdapterListView       = new ListViewInfoShipAdapter(this, shipspotential);
                _InfoListView.Adapter = AdapterListView;
            }

            if (SelectedPotentialTaskShip == 7)
            {
                List <Ship> shipsAll = ShipCollection.GetShip();
                double      step     = 1.0;
                var         shipvar  = from s in shipsAll
                                       where s.BR <= selectedShipBR + step && s.BR >= selectedShipBR - step && s.NationId != selectedNation
                                       orderby s.Displacement descending
                                       select s;
                shipspotential        = shipvar.ToList <Ship>();
                AdapterListView       = new ListViewInfoShipAdapter(this, shipspotential);
                _InfoListView.Adapter = AdapterListView;
            }
        }