Page MenuHomePhabricator (Chris)

elem.cpp
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

elem.cpp

#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

Mime Type
text/x-c
Expires
Sat, Nov 14, 11:29 PM (1 d, 12 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
113265
Default Alt Text
elem.cpp (1 KB)

Event Timeline