Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

object.cc

Go to the documentation of this file.
00001 #include "object.h"
00002 #include "model.h"
00003 
00004 object::object(int ID) : id(ID), models(), name("object_unnamed") {}
00005 
00006 void object::setName(const std::string& Name) { name = Name; }
00007 
00008 const std::string& object::getName() const { return name; }
00009 
00010 model* object::modelExists(int modelID) {
00011   // Check if the model exists
00012   for (unsigned int i = 0; i < models.size(); i++){
00013     if (models[i]->getID() == modelID){
00014       return models[i];
00015     }
00016   }
00017   return NULL;
00018 }
00019 
00020 int object::getID() const { return id; }
00021 
00022 void object::writeToFile(std::ofstream& outfile){
00023   outfile << id << std::endl;
00024   outfile << name << std::endl;
00025   outfile << models.size() << std::endl;
00026   for (unsigned int i = 0; i < models.size(); i++){
00027     outfile << models[i]->getID() << "\t";
00028   }
00029   outfile << std::endl;
00030 }
00031 

Tekkotsu v5.1CVS
Generated Mon May 9 04:58:45 2016 by Doxygen 1.6.3