예제 #1
0
파일: JobManager.cs 프로젝트: naaturaz/SM
    /// <summary>
    /// Will look for specific School or Work depending Age
    /// </summary>
    /// <param name="person"></param>
    /// <returns></returns>
    private string DecideBasedOnAge(Person person)
    {
        startSchool = ModController.AgeKidStartSchool();
        startTrade  = ModController.AgeKidStartTradeSchool();

        if (person.Age >= ModController.AgeMajorityReached())
        {
            //find work
            return(DefineClosestBuild(person));
        }
        else if (person.Age < ModController.AgeMajorityReached() && person.Age >= startTrade)
        {
            //try find trade
            var res = FindBestSchool(H.TradesSchool, person);
            //if cant find, try find school
            if (res == "")
            {
                res = FindBestSchool(H.School, person);
            }
            return(res);
        }
        else if (person.Age < startTrade && person.Age >= startSchool)
        {
            //try find school
            return(FindBestSchool(H.School, person));
        }
        return("");
    }
예제 #2
0
 static public bool IsMajor(int currAge)
 {
     if (currAge >= ModController.AgeMajorityReached())
     {
         return(true);
     }
     return(false);
 }
예제 #3
0
    private void Map()
    {
        if (Program.InputMain == null)
        {
            return;
        }

        if (!Program.InputMain.IsGameFullyLoaded() || !Program.GameFullyLoaded())
        {
            return;
        }

        mappedOnce = true;

        if (name == "Version")
        {
            thisText.text = GameScene.VersionLoaded();
            //mappedOnce = true;
        }

        if (name == "CurrSpeed")
        {
            thisText.text = Program.gameScene.GameSpeed + "x";
        }
        else if (name == "Person")
        {
            adult = PersonPot.Control.All.Count(a => a.Age >= ModController.AgeMajorityReached());
            var all = PersonPot.Control.All.Count;

            thisText.text = all + "/" + adult + "/" + (all - adult);
        }
        else if (name == "Emigrate")
        {
            thisText.text = PersonPot.Control.EmigrateController1.Emigrates.Count + "";
        }
        else if (name == "Food")
        {
            var amt = GameController.ResumenInventory1.ReturnAmountOnCategory(PCat.Food);

            thisText.text = Unit.WeightConverted(amt).ToString("N0") + " " +
                            Unit.WeightUnit();
        }
        else if (name == "Happy")
        {
            thisText.text = PersonPot.Control.OverAllHappiness();
        }
        else if (name == "PortReputation")
        {
            thisText.text = BuildingPot.Control.DockManager1.PortReputation.ToString("F0");
        }
        else if (name == "PirateThreat")
        {
            if (!Program.IsPirate)
            {
                thisText.text = "-";
                return;
            }

            thisText.text = BuildingPot.Control.DockManager1.PirateThreat.ToString("F0");
        }
        else if (name == "Dollars")
        {
            thisText.text = DollarFormat(Program.gameScene.GameController1.Dollars);
        }
        else if (name == "Temp")
        {
            thisText.text = Tempeture.Current().ToString("n0");
        }
        else if (name == "Town")
        {
            thisText.text = Program.MyScreen1.TownName;
        }
    }
예제 #4
0
 public static int Lazy()
 {
     return(PersonPot.Control.All.Count(a => a.Age >= ModController.AgeMajorityReached())
            - BuildingPot.Control.Registro.MaxPositions());
 }