Removed unused iterator code

This commit is contained in:
Ingo Ruhnke 2010-12-15 12:31:44 +01:00
parent 114caf2b9d
commit e5616106b6
2 changed files with 2 additions and 81 deletions

2
TODO
View file

@ -15,6 +15,8 @@ git push --tags
Stuff to do before 0.6.0 release:
=================================
* add shifting to axis
* write documentation for --ui-new
* --ui-new must reset events to neutral when switching input mapping

View file

@ -39,87 +39,6 @@ public:
ButtonEvent lookup(XboxButton shift_code, XboxButton code) const;
void clear();
template<class Pred>
bool contains(const Pred& pred)
{
for(int shift_code = 0; shift_code < XBOX_BTN_MAX; ++shift_code)
{
for(int code = 0; code < XBOX_BTN_MAX; ++code)
{
if (pred(btn_map[shift_code][code]))
{
return true;
}
}
}
return false;
}
// FIXME: use boost::iterator_apdator or a template to make this
// prettier and allow proper const, non-const versions
struct iterator
{
friend class ButtonMap;
private:
ButtonMap& btn_map;
int j;
int i;
iterator(ButtonMap& btn_map_) :
btn_map(btn_map_),
j(0),
i(0)
{}
iterator(ButtonMap& btn_map_, int j_, int i_) :
btn_map(btn_map_),
j(j_),
i(i_)
{}
public:
void operator++()
{
assert(j < XBOX_BTN_MAX);
i += 1;
if (i == XBOX_BTN_MAX)
{
i = 0;
j += 1;
}
}
const ButtonEvent& operator*() const
{
return btn_map.btn_map[j][i];
}
const ButtonEvent& operator->() const
{
return btn_map.btn_map[j][i];
}
ButtonEvent& operator*()
{
return btn_map.btn_map[j][i];
}
ButtonEvent& operator->()
{
return btn_map.btn_map[j][i];
}
bool operator!=(const iterator& rhs) const
{
assert(&btn_map == &rhs.btn_map);
return (j != rhs.j || i != rhs.i);
}
};
iterator begin() { return iterator(*this); }
iterator end() { return iterator(*this, XBOX_BTN_MAX, 0); }
};
#endif