Introduced FileSystem and Out classes
[openstranded.git] / src / entity.cc
blob7c3e5f77555e01e4e630ea01b69578728eec3a6c
1 /*
2 * See entity.hh for a brief description of the entity class.
4 * Copyright (C) 2008 Hermann Walth
6 * This file is part of OpenStranded
8 * OpenStranded is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
13 * OpenStranded is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with OpenStranded. If not, see <http://www.gnu.org/licenses/>.
22 #include "output.hh"
23 #include "entity.hh"
24 #include "kingdom.hh"
25 #include "eal/engine.hh"
27 Entity::Entity (ID type):
28 typeID(type)
31 void
32 Entity::load(Type *type)
34 Out::msg.printf("Entity: %s\n", type->getName().c_str());
35 std::string model = type->getModel();
36 if (model != "")
38 scenenode = eal::Engine::get()->addSceneNode();
39 scenenode->setModel(model);
43 void
44 Entity::setPosition(eal::Vector3 position)
46 this->position = position;
47 if (scenenode)
48 scenenode->setPosition(position);
51 eal::Vector3
52 Entity::getPosition()
54 return position;