00001 /* This file is part of The_Merry_Turnip 00002 * 00003 * The_Merry_Turnip - TODO: Description 00004 * Copyright © DAVY Guillaume 2009 <davyg2@gmail.com> 00005 * 00006 * The_Merry_Turnip is free software: you can redistribute it and/or modify it 00007 * under the terms of the GNU General Public License as published by the 00008 * Free Software Foundation, either version 3 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * The_Merry_Turnip is distributed in the hope that it will be useful, but 00012 * WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00014 * See the GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License along 00017 * with this program. If not, see <http://www.gnu.org/licenses/>. 00018 */ 00023 #include <game.h> 00024 00035 base::base(stringc name) 00036 { 00037 nameClass = name; 00038 initialize = false; 00039 } 00040 00041 base::~base() 00042 { 00043 00044 } 00045 00050 int base::init(int Id, coeur* c) 00051 { 00052 mycore=c; 00053 id = Id; 00054 00055 logId = mycore->getLogger()->createFile(nameClass,id); 00056 00057 initialize = true; 00058 00059 log(nameClass + " initialized"); 00060 00061 return logId; 00062 } 00063 00066 int base::update() 00067 { 00068 return 0; 00069 } 00070 00073 int base::close() 00074 { 00075 log(nameClass + " closed"); 00076 initialize = false; 00077 return mycore->getLogger()->closeFile(logId); 00078 } 00079 00080 int base::getId() 00081 { 00082 return id; 00083 } 00084 00088 int base::log(stringc text) 00089 { 00090 return mycore->getLogger()->write(logId,text); 00091 } 00092 00093 bool base::isInit() 00094 { 00095 return initialize; 00096 } 00097