private void LoadListPlanesAndShips() { var planes = PlaneCollection.GetPlanes(); var ships = ShipCollection.GetShips(); planes.AddRange(ships); vehicles = planes; }
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(); }
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>()); }
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(); }
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)); }
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"); }
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; } }
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; } }
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; } }