Beispiel #1
0
	void MouseState::operator=(const MouseState& other)
	{
		for (sf::Mouse::Button btn = sf::Mouse::Button(0); btn < sf::Mouse::Button::ButtonCount; btn = sf::Mouse::Button(int(btn) + 1))
		{
			std::map<sf::Mouse::Button, bool>::const_iterator it = other.m_buttonState.find(btn);
			if (it != other.m_buttonState.end())
			{
				m_buttonState[btn] = it->second;
			}
			else
			{
				m_buttonState[btn] = false;
			}
		}
		m_x = other.x();
		m_y = other.y();
	}