public override void RegisterNeed(Person person, ActivityVerb actionType, ItemType itemType, PersonVitalType vitalType, decimal priority)
 {
     if (!NeedIsRegistered(person, actionType, itemType, vitalType, 1))
     {
         AddNeed(actionType, itemType, vitalType, 1, priority);
     }
 }
Exemplo n.º 2
0
        public void AddNeed(ActivityVerb actionType, ItemType itemType, PersonVitalType vitalType, decimal quantity, decimal priority)
        {
            if (Settings.IsVerbose)
                Console.WriteDebugLine ("    Registering the need to " + actionType + " " + quantity + " " + itemType + ".");

            Needs.Add (new NeedEntry (actionType, itemType, vitalType, quantity, priority));
        }
        public override void RegisterNeed(Person person, ActivityVerb actionType, ItemType itemType, PersonVitalType vitalType, decimal priority)
        {
            var quantity = 100 - person.Vitals[PersonVitalType.Energy];

            if (!NeedIsRegistered (person, actionType, itemType, vitalType, quantity)) {
                AddNeed (actionType, itemType, vitalType, quantity, priority);
            }
        }
Exemplo n.º 4
0
 public bool HasNeed(ActivityVerb actionType, ItemType needType, PersonVitalType vitalType, decimal quantity)
 {
     return((from n in Needs
             where n.ActionType == actionType &&
             (n.ItemType == needType ||
              n.VitalType == vitalType)
             select n).Count() > 0);
 }
        public override void RegisterNeed(Person person, ActivityVerb actionType, ItemType itemType, PersonVitalType vitalType, decimal priority)
        {
            var quantity = Settings.DefaultDrinkAmount;

            if (!NeedIsRegistered (person, actionType, itemType, vitalType, quantity)) {
                AddNeed (actionType, itemType, vitalType, quantity, priority);
            }
        }
Exemplo n.º 6
0
        public void AddNeed(ActivityVerb actionType, ItemType itemType, PersonVitalType vitalType, decimal quantity, decimal priority)
        {
            if (Settings.IsVerbose)
            {
                Console.WriteDebugLine("    Registering the need to " + actionType + " " + quantity + " " + itemType + ".");
            }

            Needs.Add(new NeedEntry(actionType, itemType, vitalType, quantity, priority));
        }
Exemplo n.º 7
0
        public override void RegisterNeed(Person person, ActivityVerb actionType, ItemType itemType, PersonVitalType vitalType, decimal priority)
        {
            var quantity = 100 - person.Vitals[PersonVitalType.Energy];

            if (!NeedIsRegistered(person, actionType, itemType, vitalType, quantity))
            {
                AddNeed(actionType, itemType, vitalType, quantity, priority);
            }
        }
        public override void RegisterNeed(Person person, ActivityVerb actionType, ItemType needType, PersonVitalType vitalType, decimal priority)
        {
            var quantity = Settings.DefaultEatAmount;

            if (!NeedIsRegistered(person, actionType, needType, vitalType, quantity))
            {
                AddNeed(actionType, needType, vitalType, quantity, priority);
            }
        }
Exemplo n.º 9
0
        public BaseNeedIdentifier(ActivityVerb actionType, ItemType itemType, PersonVitalType vitalType, EngineSettings settings, ConsoleHelper console)
        {
            ActionType = actionType;
            ItemType = itemType;
            VitalType = vitalType;
            Settings = settings;
            Console = console;

            if (vitalType != PersonVitalType.NotSet)
                DefaultPriority = settings.DefaultVitalPriorities [vitalType];
            else if (itemType != ItemType.NotSet)
                DefaultPriority = settings.DefaultItemPriorities [itemType];
        }
Exemplo n.º 10
0
        public NeedEntry(
            ActivityVerb actionType,
            ItemType itemType,
            PersonVitalType vitalType,
			decimal quantity,
			decimal priority
		)
        {
            ActionType = actionType;
            ItemType = itemType;
            VitalType = vitalType;
            Quantity = quantity;
            Priority = priority;
        }
