Beispiel #1
0
        public static string ToString(GoapKey key, object state)
        => (key, state) switch
        {
            (GoapKey.hastarget, true) => "Has a target",
            (GoapKey.hastarget, false) => "Has no target",

            (GoapKey.targetisalive, true) => "Target alive",
            (GoapKey.targetisalive, false) => "Target dead",

            (GoapKey.incombat, true) => "In combat",
            (GoapKey.incombat, false) => "Out of combat",

            (GoapKey.withinpullrange, true) => "In pull range",
            (GoapKey.withinpullrange, false) => "Out of pull range",

            (GoapKey.incombatrange, true) => "In combat range",
            (GoapKey.incombatrange, false) => "Out of combat range",

            (GoapKey.pulled, true) => "Pulled",
            (GoapKey.pulled, false) => "Not pulled",

            (GoapKey.shouldheal, true) => "Need to heal",
            (GoapKey.shouldheal, false) => "Health ok",

            (GoapKey.isdead, true) => "I am dead",
            (GoapKey.isdead, false) => "I am alive",

            (GoapKey.shouldloot, true) => "Need to loot",
            (GoapKey.shouldloot, false) => "No need to loot",

            (GoapKey.usehealingpotion, true) => "Use healing pot",
            (GoapKey.usehealingpotion, false) => "My health is ok",

            (GoapKey.newtarget, true) => "Has a new target",
            (GoapKey.newtarget, false) => "No new target",

            (GoapKey.fighting, true) => "Is fighting",
            (GoapKey.fighting, false) => "Is not fighting",

            (GoapKey.bagfull, true) => "Bags are full",
            (GoapKey.bagfull, false) => "Bags are not full",

            (GoapKey.abort, true) => "Should abort",
            (GoapKey.abort, false) => "Should not abort",

            (GoapKey.shoulddrink, true) => "Mana low",
            (GoapKey.shoulddrink, false) => "Mana ok",

            (GoapKey.classMount, true) => "Should mount",
            (GoapKey.classMount, false) => "No need to mount",

            (GoapKey.isswimming, true) => "Swimming",
            (GoapKey.isswimming, false) => "Not Swimming",

            (_, _) => "Unknown"
        };
    }
 public ActionEventArgs(GoapKey key, object value)
 {
     this.Key   = key;
     this.Value = value;
 }
 public void RemoveEffect(GoapKey key)
 {
     Effects.Where(o => o.Key.Equals(key))
     .ToList()
     .ForEach(o => Effects.Remove(o));
 }
 public void AddEffect(GoapKey key, object value)
 {
     Effects.Add(new KeyValuePair <GoapKey, object>(key, value));
 }
 public void RemovePrecondition(GoapKey key)
 {
     Preconditions.Where(o => o.Key.Equals(key))
     .ToList()
     .ForEach(o => Preconditions.Remove(o));
 }
        public void AddPrecondition(GoapKey key, object value)
        {
            var precondition = new GoapPreCondition(GoapKeyDescription.ToString(key, value), value);

            Preconditions.Add(new KeyValuePair <GoapKey, GoapPreCondition>(key, precondition));
        }
Beispiel #7
0
        public static string ToString(GoapKey key, object state)
        => (key, state) switch
        {
            (GoapKey.hastarget, true) => "Has a target",
            (GoapKey.hastarget, false) => "Has no target",

            (GoapKey.dangercombat, true) => "Danger from combat",
            (GoapKey.dangercombat, false) => "No danger",

            (GoapKey.targetisalive, true) => "Target alive",
            (GoapKey.targetisalive, false) => "Target dead",

            (GoapKey.incombat, true) => "In combat",
            (GoapKey.incombat, false) => "Out of combat",

            (GoapKey.pethastarget, true) => "Pet has target",
            (GoapKey.pethastarget, false) => "Pet has no target",

            (GoapKey.withinpullrange, true) => "In pull range",
            (GoapKey.withinpullrange, false) => "Out of pull range",

            (GoapKey.incombatrange, true) => "In combat range",
            (GoapKey.incombatrange, false) => "Out of combat range",

            (GoapKey.pulled, true) => "Pulled",
            (GoapKey.pulled, false) => "Not pulled",

            (GoapKey.shouldheal, true) => "Need to heal",
            (GoapKey.shouldheal, false) => "Health ok",

            (GoapKey.isdead, true) => "I am dead",
            (GoapKey.isdead, false) => "I am alive",

            (GoapKey.shouldloot, true) => "Need to loot",
            (GoapKey.shouldloot, false) => "No need to loot",

            (GoapKey.shouldskin, true) => "Need to skin",
            (GoapKey.shouldskin, false) => "No need to skin",

            (GoapKey.usehealingpotion, true) => "Use healing pot",
            (GoapKey.usehealingpotion, false) => "My health is ok",

            (GoapKey.newtarget, true) => "Has a new target",
            (GoapKey.newtarget, false) => "No new target",

            (GoapKey.fighting, true) => "Is fighting",
            (GoapKey.fighting, false) => "Is not fighting",

            (GoapKey.producedcorpse, true) => "Kill credit",
            (GoapKey.producedcorpse, false) => "No kill",

            (GoapKey.consumecorpse, true) => "Corpse nearby",
            (GoapKey.consumecorpse, false) => "No corpse",

            (GoapKey.abort, true) => "Should abort",
            (GoapKey.abort, false) => "Should not abort",

            (GoapKey.shoulddrink, true) => "Mana low",
            (GoapKey.shoulddrink, false) => "Mana ok",

            (GoapKey.classMount, true) => "Should mount",
            (GoapKey.classMount, false) => "No need to mount",

            (GoapKey.isswimming, true) => "Swimming",
            (GoapKey.isswimming, false) => "Not Swimming",

            (GoapKey.itemsbroken, true) => "Gear is red",
            (GoapKey.itemsbroken, false) => "Gear is not red",

            (_, _) => "Unknown"
        };
    }