[Orxonox-commit 7501] r12107 - in code/branches/wagnis_HS18: data/levels src/modules/wagnis
stadlero at orxonox.net
stadlero at orxonox.net
Thu Nov 15 22:23:49 CET 2018
Author: stadlero
Date: 2018-11-15 22:23:48 +0100 (Thu, 15 Nov 2018)
New Revision: 12107
Modified:
code/branches/wagnis_HS18/data/levels/Wagnis.oxw
code/branches/wagnis_HS18/src/modules/wagnis/WagnisProvince.cc
code/branches/wagnis_HS18/src/modules/wagnis/WagnisProvince.h
Log:
Province is now a pawn
Modified: code/branches/wagnis_HS18/data/levels/Wagnis.oxw
===================================================================
--- code/branches/wagnis_HS18/data/levels/Wagnis.oxw 2018-11-14 10:59:52 UTC (rev 12106)
+++ code/branches/wagnis_HS18/data/levels/Wagnis.oxw 2018-11-15 21:23:48 UTC (rev 12107)
@@ -9,6 +9,9 @@
include("stats.oxo")
include("HUDTemplates3.oxo")
include("templates/lodInformation.oxt")
+ include("templates/spaceshipAssff.oxt")
+ include("templates/spaceshipGhost.oxt")
+ include("templates/spaceshipSpacecruiser.oxt")
?>
<!--
@@ -45,8 +48,14 @@
>
<Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
- <SpawnPoint position="100, 45, 75" lookat="0, 45, 75" />
+ <SpawnPoint
+ position="100, 45, 75"
+ lookat="0, 45, 75"
+ spawnclass=SpaceShip
+ pawndesign=spaceshipAssff
+ />
+
<WagnisGameboard position="0,0,0" connections_string="1=2+1000, 2=1, 1000=1">
<Provinces>
Modified: code/branches/wagnis_HS18/src/modules/wagnis/WagnisProvince.cc
===================================================================
--- code/branches/wagnis_HS18/src/modules/wagnis/WagnisProvince.cc 2018-11-14 10:59:52 UTC (rev 12106)
+++ code/branches/wagnis_HS18/src/modules/wagnis/WagnisProvince.cc 2018-11-15 21:23:48 UTC (rev 12107)
@@ -4,12 +4,20 @@
#include "worldentities/StaticEntity.h"
#include <vector>
+#define WAGNIS_PROVINCE_MAX_HEALTH 1000.0f
+
+/**TODO
+ *
+ *
+ *
+ **/
+
namespace orxonox
{
RegisterClass(WagnisProvince);
//Constructor
- WagnisProvince::WagnisProvince(Context* context) : MovableEntity(context){
+ WagnisProvince::WagnisProvince(Context* context) : Pawn(context){
RegisterObject(WagnisProvince);
this->owner_ID = 0;
this->troops = 0;
@@ -17,6 +25,8 @@
this->continent = -1;
this->neighbors = std::vector<WagnisProvince*>();
this->markerBillboard = nullptr;
+ this->maxHealth_ = WAGNIS_PROVINCE_MAX_HEALTH;
+ this->health_ = WAGNIS_PROVINCE_MAX_HEALTH-10.0f; // <-- DEBUG
}
//Destructor
WagnisProvince::~WagnisProvince(){
@@ -23,6 +33,15 @@
}
+ //Tick
+ void WagnisProvince::tick(float dt){
+ SUPER(WagnisProvince, tick, dt);
+
+ if(this->health_ < this->maxHealth_){
+ this->health_ = this->maxHealth_;
+ orxout() << "Health test ok" << endl; }
+ }
+
//XML Port
void WagnisProvince::XMLPort(Element& xmlelement,XMLPort::Mode mode){
SUPER(WagnisProvince, XMLPort, xmlelement, mode);
Modified: code/branches/wagnis_HS18/src/modules/wagnis/WagnisProvince.h
===================================================================
--- code/branches/wagnis_HS18/src/modules/wagnis/WagnisProvince.h 2018-11-14 10:59:52 UTC (rev 12106)
+++ code/branches/wagnis_HS18/src/modules/wagnis/WagnisProvince.h 2018-11-15 21:23:48 UTC (rev 12107)
@@ -9,7 +9,7 @@
#include "WagnisPrereqs.h"
#include "core/CoreIncludes.h"
#include "core/XMLPort.h"
-#include "worldentities/MovableEntity.h"
+#include "worldentities/pawns/Pawn.h"
#include "graphics/Billboard.h"
#include <vector>
@@ -16,11 +16,14 @@
namespace orxonox
{
- class _WagnisExport WagnisProvince : public MovableEntity
+ class _WagnisExport WagnisProvince : public Pawn
{
public:
WagnisProvince(Context*);
virtual ~WagnisProvince();
+ void tick(float);
+
+
virtual void XMLPort(Element&,XMLPort::Mode);
void addMarkerBillboard(Billboard*);
Billboard* getMarkerBillboard(unsigned int) const;
@@ -37,6 +40,7 @@
void addNeighbor(WagnisProvince*);
std::vector<WagnisProvince*> neighbors;
+
int owner_ID;
int troops;
More information about the Orxonox-commit
mailing list