Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F627624
elem.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
elem.cpp
View Options
#include
"elem.h"
Elem
::
Elem
()
{
boardPosition
=
-1
;
}
/*!
* \brief Character::getBoardPosition
* \return
*/
int
Elem
::
getBoardPosition
()
{
sf
::
Vector2f
currentPos
(
getPosition
());
sf
::
Vector2i
currentCords
(
efc
::
getCords
(
currentPos
));
int
currentBoardPosition
=
efc
::
transCords
(
currentCords
);
return
currentBoardPosition
;
}
/*!
* \brief Character::setBoardPosition
* \param boardPosition
*/
void
Elem
::
setBoardPosition
(
int
boardPosition
)
{
sf
::
Vector2i
neededCords
(
efc
::
transPosition
(
boardPosition
));
sf
::
Vector2f
newPos
(
efc
::
getScreenPos
(
neededCords
));
setPosition
(
newPos
.
x
,
newPos
.
y
);
this
->
boardPosition
=
boardPosition
;
// std::array<int,2> movements(getMovements(diceResult));
// std::cout << "board pos >> " << boardPosition << " cords >>" << neededCords.x << " " << neededCords.y
// << "newpos >> " << newPos.x << " " << newPos.y << " "
// << "movements >> " << movements[0] << " " << movements[1]
// << std::endl;
sf
::
Vector2i
newVecPos
(
getPosition
());
// sf::FloatRect newSize(getGlobalBounds());
float
newX
=
newVecPos
.
x
+
(
efc
::
TILE_SIZE
/
3
);
// newX = newX - (newSize.width);
setPosition
(
newX
,
newPos
.
y
);
move
(
202
,
76
);
}
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Sun, Nov 15, 2:25 AM (1 d, 22 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
113265
Default Alt Text
elem.cpp (1 KB)
Attached To
Mode
R82 deerportal
Attached
Detach File
Event Timeline