removed many Irrlicht references

This commit is contained in:
devZoGok
2021-10-31 15:13:47 +02:00
parent 0e236a44d6
commit b18b2fe9a8
70 changed files with 1822 additions and 1529 deletions
+16 -5
View File
@@ -1,6 +1,7 @@
#include <sstream>
#include <string>
#include <cmath>
#include <vector.h>
#include "consoleCommand.h"
#include "unitData.h"
@@ -11,14 +12,15 @@
#include "demoJet.h"
#include "missileJet.h"
using namespace irr::core;
using namespace game::core;
using namespace game::content;
using namespace std;
using namespace vb01;
using namespace vb01Gui;
namespace game{
namespace gui{
ConsoleCommand::ConsoleCommand(Listbox *l, vector<Player*> players, stringw name, vector<stringw> args) {
ConsoleCommand::ConsoleCommand(Listbox *l, vector<Player*> players, string name, vector<string> args) {
listbox = l;
this->players = players;
this->name = name;
@@ -40,8 +42,9 @@ namespace game{
void ConsoleCommand::addUnit() {
int unitId = 0, playerId = 0;
vector3df pos(0, 0, 0);
Vector3 pos(0, 0, 0);
float angle = 0;
for (int i = 0; i < arguments.size(); i++) {
arguments[i].erase(0);
for (int i2 = 0; i2 < arguments[i].size(); i2++) {
@@ -51,8 +54,10 @@ namespace game{
unitId += (arguments[i][i2] - 48) * pow(10, arguments[i].size() - (i2 + 1));
}
}
if ((playerId == 0 || playerId == 1) && (unitId >= 0 && unitId <= numberOfUnits)) {
Unit *u = nullptr;
switch (unitType[unitId]) {
case UNIT_TYPE::VESSEL:
u = new Vessel(players[playerId],pos, unitId);
@@ -80,6 +85,7 @@ namespace game{
default:
break;
}
players[playerId]->addUnit(u);
} else if (playerId != 0 && playerId != 1)
printConsoleMessage("Invalid player id");
@@ -91,9 +97,11 @@ namespace game{
if (arguments.size() == 0)
for (Player *pl : players){
vector<Unit*> &units=pl->getUnits();
for (Unit *u : units){
u->toggleDebugging(true);
vector<Projectile*> projectiles=u->getProjectiles();
for(Projectile *pr : projectiles)
pr->debug();
}
@@ -102,18 +110,21 @@ namespace game{
printConsoleMessage("Too many arguments");
}
void ConsoleCommand::printConsoleMessage(stringw message) {
void ConsoleCommand::printConsoleMessage(string message) {
int messageId = 0;
bool foundEmptySlot = false;
for (int i = 0; i < listbox->getContents().size() && !foundEmptySlot; i++)
if (listbox->getContents()[i] == "") {
if (listbox->getContents()[i] == L"") {
messageId = i;
foundEmptySlot = true;
}
/*
if (foundEmptySlot)
listbox->changeLine(messageId, message);
else
listbox->addLine(message);
*/
}
}
}