[Orxonox-commit 6989] r11610 - code/branches/AsteroidMining_HS17/src/modules/asteroidmining

remartin at orxonox.net remartin at orxonox.net
Mon Nov 27 18:54:29 CET 2017


Author: remartin
Date: 2017-11-27 18:54:29 +0100 (Mon, 27 Nov 2017)
New Revision: 11610

Added:
   code/branches/AsteroidMining_HS17/src/modules/asteroidmining/SpicedAsteroidField.cc
   code/branches/AsteroidMining_HS17/src/modules/asteroidmining/SpicedAsteroidField.h
Log:


Added: code/branches/AsteroidMining_HS17/src/modules/asteroidmining/SpicedAsteroidField.cc
===================================================================
--- code/branches/AsteroidMining_HS17/src/modules/asteroidmining/SpicedAsteroidField.cc	                        (rev 0)
+++ code/branches/AsteroidMining_HS17/src/modules/asteroidmining/SpicedAsteroidField.cc	2017-11-27 17:54:29 UTC (rev 11610)
@@ -0,0 +1,163 @@
+
+ /*   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
+ *
+ */
+
+/*
+
+*
+*
+*<OFFEN Describe
+*
+*
+
+*/
+
+
+#include "../../orxonox/worldentities/pawns/Pawn.h"
+#include "../../orxonox/worldentities/WorldEntity.h"
+
+#include "SpicedAsteroidField.h"
+
+#include <algorithm>
+
+#include "core/CoreIncludes.h"
+#include "core/GameMode.h"
+#include "core/XMLPort.h"
+#include "core/EventIncludes.h"
+#include "network/NetworkFunction.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/items/HealthPickup.h"
+#include "../pickup/PickupSpawner.h"
+#include "../pickup/Pickup.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, "size", setSize, getSize, 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? 
+
+
+    }
+
+    void SpicedAsteroidField::setSize(float s){
+        this->size = s;
+    }
+
+    float SpicedAsteroidField::getSize(){
+        return this->size;
+    }
+
+
+
+}

Added: code/branches/AsteroidMining_HS17/src/modules/asteroidmining/SpicedAsteroidField.h
===================================================================
--- code/branches/AsteroidMining_HS17/src/modules/asteroidmining/SpicedAsteroidField.h	                        (rev 0)
+++ code/branches/AsteroidMining_HS17/src/modules/asteroidmining/SpicedAsteroidField.h	2017-11-27 17:54:29 UTC (rev 11610)
@@ -0,0 +1,85 @@
+/*
+ *   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:
+ *      ...
+ *
+ */
+
+#ifndef _SpicedAsteroidField_H__
+#define _SpicedAsteroidField_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <string>
+#include <vector>
+#include "interfaces/PickupCarrier.h"
+#include "interfaces/RadarViewable.h"
+#include "worldentities/ControllableEntity.h"
+#include "worldentities/ExplosionPart.h"
+
+#include "../../orxonox/worldentities/pawns/Pawn.h"
+
+namespace orxonox // tolua_export
+{
+
+
+    // tolua_export
+    class _OrxonoxExport SpicedAsteroidField
+    { // tolua_export
+
+        public:
+            SpicedAsteroidField(Context* context);// This constructor is for XML access only!
+
+            virtual ~SpicedAsteroidField();
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode) override;
+            virtual void tick(float dt) override;
+
+
+
+            virtual void setSize(float f);
+            virtual float getSize();
+
+
+        protected:
+            // Da neue Argumente reinstellen
+            //float asteroidVersion; // Bodenstrich-Konvention?, 
+            // Wert zwischen 1 und 6 (Spezialdinger?), die Mesh-Form
+            float size;
+            bool generateSmaller;
+            bool initialised;
+
+            Context* context;
+
+            virtual void create();
+
+
+
+        private:
+            void registerVariables();
+
+    }; // tolua_export
+} // tolua_export
+
+#endif /* _SpicedAsteroidField_H__ */



More information about the Orxonox-commit mailing list