2016-03-08 21:49:52 +00:00
|
|
|
#include "block.hpp"
|
2016-03-08 16:46:33 +00:00
|
|
|
|
2016-03-08 17:07:34 +00:00
|
|
|
void Block::draw(sf::RenderWindow& window) {
|
2016-03-12 10:22:10 +00:00
|
|
|
|
|
|
|
//chargement de la texture de test
|
|
|
|
if (!texture.loadFromFile("./Images/texture_test.jpeg"))
|
|
|
|
{
|
|
|
|
//erreur
|
|
|
|
}
|
|
|
|
shape.setTexture(&texture);
|
|
|
|
|
2016-03-11 15:15:27 +00:00
|
|
|
if (charge > 0) {
|
|
|
|
shape.setFillColor(sf::Color(0, 0, 255));
|
|
|
|
} else if (charge < 0) {
|
|
|
|
shape.setFillColor(sf::Color(255, 0, 0));
|
|
|
|
} else {
|
2016-03-12 10:22:10 +00:00
|
|
|
shape.setFillColor(sf::Color(75, 75, 75));
|
2016-03-11 15:15:27 +00:00
|
|
|
}
|
|
|
|
|
2016-03-11 14:16:46 +00:00
|
|
|
shape.setPosition(position);
|
2016-03-10 21:16:07 +00:00
|
|
|
window.draw(shape);
|
2016-03-12 10:22:10 +00:00
|
|
|
|
|
|
|
|
2016-03-08 17:07:34 +00:00
|
|
|
}
|
2016-03-08 18:50:55 +00:00
|
|
|
|
|
|
|
void Block::update(State state) {
|
|
|
|
// rien à mettre à jour
|
|
|
|
}
|