/*
         *
         *  Si Hay Internet
         *      Si existen datos
         *          Si existen actualizaciones
         *              descargar y grabar trivial
         *          Fin si
         *      Si no existen
         *           descargar y grabar trivial
         *  Si no Hay internet
         *      si no existen datos
         *          Ir a Error (Se necesita internet para descargar la base de datos la 1ªvez)
         *      Fin_Si
         *  Fin-Sino
         *
         *  Ir a la pantalla de inicio
         */

        public MainPage()
        {
            this.InitializeComponent();
            SQLiteManejadora miMane = new SQLiteManejadora();

            MainUtilities misUtilidades = new MainUtilities(cuandoAcabe);

            misUtilidades.checkActualizacion();
        }
Exemple #2
0
        public override void PostGameStart()
        {
            var knownFactions = Find.Scenario.AllParts.OfType <ScenPart_KnownFactions>().First();

            var friendly = knownFactions.factionsFriendly;
            var hostile  = knownFactions.factionsHostile;
            var total    = friendly + hostile;

            var existingHostile  = MainUtilities.AllFactionsVisible.Count(f => f.HostileTo(Faction.OfPlayer) && !f.IsPlayer);
            var existingFriendly = MainUtilities.AllFactionsVisible.Count(f => !f.HostileTo(Faction.OfPlayer) && !f.IsPlayer);

            friendly -= existingFriendly;
            hostile  -= existingHostile;

            // Now add factions according to minimum
            while (friendly > 0)
            {
                MainUtilities.CreateFaction(FactionRelationKind.Neutral, f => f.startingGoodwill.TrueMax >= 0, true);
                //Log.Message("Added friendly initial faction.");
                friendly--;
            }
            while (hostile > 0)
            {
                var cheap = !MainUtilities.AllFactions.Any(f => f.def.IsCheapAndHumanlike()); // Make sure there is at least 1 cheap faction
                MainUtilities.CreateFaction(FactionRelationKind.Hostile, f => f.startingGoodwill.TrueMin < -40 && (!cheap || f.IsCheapAndHumanlike()), true);
                //Log.Message("Added hostile initial faction.");
                hostile--;
            }


            bool instaDrop = Find.GameInitData.QuickStarted || Dropped;

            if (instaDrop)
            {
                Find.LetterStack.ReceiveLetter("discoverAtDropLabel".Translate(), "discoverAtDropText".Translate(total), LetterDefOf.PositiveEvent);
            }
            else
            {
                Find.LetterStack.ReceiveLetter("discoverAtStartLabel".Translate(), "discoverAtStartText".Translate(total), LetterDefOf.PositiveEvent);
            }
        }