Esempio n. 1
0
        private void GetResults_Click(object sender, EventArgs e)
        {
            string Error;

            Error = CheckResults();

            if (Error == "")
            {
                if (LHC is null)
                {
                    LHC = new LeyHontCalculator(seats, threshold, census, blanks, invalid);
                    foreach (PoliticalPartieVisualComponent p in PoliticalParties.Where(p => p.Initialized == true))
                    {
                        LHC.AddPoliticalParty(p._PartiName(), p._NumberOfVotes());
                    }
                    LHC.PartiesHaveBeenAdded();
                    LHC.GetResults();

                    form2 = new Form2(LHC);
                }
                // Show the result after having done the calculations.
                if (form2 is null)
                {
                    form2 = new Form2(LHC);
                }

                form2.Show();
            }
            else
            {
                MessageBox.Show(Error);
            }
        }
Esempio n. 2
0
    public static void CreatePoliticalParty()
    {
        PoliticalParties asset = (PoliticalParties)CreateAsset("DoVAlpha/GovernmentsDefault/data/politicals", typeof(PoliticalParties));

        if (asset != null)
        {
            asset.PartyName = "some party";
        }
    }
Esempio n. 3
0
        private void AnadePartido_Click(object sender, EventArgs e)
        {
            PoliticalPartieVisualComponent Partie = new PoliticalPartieVisualComponent(pos);

            PoliticalParties.Add(Partie);
            SetControls();
            pos += line_height;

            if (Height < pos)
            {
                Height += line_height;
                Show();
            }
        }
        public String AddPoliticalParty(string Nombre, long Votes)
        {
            PoliticalParty p = new PoliticalParty();

            if (ResultsRegistered == true)
            {
                return("Parties have been registered, no more parties can be added.");
            }

            p.PartyName     = Nombre;
            p.NumberOfVotes = Votes;

            PoliticalParties.Add(p);

            return("");
        }
Esempio n. 5
0
 private void FinalisePoliticalParties(Vic2World vic2World, IdeologyModifier baseModifier)
 {
     if (Eu4Country?.CountryTag == "Z16")
     {
         Console.WriteLine("Me!");
     }
     foreach (var ideology in vic2World.IdeologyModifiers)
     {
         var polParty      = new PoliticalParty(CountryTag + "_" + Enum.GetName(typeof(Ideology), ideology.Key), ideology.Key, vic2World);
         var totalModifier = baseModifier + ideology.Value;
         foreach (var pol in totalModifier.Policies)
         {
             polParty.SetIssue(pol.Key, pol.Value);
         }
         PoliticalParties.Add(polParty);
         if (ideology.Key == UpperHouse?.GetMode())
         {
             RulingParty = polParty;
         }
     }
 }
Esempio n. 6
0
 public UprisingEvent StartUpRisingEvent(GenericProvince uprisingProvince, PoliticalParties partyToNewUprisingGroup)
 {
     return(new UprisingEvent());
 }