Beispiel #1
0
        public static string ConstraintComparisonTypeToString(ConstraintComparisonType cons)
        {
            switch (cons)
            {
            case ConstraintComparisonType.Equals:
                return("==");

            case ConstraintComparisonType.NotEquals:
                return("!=");

            case ConstraintComparisonType.GreaterThan:
                return(">");

            case ConstraintComparisonType.LessThan:
                return("<");

            case ConstraintComparisonType.GreaterThanEqualTo:
                return(">=");

            case ConstraintComparisonType.LessThanEqualTo:
                return("<=");

            case ConstraintComparisonType.None:
                return("Save Only");
            }
            return("");
        }
Beispiel #2
0
 public Constraint(UInt64 parentPlotFragmentId, UInt64 parentPrecondStatementId, bool allowedToSave, UInt64 matchingEntityTypeId, StoryData world)
 {
     _matchingEntityTypeId = matchingEntityTypeId;
     _constraintId = world.getNewId();
     _parentPrecondStmtId = parentPrecondStatementId;
     _allowedToSave = allowedToSave;
     _parentPlotFragmentId = parentPlotFragmentId;
     _constraintType = ConstraintComparisonType.Equals;
     _comparisonValue = new Parameter("", TraitDataType.Text, false, world);
     _saveAttribute = false;
     _savedVariable = new Trait("", TraitDataType.Text, "", 0, world);
     _mustAlwaysBeTrue = false;
 }
Beispiel #3
0
 public Constraint(UInt64 parentPlotFragmentId, UInt64 parentPrecondStatementId, bool allowedToSave, UInt64 matchingEntityTypeId, StoryData world)
 {
     _matchingEntityTypeId = matchingEntityTypeId;
     _constraintId         = world.getNewId();
     _parentPrecondStmtId  = parentPrecondStatementId;
     _allowedToSave        = allowedToSave;
     _parentPlotFragmentId = parentPlotFragmentId;
     _constraintType       = ConstraintComparisonType.Equals;
     _comparisonValue      = new Parameter("", TraitDataType.Text, false, world);
     _saveAttribute        = false;
     _savedVariable        = new Trait("", TraitDataType.Text, "", 0, world);
     _mustAlwaysBeTrue     = false;
 }
Beispiel #4
0
        public static string ConstraintComparisonTypeToString(ConstraintComparisonType cons)
        {
            switch(cons)
            {
                case ConstraintComparisonType.Equals:
                    return "==";

                case ConstraintComparisonType.NotEquals:
                    return "!=";

                case ConstraintComparisonType.GreaterThan:
                    return ">";

                case ConstraintComparisonType.LessThan:
                    return "<";

                case ConstraintComparisonType.GreaterThanEqualTo:
                    return ">=";

                case ConstraintComparisonType.LessThanEqualTo:
                    return "<=";

                case ConstraintComparisonType.None:
                    return "Save Only";

            }
            return "";
        }