/** @file world/weather.cpp Implementace hlavickoveho souboru world/weather.h @author Petr Wolf */ #include "world/useful.h" #include "world/weather.h" using namespace World; TWeather::TWeather() { alloc(); _data->state = (WEATHER_STATE)0; _data->duration = 0; } TWeather::TWeather(WEATHER * data) : TStructHolder(data, 0) { } void TWeather::writeToXML(TPackage * package) { SET_INT(package, "state", _data->state); SET_INT(package, "duration", _data->duration); } void TWeather::readFromXML(TPackage * package) { if (_data == NULL) alloc(); GET_TINT(package, "state", _data->state, WEATHER_STATE); GET_INT(package, "duration", _data->duration); } void TWeather::readFromTCL(TTCL_Interpreter & interpreter, const char * varName) { char _path[MAX_STRLEN]; interpreter.getVar(TCL_path(_path, varName, "state"), TVT_INT, &_data->state); interpreter.getVar(TCL_path(_path, varName, "duration"), TVT_INT, &_data->duration); } void TWeather::writeToTCL(TTCL_Interpreter & interpreter, const char * varName) { char _path[MAX_STRLEN]; interpreter.setVar(TCL_path(_path, varName, "state"), TVT_INT, &_data->state); interpreter.setVar(TCL_path(_path, varName, "duration"), TVT_INT, &_data->duration); }