mirror of
https://github.com/ApfelTeeSaft/PlanetFleet.git
synced 2026-08-26 19:33:38 +00:00
27 lines
741 B
C++
27 lines
741 B
C++
#include "structure.h"
|
|
|
|
#include <node.h>
|
|
|
|
using namespace gameBase;
|
|
using namespace vb01;
|
|
using namespace std;
|
|
|
|
namespace battleship{
|
|
Structure::Structure(Player *player, int id, Vector3 pos, Quaternion rot, int buildStatus) : Unit(player, id, pos, rot){
|
|
this->buildStatus = buildStatus;
|
|
buildStatusBackground = createBar(Unit::lenHpBar, Vector4(0, 0, 0, 1));
|
|
buildStatusForeground = createBar(Unit::lenHpBar, Vector4(0, 0, 1, 1));
|
|
}
|
|
|
|
void Structure::update(){
|
|
Unit::update();
|
|
|
|
if(selected && buildStatus < 100)
|
|
Unit::displayUnitStats(buildStatusForeground, buildStatusBackground, buildStatus, 100, Vector2(0, -10));
|
|
else{
|
|
buildStatusBackground->setVisible(false);
|
|
buildStatusForeground->setVisible(false);
|
|
}
|
|
}
|
|
}
|