示例#1
0
 public override int Score(SP parameters)
 {
     if (mInvert)
     {
         return(-mResult.Score(parameters));
     }
     else
     {
         return(mResult.Score(parameters));
     }
 }
示例#2
0
        protected int BaseScore(SP parameters, SimDescription other, out bool success)
        {
            success = true;

            if (HasCollection)
            {
                int collection = 0;
                if (GetCollectedScore(parameters.Actor, out collection))
                {
                    switch (collection)
                    {
                    case -200:
                        return(mMiss.Score(parameters));

                    case 200:
                        return(mHit.Score(parameters));

                    default:
                        return(collection);
                    }
                }
                else
                {
                    return(mNotKnown.Score(parameters));
                }
            }
            else
            {
                Relationship relationship = Relationship.Get(other, parameters.Actor, false);
                if (relationship == null)
                {
                    return(mNotKnown.Score(parameters));
                }
                else if ((mHit.IsZero) && (mMiss.IsZero))
                {
                    return((int)relationship.LTR.Liking);
                }
            }

            success = false;
            return(0);
        }
示例#3
0
 public int Score(bool hit, SP parameters)
 {
     if (hit)
     {
         return(mHit.Score(parameters));
     }
     else
     {
         return(mMiss.Score(parameters));
     }
 }
示例#4
0
        public override bool IsHit(SP parameters)
        {
            if (mScoring == null)
            {
                if (string.IsNullOrEmpty(mMethod))
                {
                    return(false);
                }

                mScoring = ScoringLookup.GetScoring(mMethod);
                mMethod  = null; // Stop the system from checking again
                if (mScoring == null)
                {
                    return(false);
                }
            }

            return(mScoring.IScore(parameters) >= mGate.Score(parameters));
        }