Page MenuHomePhabricator (Chris)

No OneTemporary

Authored By
Unknown
Size
7 KB
Referenced Files
None
Subscribers
None
diff --git a/grouphud.cpp b/grouphud.cpp
index 6d0c2ac..b138783 100644
--- a/grouphud.cpp
+++ b/grouphud.cpp
@@ -1,57 +1,57 @@
#include "grouphud.h"
#include "data.h"
namespace efc {
GroupHud::GroupHud(sf::Font *gameFont)
{
seasonName.setFont(*gameFont);
}
GroupHud::GroupHud(){
}
void GroupHud::setFont(sf::Font *gameFont) {
move(440,12);
seasonName.setFont(*gameFont);
roundName.setFont(*gameFont);
monthName.setFont(*gameFont);
seasonName.setColor(sf::Color(255,255,255,200));
seasonName.setCharacterSize(30);
roundName.setCharacterSize(30);
monthName.setCharacterSize(30);
roundName.setColor(sf::Color(255,255,255,200));
roundName.move(30, 700);
// monthName.move(400, 0);
setMonthName(1);
}
void GroupHud::setSeason(int seasonNumber){
seasonName.setString("Season: " + efc::seasonsNames[seasonNumber]);
-};
+}
void GroupHud::setRoundName(int roundNumber){
roundName.setString("Round: " + std::to_string(roundNumber));
-};
+}
void GroupHud::setMonthName(int monthNumber){
monthName.setString("Month: " + std::to_string(monthNumber));
-};
+}
void GroupHud::draw(sf::RenderTarget& target, sf::RenderStates states) const{
states.transform *= getTransform();
target.draw(seasonName, states);
target.draw(roundName, states);
// target.draw(monthName, states);
}
}
diff --git a/pagan_board.pro b/pagan_board.pro
index dbfe617..f63af47 100644
--- a/pagan_board.pro
+++ b/pagan_board.pro
@@ -1,79 +1,79 @@
TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt
CONFIG += c++11
SOURCES += main.cpp \
game.cpp \
tilemap.cpp \
selector.cpp \
playerhud.cpp \
boardelem.cpp \
boardelems.cpp \
textureholder.cpp \
hover.cpp \
guiwindow.cpp \
purchaseguielem.cpp \
guichoosebuilding.cpp \
rounddice.cpp \
guirounddice.cpp \
grouphud.cpp \
animation.cpp \
animatedsprite.cpp \
character.cpp \
data.cpp \
rotateelem.cpp \
boarddiamond.cpp \
boarddiamondseq.cpp \
elem.cpp \
soundfx.cpp \
card.cpp \
pile.cpp \
cardslist.cpp \
command.cpp \
cardsdeck.cpp
LIBS += -lsfml-window -lsfml-system -lsfml-graphics -lsfml-audio
DESTDIR = ../build_release_pagan_board
assets.path = $${DESTDIR}/assets
assets.files = assets/*
INSTALLS += assets
HEADERS += \
game.h \
tilemap.h \
selector.h \
playerhud.h \
boardelem.h \
boardelems.h \
textureholder.h \
hover.h \
guiwindow.h \
purchaseguielem.h \
guichoosebuilding.h \
elemsdescription.h \
rounddice.h \
guirounddice.h \
grouphud.h \
data.h \
animation.h \
animatedsprite.h \
character.h \
rotateelem.h \
boarddiamond.h \
boarddiamondseq.h \
elem.h \
soundfx.h \
card.h \
pile.h \
cardslist.h \
command.h \
cardsdeck.h
OTHER_FILES += \
CREDITS.md
-QMAKE_CXXFLAGS += -std=gnu++0x
+QMAKE_CXXFLAGS += -std=gnu++0x -Wpedantic
diff --git a/rotateelem.cpp b/rotateelem.cpp
index 4c64d30..22933d5 100644
--- a/rotateelem.cpp
+++ b/rotateelem.cpp
@@ -1,33 +1,31 @@
#include "rotateelem.h"
RotateElem::RotateElem()
{
if (!textureRotate.loadFromFile("assets/img/rotate.png"))
std::exit(1);
spriteRotate.setTexture(textureRotate);
spriteRotate.scale(0.4f,0.4f);
spriteRotate.setOrigin(32, 32);
}
void RotateElem::draw(sf::RenderTarget& target, sf::RenderStates states) const{
states.transform *= getTransform();
target.draw(spriteRotate, states);
}
void RotateElem::update(sf::Time deltaTime)
{
float speed;
speed = 0.05f/deltaTime.asSeconds();
spriteRotate.rotate(1.0f*speed);
}
- ;
-
void RotateElem::setColor(int playerNumber)
{
spriteRotate.setColor(efc::playersColors[playerNumber]);
}
diff --git a/textureholder.cpp b/textureholder.cpp
index 6142bfd..b8bf101 100644
--- a/textureholder.cpp
+++ b/textureholder.cpp
@@ -1,116 +1,116 @@
#include "textureholder.h"
namespace efc {
std::set<int> getTerrainSet() {
std::set<int> terrain;
for (int i: efc::terrainArray)
{
terrain.insert(i);
}
return terrain;
-};
+}
}
TextureHolder::TextureHolder()
{
if (!textureCardBases[0].loadFromFile("assets/img/card-water-2-diam_m.png"))
std::exit(1);
if (!textureCardBases[1].loadFromFile("assets/img/card-earth-2-diam_m.png"))
std::exit(1);
if (!textureCardBases[2].loadFromFile("assets/img/card-fire-2-diam_m.png"))
std::exit(1);
if (!textureCardBases[3].loadFromFile("assets/img/card-air-2-diam_m.png"))
std::exit(1);
if (!textureGameBackground.loadFromFile("assets/img/game-background.png"))
std::exit(1);
if (!textureTiles.loadFromFile("assets/img/zw-tilesets/_MAP.png"))
std::exit(1);
if (!textureFaces.loadFromFile("assets/img/faces.jpg"))
std::exit(1);
if (!textureGui.loadFromFile("assets/img/gui.png"))
std::exit(1);
if (!textureSymbols.loadFromFile("assets/img/symbols.png"))
std::exit(1);
if (!textureSeasons.loadFromFile("assets/img/seasons.png"))
std::exit(1);
if (!textureCharacters.loadFromFile("assets/img/characters.png"))
std::exit(1);
if (!backgroundDark.loadFromFile("assets/img/background_dark.png"))
std::exit(1);
if (!textureBoardDiamond.loadFromFile("assets/img/board_diamonds.png"))
std::exit(1);
if (!textureMenu.loadFromFile("assets/img/background_new.png"))
std::exit(1);
if (!textureLetsBegin.loadFromFile("assets/img/letsbegin.png"))
std::exit(1);
int defaultArray[5][8] = {
//Cash Food Energy Faith
{10, 2, 0, 0, 0, 0, 0, 0}, // base
{10, 1, 2, 0, 0, 5, 0, 0}, // windmill
{15, 0, 0, 2, 2, 0, 0, 0}, // granary
{20, 5, 4, 0, 4, 0, 0, 0}, // marketplace
{5, 0, 2, 0, 0, 0, 0, 2} // monasterium
};
int defaultFields[5] = {443, 651, 442, 585, 1100};
/*
* Array with description of the field
* global rule = even indexes are price, odd - monthly cost
* [0] - price in cash
* [1] - monthly cash cost
* [2] - price - in food
* [3] - monthly food cost
* [4] - price in energy
* [5] - monthly energy cost
* [6] - price in faith
* [7] - monthly cost in faith
*
*/
int counter = 0;
for (int i: defaultFields)
{
std::map<int, int> params;
for (int j=0;j<8;j++)
{
params.insert({j, defaultArray[counter][j]});
}
// params.insert({0, 10});
// params.insert({1, 2});
// params.insert({2, 10});
// params.insert({3, 0});
// params.insert({4, 10});
// params.insert({5, 0});
// params.insert({6, 0});
// params.insert({7, 0});
tilesDescription.insert({i, params});
counter++;
};
tilesTxt.insert({443, "Your base."});
tilesTxt.insert({651, "Windmill, produces energy.\nEnergy is a basic resource in a game,\nneeded by other buildings to running them."});
tilesTxt.insert({442, "Granary, food storehouse.\nFood gives your people ability to live.\nWithout the food your people will face\na death by starvation."});
tilesTxt.insert({585, "Marketplace, generates cash.\nProvides your tribe trading area.\nToday's offer - dog's bone."});
tilesTxt.insert({1100, "Monasterium, increase your faith.\nAs we all know, our world is being ruled\nby four ancient gods..."});
}

File Metadata

Mime Type
text/x-diff
Expires
Fri, Jun 19, 8:09 PM (1 w, 2 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
71520
Default Alt Text
(7 KB)

Event Timeline