private void Awake() { I = this; Ui = new UiManager(); MapMan = new MapManager(); GameData = new GameData(); Nations = new Nations(); Units = new Units(); Items = new Items(); Nations.ParseData(); Units.ParseData(); Items.ParseData(); Ui.Get <MainMenu>().Show(); // if (HasDefaultPretenders()) // { // MapMan.LoadMap(); // } else // { // Ui.Get<IntroMenu>().Show(); // } // // var maMonsters = new Monsters(); }
public void Fight() { var winning = this.Nations.OrderByDescending(a => a.TotalPower()).First(); foreach (var nation in Nations.Where(n => n.Name != winning.Name)) { nation.Benders.Clear(); nation.Monuments.Clear(); } }
/// <summary> /// A ship object /// </summary> /// <param name="img">Related Panzerschiffer image</param> /// <param name="tier">Tier of the ship (1 - 10)</param> /// <param name="cls">Class of the ship</param> /// <param name="premium">Is it a premium</param> public Ship(string id, string name, string imgName, int tier, Nations nation, Classes cls, Status status) { this.ID = id; this.Name = name; this.ImageName = imgName; this.Tier = tier; this.Nation = nation.ToString(); this.ShipClass = cls.ToString(); this.ShipStatus = status.ToString(); }
/// <summary> /// A ship object /// </summary> /// <param name="img">Related Panzerschiffer image</param> /// <param name="tier">Tier of the ship (1 - 10)</param> /// <param name="shipClass">Class of the ship</param> /// <param name="shipStatus">Premium status</param> public Ship(string id, string name, string imageName, int tier, Nations nation, Classes shipClass, Status shipStatus) { this.ID = id; this.Name = name; this.Image = GetImage(imageName + ".png"); this.Tier = tier; this.Nation = nation; this.ShipClass = shipClass; this.ShipStatus = shipStatus; }
public IHttpActionResult GetNations(int id) { Nations nations = db.Nations.Find(id); if (nations == null) { return(NotFound()); } return(Ok(nations)); }
private void corPersonEmailValue_TextChanged(object sender, EventArgs e) { Nations n = new Nations(); if (n.isEmail(corPersonEmailValue.Text)) { corPersonEmailKey.BorderStyle = BorderStyle.None; corPersonEmailValue.ForeColor = Color.Black; } else { corPersonEmailKey.BorderStyle = BorderStyle.FixedSingle; corPersonEmailValue.ForeColor = Color.Red; } }
public void AddNation(string name) { try { Database.Nation temp = new Database.Nation(name); Nations.Add(temp); eventkalenderDAL.AddNation(temp); //NotifyPropertyChanged("Nations"); } catch (Exception ex) { Status = ExceptionHandler.GetErrorMessage(ex); } }
public void getAllNations() { using (SQLiteConnection conn = new SQLiteConnection(@"Data Source=.\" + GlobalAtributes.DatabaseName + ".cem;")) { conn.Open(); SQLiteCommand command = new SQLiteCommand("select * from v_nation;", conn); SQLiteDataReader reader = command.ExecuteReader(); while (reader.Read()) { Nations.Add(new ONation(reader.GetInt32(0), reader.GetString(1))); } reader.Close(); } }
/// <summary> /// Instanziiert eine Simulation /// </summary> public Simulation(int[] simValues) { fieldLength = simValues[0]; baseXPos = simValues[1]; baseYPos = simValues[2]; simField = new int[fieldLength, fieldLength]; int[] tainsAntsCapabilities = new int[] { 4, 150, 8, 50 }; //HACK Species.Add(new Species("Tains Ants", tainsAntsCapabilities)); Nations.Add(new Nation("First Nation", Species.Find(x => x.Name == "Tains Ants"), baseXPos, baseYPos)); Nations.Add(new Nation("Second Nation", Species.Find(x => x.Name == "Tains Ants"), baseXPos + 10, baseYPos + 10)); // Protokollausgabe der erzeugten Arten string speciesText = null; foreach (Species currentSpecies in Species) { speciesText = speciesText + $"{currentSpecies.SpeciesId}. {currentSpecies.Name}; "; } message = $"Species: {Species.Count}: {speciesText}" + System.Environment.NewLine; // Protokollausgabe der erzeugten Völker string nationsText = null; foreach (Nation currentNation in Nations) { nationsText = nationsText + $"{currentNation.NationId}. {currentNation.Name}; "; } message = message + $"Nations: {Nations.Count}: {nationsText}" + System.Environment.NewLine; // Protokollausgabe der erzeugten Objekte string simObjectText = null; foreach (SimObject currentObject in SimObjects) { simObjectText = simObjectText + $"{currentObject.SimObjectId}. {currentObject.Type}, {currentObject.ObjectXPos}, {currentObject.ObjectYPos}; "; } message = message + $"Bases: {SimObjects.Count}: {simObjectText}" + System.Environment.NewLine; using (StreamWriter InitialProtocol = new StreamWriter("simProtocol.txt")) { InitialProtocol.Write(message); } }
public void DeleteNation(int id) { try { Database.Nation temp = new Database.Nation(); temp.Id = id; Nations.Remove(Nations.FirstOrDefault(n => n.Id == temp.Id)); eventkalenderDAL.DeleteNation(temp); Events = new ObservableCollection <Database.Event>(eventkalenderDAL.GetEvents()); //NotifyPropertyChanged("Nations"); } catch (Exception ex) { Status = ExceptionHandler.GetErrorMessage(ex); } }
public IHttpActionResult GetNationPlayers(int id) { Nations nation = db.Nations.Find(id); var resultado = nation.Players .Select(players => new { players.ID, players.Name, players.Position, players.Image, players.Introduction }) .ToList(); return(Ok(resultado)); }
protected string GetFlagName(string nation) { var shortNation = GetShortSurnameInt(nation); if (Nations.ContainsKey(nation)) { return(Nations[nation].Item1); } else if (Nations.ContainsKey(shortNation)) { return(Nations[shortNation].Item1); } else { OutputStream.AppendLine($"Bandiera non trovata: {nation}"); } return(nation.Substring(0, 3)); }
protected string GetSurnameInt(string nation, bool isTeam) { var shortNation = GetShortSurnameInt(nation); if (Nations.ContainsKey(nation) && isTeam) { return(Nations[nation].Item2.ToUpper()); } else if (Nations.ContainsKey(shortNation) && isTeam) { return(Nations[shortNation].Item2.ToUpper()); } else if (isTeam) { OutputStream.AppendLine($"Surname - Nazione ({nation}) non trovata - Short ({shortNation})"); } return(shortNation); }
protected string GetTeamNameInt(string nation) { var shortNation = GetShortSurnameInt(nation); if (Nations.ContainsKey(nation)) { return(Nations[nation].Item2.ToUpper()); } else if (Nations.ContainsKey(shortNation)) { return(Nations[shortNation].Item2.ToUpper()); } else { OutputStream.AppendLine($"Team - Nazione ({nation}) non trovata - Short ({nation})"); } return(string.Empty); }
private void SetNationEntries() { ObservableCollection <Nation> entries = new ObservableCollection <Nation>(); if (ReferencedGame != null) { if (Nations == null) { foreach (Nation nat in ReferencedGame.Nations.Values.ToList()) { entries.Add(nat); } Nations = entries; } else { List <Nation> currentNationList = ReferencedGame.Nations.Values.ToList(); ObservableCollection <Nation> currentEntries = new ObservableCollection <Nation>(Nations); foreach (Nation entry in currentEntries) { if (currentNationList.FirstOrDefault(nat => nat == entry) == null) { Nations.Remove(entry); } } foreach (Nation nat in currentNationList) { if (Nations.FirstOrDefault(e => e == nat) == null) { Nations.Add(nat); } } } if (SelectedDisplayEntry == null) { SelectedDisplayEntry = MapEntries.First(); } } }
public void AddEvent(string name, string summary, DateTime startTime, DateTime endTime, int nationId) { try { Database.Event e = new Database.Event(name, summary, startTime, endTime, nationId); Events.Add(e); Database.Nation n1 = Nations.First(temp => temp.Id == nationId); n1.Events.Add(e); eventkalenderDAL.AddEvent(e); NotifyPropertyChanged("Nations"); } catch (Exception ex) { Status = ExceptionHandler.GetErrorMessage(ex); } }
public Army(Nations nation, LocationName loc) { Type = UnitType.Army; LocName = loc; Nation = nation; }
public Fleet(Nations nation, LocationName loc) { Type = UnitType.Fleet; LocName = loc; Nation = nation; }