Esempio n. 1
0
        public override bool Parse(XmlDbRow row, ref string error)
        {
            mHit = new HitMissResult <T, HitMissSP>(row, "Hit", ref error);
            if (!string.IsNullOrEmpty(error))
            {
                return(false);
            }

            mMiss = new HitMissResult <T, HitMissSP>(row, "Miss", ref error);
            if (!string.IsNullOrEmpty(error))
            {
                return(false);
            }

            if (row.Exists("OnExpansionFail"))
            {
                if (!ParserFunctions.TryParseEnum <HitMissExpansionFail>(row.GetString("OnExpansionFail"), out mOnExpansionFail, HitMissExpansionFail.None))
                {
                    error = "OnExpansionFail unknown";
                    return(false);
                }
            }

            return(true);
        }
Esempio n. 2
0
        public LongTermRelationshipBaseScoring(int notKnownScore, int hitScore, int missScore, int gate)
            : base(hitScore, missScore)
        {
            mGate = gate;

            mNotKnown = new HitMissResult <SimDescription, SP>(notKnownScore);
        }
Esempio n. 3
0
        public override bool Parse(XmlDbRow row, ref string error)
        {
            if (!row.Exists("Method"))
            {
                error = "Method missing";
                return(false);
            }
            else if (!row.Exists("Gate"))
            {
                error = "Gate missing";
                return(false);
            }

            mMethod = row.GetString("Method");

            if (ScoringLookup.GetScoring(mMethod) == null)
            {
                error = mMethod + " not found";
                return(false);
            }

            mGate = new HitMissResult <T, SP>(row, "Gate", ref error);
            if (!string.IsNullOrEmpty(error))
            {
                return(false);
            }

            return(base.Parse(row, ref error));
        }
Esempio n. 4
0
        public override bool Parse(XmlDbRow row, ref string error)
        {
            mResult = new HitMissResult <T, SP>(row, "", ref error);
            if (!string.IsNullOrEmpty(error))
            {
                return(false);
            }

            mInvert = row.GetBool("Invert");

            return(true);
        }
Esempio n. 5
0
        public override bool Parse(XmlDbRow row, ref string error)
        {
            mNotKnown = new HitMissResult <SimDescription, SP>(row, "NotKnown", ref error);
            if (!string.IsNullOrEmpty(error))
            {
                return(false);
            }

            if (!row.Exists("Gate"))
            {
                error = "Gate missing";
                return(false);
            }

            mGate = row.GetInt("Gate");

            return(base.Parse(row, ref error));
        }
Esempio n. 6
0
 public HitMissScoring(int hit, int miss)
 {
     mHit  = new HitMissResult <T, HitMissSP>(hit);
     mMiss = new HitMissResult <T, HitMissSP>(miss);
 }
Esempio n. 7
0
 public RandomScoring(int min, int max)
 {
     mResult = new HitMissResult <T, SP>(min, max);
 }
Esempio n. 8
0
 public RandomScoring(int score)
 {
     mResult = new HitMissResult <T, SP>(score);
 }