/
niceSOFT
/
swig
Обзор
Документация
Войти
/
niceSOFT
/
swig
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Examples/lua/enum/example.cxx
26 строк
860 B
Erez Geva
More Lua tests (#3405)
31 май 2026, 17:09
31 май 2026, 17:09
a1b3ca8
Код
Авторство
О чём код?
#include "example.h" #include <stdio.h> void Foo::enum_test(speed s) { switch(s) { case IMPULSE: printf("IMPULSE speed\n"); break; case WARP: printf("WARP speed\n"); break; case LUDICROUS: printf("LUDICROUS speed\n"); break; default: printf("Unknown speed\n"); break; } } void enum_test(color c, Foo::speed s) { switch(c) { case RED: printf("color = RED, "); break; case BLUE: printf("color = BLUE, "); break; case GREEN: printf("color = GREEN, "); break; default: printf("color = Unknown color!, "); break; } switch(s) { case Foo::IMPULSE: printf("speed = IMPULSE speed\n"); break; case Foo::WARP: printf("speed = WARP speed\n"); break; case Foo::LUDICROUS: printf("speed = LUDICROUS speed\n"); break; default: printf("speed = Unknown speed!\n"); break; } }