aboutsummaryrefslogtreecommitdiff
path: root/src/emerge.h
diff options
context:
space:
mode:
authorMaksim <MoNTE48@mail.ua>2020-04-17 23:46:30 +0200
committerGitHub <noreply@github.com>2020-04-17 23:46:30 +0200
commit23c6d0c31f2e0a4a6032b0afb02fab1d5f9c517b (patch)
treeadb28d4b6d40641e03d15746fc775885de1b0eca /src/emerge.h
parent4e2473ec493689c3bc7d619fe17ee31c7f20945b (diff)
downloadminetest-23c6d0c31f2e0a4a6032b0afb02fab1d5f9c517b.tar.gz
minetest-23c6d0c31f2e0a4a6032b0afb02fab1d5f9c517b.tar.bz2
minetest-23c6d0c31f2e0a4a6032b0afb02fab1d5f9c517b.zip
Android: fix handling non-latin characters on older Android devices (#9309)
Diffstat (limited to 'src/emerge.h')
0 files changed, 0 insertions, 0 deletions
n122'>122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146
/*
Minetest-c55
Copyright (C) 2011 celeron55, Perttu Ahola <celeron55@gmail.com>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#ifndef GAME_HEADER
#define GAME_HEADER

#include "common_irrlicht.h"
#include <string>
#include "keycode.h"

class KeyList : protected core::list<KeyPress>
{
	typedef core::list<KeyPress> super;
	typedef super::Iterator Iterator;
	typedef super::ConstIterator ConstIterator;

	virtual ConstIterator find(const KeyPress &key) const
	{
		ConstIterator f(begin());
		ConstIterator e(end());
		while (f!=e) {
			if (*f == key)
				return f;
			++f;
		}
		return e;
	}

	virtual Iterator find(const KeyPress &key)
	{
		Iterator f(begin());
		Iterator e(end());
		while (f!=e) {
			if (*f == key)
				return f;
			++f;
		}
		return e;
	}

public:
	void clear() { super::clear(); }

	void set(const KeyPress &key)
	{
		if (find(key) == end())
			push_back(key);
	}

	void unset(const KeyPress &key)