1 // Copyright (c) 2012 Dennco Project
3 // This program is free software: you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation, either version 3 of the License, or
6 // (at your option) any later version.
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
13 // You should have received a copy of the GNU General Public License
14 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 // Created by tkawata on 12/11/2011.
20 #ifndef __INCLUDE_TKCELL__
21 #define __INCLUDE_TKCELL__
30 class TKCellCodeInstance;
32 typedef std::map<std::string, TKReceptor*> TKReceptorMap;
37 TKCell(TKContainer *container, std::string location, std::string name, bool canInterface);
40 std::string getName() { return mName; }
42 void setAxonValue(float value);
44 const TKReceptorMap* getReceptors() { return &mReceptors; }
46 virtual bool setCellCode(TKCellCode *code, const void *data);
48 bool connectTo(std::string connectionName, TKCell *targetReceptor);
49 inline TKContainer* getContainer() { return mContainer; }
50 bool isInterface() { return mCanInterface; }
52 virtual bool doTick(float time) = 0;
53 virtual bool doInit() = 0;
54 virtual bool doDestroy() = 0;
57 virtual TKReceptor* createReceptor(std::string name);
60 std::string mLocation;
61 TKContainer *mContainer;
63 TKReceptorMap mReceptors;
64 TKCellCodeInstance *mCellCodeInstance;