Esempio n. 1
0
            public override void CheckConditions()
            {
                var farms = colony.GetBuildings <Farm>();

                if (farms != null && farms.Count > 0)
                {
                    scenarioQuest.SetStepCompleteness(0, true);
                    int maxWorkers = 0;
                    foreach (var f in farms)
                    {
                        if (f.workersCount > maxWorkers)
                        {
                            maxWorkers = f.workersCount;
                        }
                    }
                    scenarioQuest.ChangeAddInfo(1, maxWorkers.ToString() + " / " + WORKERS_COUNT.ToString());
                    if (maxWorkers >= WORKERS_COUNT)
                    {
                        scenarioQuest.SetStepCompleteness(1, true);
                        EndScenario();
                        return;
                    }
                    else
                    {
                        scenarioQuest.SetStepCompleteness(1, false);
                    }
                }
                else
                {
                    scenarioQuest.SetStepCompleteness(0, false);
                    scenarioQuest.SetStepCompleteness(1, false);
                    scenarioQuest.ChangeAddInfo(1, string.Empty);
                }
            }