예제 #1
0
    public void setModifierName(TypeModifierNameKnownValues new_value)
    {
        TypeModifierName new_full_value = new TypeModifierName();

        Debug.Assert(new_value != TypeModifierNameKnownValues.ModifierName__none);
        new_full_value.in_known_list = true;
        new_full_value.list_value    = new_value;
        setModifierName(new_full_value);
    }
예제 #2
0
    public string  getModifierNameAsString()
    {
        TypeModifierName result = getModifierName();

        if (result.in_known_list)
        {
            return(stringFromModifierName(result.list_value));
        }
        else
        {
            return(result.string_value);
        }
    }
예제 #3
0
            protected override void handle_result(string result)
            {
                TypeModifierNameKnownValues known     = stringToModifierName(result);
                TypeModifierName            new_value = new TypeModifierName();

                if (known == TypeModifierNameKnownValues.ModifierName__none)
                {
                    new_value.in_known_list = false;
                    new_value.string_value  = result;
                }
                else
                {
                    new_value.in_known_list = true;
                    new_value.list_value    = known;
                }
                handle_result(new_value);
            }
예제 #4
0
    public void setModifierName(string chars)
    {
        TypeModifierNameKnownValues known     = stringToModifierName(chars);
        TypeModifierName            new_value = new TypeModifierName();

        if (known == TypeModifierNameKnownValues.ModifierName__none)
        {
            new_value.in_known_list = false;
            new_value.string_value  = chars;
        }
        else
        {
            new_value.in_known_list = true;
            new_value.list_value    = known;
        }
        setModifierName(new_value);
    }
예제 #5
0
 protected override void handle_result(TypeModifierName result)
 {
     top.value.Add(result);
 }
예제 #6
0
            protected override void handle_result(TypeModifierName result)
            {
//@@@        Debug.Assert(!have_value);
                have_value = true;
                value      = result;
            }
예제 #7
0
 protected abstract void handle_result(TypeModifierName result);
예제 #8
0
 public void setModifierName(TypeModifierName new_value)
 {
     flagHasModifierName = true;
     storeModifierName   = new_value;
 }
예제 #9
0
    private void  fromJSONModifierName(JSONValue json_value, bool ignore_extras)
    {
        Debug.Assert(json_value != null);
        JSONStringValue json_string = json_value.string_value();

        if (json_string == null)
        {
            throw new Exception("The value for field ModifierName of SportsStatsArgumentTypeModifierJSON is not a string.");
        }
        TypeModifierName the_open_enum = new TypeModifierName();

        switch (json_string.getData()[0])
        {
        case 'N':
            if (String.Compare(json_string.getData(), 1, "HL", 0, 2, false) == 0)
            {
                switch (json_string.getData()[3])
                {
                case 'E':
                    switch (json_string.getData()[4])
                    {
                    case 'm':
                        if ((String.Compare(json_string.getData(), 5, "ptyNet", 0, 6, false) == 0) && (json_string.getData().Length == 11))
                        {
                            the_open_enum.in_known_list = true;
                            the_open_enum.list_value    = TypeModifierNameKnownValues.ModifierName_NHLEmptyNet;
                            goto open_enum_is_done;
                        }
                        break;

                    case 'v':
                        if ((String.Compare(json_string.getData(), 5, "enStrength", 0, 10, false) == 0) && (json_string.getData().Length == 15))
                        {
                            the_open_enum.in_known_list = true;
                            the_open_enum.list_value    = TypeModifierNameKnownValues.ModifierName_NHLEvenStrength;
                            goto open_enum_is_done;
                        }
                        break;

                    default:
                        break;
                    }
                    break;

                case 'P':
                    switch (json_string.getData()[4])
                    {
                    case 'e':
                        if ((String.Compare(json_string.getData(), 5, "nalty", 0, 5, false) == 0) && (json_string.getData().Length == 10))
                        {
                            the_open_enum.in_known_list = true;
                            the_open_enum.list_value    = TypeModifierNameKnownValues.ModifierName_NHLPenalty;
                            goto open_enum_is_done;
                        }
                        break;

                    case 'o':
                        if ((String.Compare(json_string.getData(), 5, "werPlay", 0, 7, false) == 0) && (json_string.getData().Length == 12))
                        {
                            the_open_enum.in_known_list = true;
                            the_open_enum.list_value    = TypeModifierNameKnownValues.ModifierName_NHLPowerPlay;
                            goto open_enum_is_done;
                        }
                        break;

                    default:
                        break;
                    }
                    break;

                case 'S':
                    if (String.Compare(json_string.getData(), 4, "ho", 0, 2, false) == 0)
                    {
                        switch (json_string.getData()[6])
                        {
                        case 'o':
                            if ((String.Compare(json_string.getData(), 7, "tout", 0, 4, false) == 0) && (json_string.getData().Length == 11))
                            {
                                the_open_enum.in_known_list = true;
                                the_open_enum.list_value    = TypeModifierNameKnownValues.ModifierName_NHLShootout;
                                goto open_enum_is_done;
                            }
                            break;

                        case 'r':
                            if ((String.Compare(json_string.getData(), 7, "tHanded", 0, 7, false) == 0) && (json_string.getData().Length == 14))
                            {
                                the_open_enum.in_known_list = true;
                                the_open_enum.list_value    = TypeModifierNameKnownValues.ModifierName_NHLShortHanded;
                                goto open_enum_is_done;
                            }
                            break;

                        default:
                            break;
                        }
                    }
                    break;

                default:
                    break;
                }
            }
            break;

        case 'P':
            if ((String.Compare(json_string.getData(), 1, "erGame", 0, 6, false) == 0) && (json_string.getData().Length == 7))
            {
                the_open_enum.in_known_list = true;
                the_open_enum.list_value    = TypeModifierNameKnownValues.ModifierName_PerGame;
                goto open_enum_is_done;
            }
            break;

        case 'U':
            if ((String.Compare(json_string.getData(), 1, "nknown", 0, 6, false) == 0) && (json_string.getData().Length == 7))
            {
                the_open_enum.in_known_list = true;
                the_open_enum.list_value    = TypeModifierNameKnownValues.ModifierName_Unknown;
                goto open_enum_is_done;
            }
            break;

        default:
            break;
        }
        the_open_enum.in_known_list = false;
        the_open_enum.string_value  = json_string.getData();
        open_enum_is_done :;
        setModifierName(the_open_enum);
    }