Page MenuHomePhabricator (Chris)

boardelems.cpp
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

boardelems.cpp

#include "boardelems.h"
BoardElems::BoardElems()
{
active = false;
displayNeighbours = true;
}
void BoardElems::draw(sf::RenderTarget& target, sf::RenderStates states) const
{
std::set<int> neighboursAll;
states.transform *= getTransform();
sf::BlendMode blendmode = sf::BlendAlpha;
states.blendMode = blendmode;
for (const efc::BoardElem &i: items)
{
target.draw(i, states);
std::set<int> neighbours(efc::getNeighbours(i.pos));
if ((active==true) && (displayNeighbours==true))
{
for (int j: neighbours)
{
if (items_map.count(j)==0)
{
neighboursAll.insert(j);
// sf::RectangleShape sprite(efc::createNeighbour(j));
// target.draw(sprite, states);
}
}
}
}
if (active==true)
{
for (int j: neighboursAll)
{
if (items_map.count(j)==0)
{
sf::RectangleShape sprite(efc::createNeighbour(j));
target.draw(sprite, states);
}
}
}
}

File Metadata

Mime Type
text/x-c
Expires
Sat, Aug 15, 11:17 PM (1 d, 14 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
77337
Default Alt Text
boardelems.cpp (1 KB)

Event Timeline