src/CorridorCell.cpp

Go to the documentation of this file.
00001 
00008 /*
00009 This file is part of Teapot Colony Wars.
00010 
00011 Teapot Colony Wars is free software: you can redistribute it and/or modify
00012 it under the terms of the GNU General Public License as published by
00013 the Free Software Foundation, either version 2 of the License, or
00014 (at your option) any later version.
00015 
00016 Teapot Colony Wars is distributed in the hope that it will be useful,
00017 but WITHOUT ANY WARRANTY; without even the implied warranty of
00018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019 GNU General Public License for more details.
00020 
00021 You should have received a copy of the GNU General Public License
00022 along with Teapot Colony Wars.  If not, see <http://www.gnu.org/licenses/>.
00023 */
00024 
00025 #include "CorridorCell.h"
00026 
00027 #include "Image.h"
00028 #include "Worshiper.h"
00029 
00030 GLuint CorridorCell::_tex_name = 0;
00031 
00032 GLuint CorridorCell::getTexName() {
00033   if(_tex_name == 0) {
00034     Image texture("./textures/CorridorCell.bmp");
00035     _tex_name = texture.genTexture2D();
00036   }
00037 
00038   return _tex_name;
00039 }
00040 
00041 CorridorCell::CorridorCell(unsigned int size_max) :
00042     ReachableCell(), _size_max(size_max) {
00043 
00044 }
00045 
00046 CorridorCell::~CorridorCell() {
00047 
00048 }
00049 
00050 void CorridorCell::setSize_max(unsigned int new_size) {
00051   _size_max = new_size;
00052 }
00053 
00054 unsigned int CorridorCell::getSize_max() {
00055   return _size_max;
00056 }
00057 
00058 bool CorridorCell::reachable(Worshiper *w) {
00059   return ReachableCell::reachable(w) && (w->getSize() <= _size_max);
00060 }

Generated on Sat Feb 2 22:22:54 2008 for Teapot Colony Wars by  doxygen 1.5.4