Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F627859
boardelems.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
boardelems.cpp
View Options
#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
Details
Attached
Mime Type
text/x-c
Expires
Sun, Nov 15, 2:52 AM (1 d, 22 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
131645
Default Alt Text
boardelems.cpp (1 KB)
Attached To
Mode
R82 deerportal
Attached
Detach File
Event Timeline