#include <iostream>
#include <bitset>

class State{
public:
    //Observer
	std::string ToString() const { return state_.to_string();};
    //Getters
	bool MoveUp()    const{ return state_[0];};	
	bool MoveDown()  const{ return state_[1];};	
	bool MoveLeft()  const{ return state_[2];};	
	bool MoveRight() const{ return state_[3];};	
	bool Still()     const{ return state_[4];};	
	bool Jump()      const{ return state_[5];};	
    //Setters
	void MoveUp(bool on)    {state_[0] = on;}
	void MoveDown(bool on)  {state_[1] = on;}
	void MoveLeft(bool on)  {state_[2] = on;}
	void MoveRight(bool on) {state_[3] = on;}
	void Still(bool on)     {state_[4] = on;}
	void Jump(bool on)      {state_[5] = on;}
private:
	std::bitset<6> state_;
};


int main() {
	State s;
    auto report = [&s](std::string const& msg){
 	    std::cout<<msg<<" "<<s.ToString()<<std::endl;
    };
	report("initial value");
	s.MoveUp(true);
    report("move up set");
	s.MoveDown(true);
    report("move down set");
	s.MoveLeft(true);
    report("move left set");
	s.MoveRight(true);
    report("move right set");
	s.Still(true);
    report("still set");
	s.Jump(true);
    report("jump set");
	return 0;
}
