Beispiel #1
0
    public void setEnglishName(TypeEnglishNameKnownValues new_value)
    {
        TypeEnglishName new_full_value = new TypeEnglishName();

        Debug.Assert(new_value != TypeEnglishNameKnownValues.EnglishName__none);
        new_full_value.in_known_list = true;
        new_full_value.list_value    = new_value;
        setEnglishName(new_full_value);
    }
Beispiel #2
0
    public string  getEnglishNameAsString()
    {
        TypeEnglishName result = getEnglishName();

        if (result.in_known_list)
        {
            return(stringFromEnglishName(result.list_value));
        }
        else
        {
            return(result.string_value);
        }
    }
Beispiel #3
0
            protected override void handle_result(string result)
            {
                TypeEnglishNameKnownValues known     = stringToEnglishName(result);
                TypeEnglishName            new_value = new TypeEnglishName();

                if (known == TypeEnglishNameKnownValues.EnglishName__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);
            }
Beispiel #4
0
    public void setEnglishName(string chars)
    {
        TypeEnglishNameKnownValues known     = stringToEnglishName(chars);
        TypeEnglishName            new_value = new TypeEnglishName();

        if (known == TypeEnglishNameKnownValues.EnglishName__none)
        {
            new_value.in_known_list = false;
            new_value.string_value  = chars;
        }
        else
        {
            new_value.in_known_list = true;
            new_value.list_value    = known;
        }
        setEnglishName(new_value);
    }
Beispiel #5
0
 protected override void handle_result(TypeEnglishName result)
 {
     top.value.Add(result);
 }
Beispiel #6
0
            protected override void handle_result(TypeEnglishName result)
            {
//@@@        Debug.Assert(!have_value);
                have_value = true;
                value      = result;
            }
Beispiel #7
0
 protected abstract void handle_result(TypeEnglishName result);
Beispiel #8
0
 public void setEnglishName(TypeEnglishName new_value)
 {
     flagHasEnglishName = true;
     storeEnglishName   = new_value;
 }
Beispiel #9
0
    private void  fromJSONEnglishName(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 EnglishName of SolarSystemBodyJSON is not a string.");
        }
        TypeEnglishName the_open_enum = new TypeEnglishName();

        switch (json_string.getData()[0])
        {
        case 'E':
            if ((String.Compare(json_string.getData(), 1, "arth", 0, 4, false) == 0) && (json_string.getData().Length == 5))
            {
                the_open_enum.in_known_list = true;
                the_open_enum.list_value    = TypeEnglishNameKnownValues.EnglishName_Earth;
                goto open_enum_is_done;
            }
            break;

        case 'J':
            if ((String.Compare(json_string.getData(), 1, "upiter", 0, 6, false) == 0) && (json_string.getData().Length == 7))
            {
                the_open_enum.in_known_list = true;
                the_open_enum.list_value    = TypeEnglishNameKnownValues.EnglishName_Jupiter;
                goto open_enum_is_done;
            }
            break;

        case 'M':
            switch (json_string.getData()[1])
            {
            case 'a':
                if ((String.Compare(json_string.getData(), 2, "rs", 0, 2, false) == 0) && (json_string.getData().Length == 4))
                {
                    the_open_enum.in_known_list = true;
                    the_open_enum.list_value    = TypeEnglishNameKnownValues.EnglishName_Mars;
                    goto open_enum_is_done;
                }
                break;

            case 'e':
                if ((String.Compare(json_string.getData(), 2, "rcury", 0, 5, false) == 0) && (json_string.getData().Length == 7))
                {
                    the_open_enum.in_known_list = true;
                    the_open_enum.list_value    = TypeEnglishNameKnownValues.EnglishName_Mercury;
                    goto open_enum_is_done;
                }
                break;

            default:
                break;
            }
            break;

        case 'N':
            if ((String.Compare(json_string.getData(), 1, "eptune", 0, 6, false) == 0) && (json_string.getData().Length == 7))
            {
                the_open_enum.in_known_list = true;
                the_open_enum.list_value    = TypeEnglishNameKnownValues.EnglishName_Neptune;
                goto open_enum_is_done;
            }
            break;

        case 'P':
            if ((String.Compare(json_string.getData(), 1, "luto", 0, 4, false) == 0) && (json_string.getData().Length == 5))
            {
                the_open_enum.in_known_list = true;
                the_open_enum.list_value    = TypeEnglishNameKnownValues.EnglishName_Pluto;
                goto open_enum_is_done;
            }
            break;

        case 'S':
            if ((String.Compare(json_string.getData(), 1, "aturn", 0, 5, false) == 0) && (json_string.getData().Length == 6))
            {
                the_open_enum.in_known_list = true;
                the_open_enum.list_value    = TypeEnglishNameKnownValues.EnglishName_Saturn;
                goto open_enum_is_done;
            }
            break;

        case 'U':
            if ((String.Compare(json_string.getData(), 1, "ranus", 0, 5, false) == 0) && (json_string.getData().Length == 6))
            {
                the_open_enum.in_known_list = true;
                the_open_enum.list_value    = TypeEnglishNameKnownValues.EnglishName_Uranus;
                goto open_enum_is_done;
            }
            break;

        case 'V':
            if ((String.Compare(json_string.getData(), 1, "enus", 0, 4, false) == 0) && (json_string.getData().Length == 5))
            {
                the_open_enum.in_known_list = true;
                the_open_enum.list_value    = TypeEnglishNameKnownValues.EnglishName_Venus;
                goto open_enum_is_done;
            }
            break;

        case 't':
            if (String.Compare(json_string.getData(), 1, "he ", 0, 3, false) == 0)
            {
                switch (json_string.getData()[4])
                {
                case 'M':
                    if ((String.Compare(json_string.getData(), 5, "oon", 0, 3, false) == 0) && (json_string.getData().Length == 8))
                    {
                        the_open_enum.in_known_list = true;
                        the_open_enum.list_value    = TypeEnglishNameKnownValues.EnglishName_the_x20_Moon;
                        goto open_enum_is_done;
                    }
                    break;

                case 'S':
                    if ((String.Compare(json_string.getData(), 5, "un", 0, 2, false) == 0) && (json_string.getData().Length == 7))
                    {
                        the_open_enum.in_known_list = true;
                        the_open_enum.list_value    = TypeEnglishNameKnownValues.EnglishName_the_x20_Sun;
                        goto open_enum_is_done;
                    }
                    break;

                default:
                    break;
                }
            }
            break;

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