Esempio n. 1
0
        private void filterIntentions()
        {
            Desire choosenDesire = null;

            foreach (Desire d in desires)
            {
                if (choosenDesire == null)
                {
                    choosenDesire = d;
                    continue;
                }

                if (d.intensity < choosenDesire.intensity)
                {
                    choosenDesire = d;
                }
            }

            if (choosenDesire != null)
            {
                switch (choosenDesire.Type())
                {
                case DesireType.GatherResources:
                    currentIntention = new IncreaseVillageResources();
                    break;

                case DesireType.ExterminateOrcs:
                    currentIntention = new KillOrcs();
                    break;

                case DesireType.BeHealthy:
                    currentIntention = new BecomeHealthy();
                    break;
                }
            }
        }