Exemplo n.º 11
0
 public NeedEntry(
     ActivityVerb actionType,
     ItemType itemType,
     PersonVitalType vitalType,
     decimal quantity,
     decimal priority
     )
 {
     ActionType = actionType;
     ItemType   = itemType;
     VitalType  = vitalType;
     Quantity   = quantity;
     Priority   = priority;
 }
Exemplo n.º 12
0
        public BaseNeedIdentifier(ActivityVerb actionType, ItemType itemType, PersonVitalType vitalType, EngineSettings settings, ConsoleHelper console)
        {
            ActionType = actionType;
            ItemType   = itemType;
            VitalType  = vitalType;
            Settings   = settings;
            Console    = console;

            if (vitalType != PersonVitalType.NotSet)
            {
                DefaultPriority = settings.DefaultVitalPriorities [vitalType];
            }
            else if (itemType != ItemType.NotSet)
            {
                DefaultPriority = settings.DefaultItemPriorities [itemType];
            }
        }
Exemplo n.º 13
0
 public ActivityAttribute(ActivityVerb actionType, ItemType itemType, PersonVitalType vitalType)
 {
     Verb = actionType;
     ItemType = itemType;
     VitalType = vitalType;
 }
Exemplo n.º 14
0
 public ActivityAttribute(ActivityVerb verb)
 {
     Verb = verb;
 }
 public override void RegisterNeed(Person person, ActivityVerb actionType, ItemType itemType, PersonVitalType vitalType, decimal priority)
 {
     if (!NeedIsRegistered (person, actionType, itemType, vitalType, 1)) {
         AddNeed (actionType, itemType, vitalType, 1, priority);
     }
 }
Exemplo n.º 16
0
 public virtual bool NeedIsRegistered(Person person, ActivityVerb actionType, ItemType needType, PersonVitalType vitalType, decimal quantity)
 {
     return(person.HasNeed(actionType, needType, vitalType, quantity));
 }
Exemplo n.º 17
0
 public ActivityAttribute(ActivityVerb actionType, ItemType itemType, PersonVitalType vitalType)
 {
     Verb      = actionType;
     ItemType  = itemType;
     VitalType = vitalType;
 }
Exemplo n.º 18
0
 public void AddNeed(ActivityVerb actionType, PersonVitalType vitalType, ItemType needType, decimal quantity, decimal priority)
 {
     AddNeed(new NeedEntry (actionType, needType, vitalType, quantity, priority));
 }
Exemplo n.º 19
0
 public virtual bool NeedIsRegistered(Person person, ActivityVerb actionType, ItemType needType, PersonVitalType vitalType, decimal quantity)
 {
     return person.HasNeed (actionType, needType, vitalType, quantity);
 }
Exemplo n.º 20
0
 public bool HasNeed(ActivityVerb actionType, ItemType needType, PersonVitalType vitalType, decimal quantity)
 {
     return (from n in Needs
         where n.ActionType == actionType
         && (n.ItemType == needType
             || n.VitalType == vitalType)
         select n).Count () > 0;
 }
Exemplo n.º 21
0
 public abstract void RegisterNeed(Person person, ActivityVerb actionType, ItemType needType, PersonVitalType vitalType, decimal priority);
Exemplo n.º 22
0
 public abstract void RegisterNeed(Person person, ActivityVerb actionType, ItemType needType, PersonVitalType vitalType, decimal priority);
Exemplo n.º 23
0
 public void AddNeed(ActivityVerb actionType, PersonVitalType vitalType, ItemType needType, decimal quantity, decimal priority)
 {
     AddNeed(new NeedEntry(actionType, needType, vitalType, quantity, priority));
 }
Exemplo n.º 24
0
 public ActivityAttribute(ActivityVerb verb)
 {
     Verb = verb;
 }
Exemplo n.º 25
0
 public bool IsSuited(ActivityVerb actionType, ItemType itemType, PersonVitalType vitalType)
 {
     return(ActionType == actionType &&
            (ItemType == itemType ||
             VitalType == vitalType));
 }