Exemple #1
0
    void FindFarm()
    {
        int builtFarms = kingScript.builtFarmingPlatforms.Count;

        if (builtFarms > 0)
        {
            destinationPlatformScript = kingScript.FindPlatformWithLowestPopulation(kingScript.builtFarmingPlatforms, kingScript.platformPeasant);
            kingScript.AddNPCToPopulation(destinationPlatformScript, kingScript.platformPeasant);
            active = true;
            GoToWorkPlatformPeasant();
        }
        else
        {
            waitingForFarmingPlatform = true;            // this is used when a farm is built, then can call this particular NPC to go farming
            // TODO: be careful here, if there's a platform with some resource as well as a farm, peasants may change occupation adn never have the opportunity to become a farmer again
            StartCoroutine(ChangePeasantOccupation());
        }
    }