예제 #1
0
 Act(Person s, Verb v, Noun o1, Noun o2, Act c, System.Action<Act> R)
     : this()
 {
     //Debug.Assert(Arity(v) == 2 || o2, v.ToString() + " is a ternary verb.");
     subject = s; verb = v; primaryObject = o1; secondaryObject = o2; parent = c; Register = R;
     args = new VerbArguments(this);
     Register(this);
 }
예제 #2
0
        public bool Adjacent(Noun to)
        {
            double a = (double)(this.X - to.X);
            double b = (double)(this.Y - to.Y);

            if (Math.Sqrt(a * a + b * b) < 2)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
예제 #3
0
 /// <summary> She pours tequila on him. </summary>
 /// <param name="subject"> She </param>
 /// <param name="verb"> pours </param>
 /// <param name="primaryObject"> tequila </param>
 /// <param name="secondaryObject"> him </param>
 public Act Cause(Person subject, Verb verb, Noun primaryObject, Noun secondaryObject)
 {
     return new Act(subject, verb, primaryObject, secondaryObject, this, Register);
 }
예제 #4
0
 /// <summary> She pours tequila. </summary>
 /// <param name="subject"> She </param>
 /// <param name="verb"> pours </param>
 /// <param name="_object"> tequila. </param>
 public Act Cause(Person subject, Verb verb, Noun _object)
 {
     return Cause(subject, verb, _object, Noun.NOTHING);
 }
 protected void Query(Person other, Noun about, Act because)
 {
     Listener = other;
     Commit(because.Cause(this, Verb.ASK_WHY, other, about));
 }
예제 #6
0
 public Act FirstCause(Person subject, Verb verb, Noun primaryObject, Noun secondaryObject)
 {
     Debug.Assert(primaryObject || verb != Verb.GIVE, "that's a ternary verb.");
     return NO_ACT.Cause(subject, verb, primaryObject, secondaryObject);
 }