/* ORXONOX - the hottest 3D action shooter ever to exist * > www.orxonox.net < * * * License notice: * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * Author: * Fabian 'x3n' Landau * Co-authors: * Simon Miescher * */ /* * * * #include "core/CoreIncludes.h" #include "core/GameMode.h" #include "core/XMLPort.h" #include "core/EventIncludes.h" #include "network/NetworkFunction.h" #include "util/Math.h" // #include "infos/PlayerInfo.h" // #include "controllers/Controller.h" // #include "gametypes/Gametype.h" // #include "graphics/ParticleSpawner.h" // #include "worldentities/ExplosionChunk.h" // #include "worldentities/ExplosionPart.h" // #include "core/object/ObjectListIterator.h" // #include "controllers/FormationController.h" //#include "../pickup/pickup ..... pickupable #include "../objects/collisionshapes/SphereCollisionShape.h" #include "../../orxonox/graphics/Model.h" namespace orxonox { RegisterClass(SpicedAsteroidField); SpicedAsteroidField::SpicedAsteroidField(Context* context) { // Da auch noetig? Wegen set in XML-Code? RegisterObject(SpicedAsteroidField); this->context = context; this->initialised = false; //Noetig, damit nicht sofort zerstoert? this->setCollisionType(WorldEntity::CollisionType::Dynamic); // Old from Pawn this->registerVariables(); orxout() << "AsteroidMining:: Pseudo-Konstruktor passiert!" << endl; } SpicedAsteroidField::~SpicedAsteroidField(){ } void SpicedAsteroidField::create(){ } void SpicedAsteroidField::XMLPort(Element& xmlelement, XMLPort::Mode mode) { SUPER(SpicedAsteroidField, XMLPort, xmlelement, mode); // XMLPortParam(PickupSpawner, "pickup", setPickupTemplateName, getPickupTemplateName, xmlelement, mode); XMLPortParam(SpicedAsteroidField, "count", setCount, getCount, xmlelement, mode); XMLPortParam(SpicedAsteroidField, "mDensity", setMineralDensity, getMineralDensity, xmlelement, mode); XMLPortParam(SpicedAsteroidField, "position", setPosition, getPosition, xmlelement, mode); XMLPortParam(SpicedAsteroidField, "maxSize", setMaxSize, getMaxSize, xmlelement, mode); XMLPortParam(SpicedAsteroidField, "minSize", setMinSize, getMinSize, xmlelement, mode); XMLPortParam(SpicedAsteroidField, "radius", setRadius, getRadius, xmlelement, mode); XMLPortParam(SpicedAsteroidField, "foggy", setFog, isFoggy, xmlelement, mode); } void SpicedAsteroidField::XMLEventPort(Element& xmlelement, XMLPort::Mode mode) { SUPER(SpicedAsteroidField, XMLEventPort, xmlelement, mode); XMLPortEventState(SpicedAsteroidField, BaseObject, "vulnerability", setVulnerable, xmlelement, mode); } void SpicedAsteroidField::registerVariables() { // registerVariable(this->bAlive_, VariableDirection::ToClient); // registerVariable(this->bVulnerable_, VariableDirection::ToClient); // registerVariable(this->health_, VariableDirection::ToClient); // registerVariable(this->maxHealth_, VariableDirection::ToClient); registerVariable(this->size, VariableDirection::ToClient); registerVariable(this->generateSmaller, VariableDirection::ToClient); registerVariable(this->initialised, VariableDirection::ToClient); //registerVariable(this->context, VariableDirection::ToClient); // can't link that since it's a context // float size; // bool generateSmaller; // bool initialised; // Context* context; } void SpicedAsteroidField::tick(float dt) { this->create(); this->~SpicedAsteroidField(); // seems dangerous. Necessary for efficiency? } }