aboutsummaryrefslogtreecommitdiff
path: root/src/nameidmapping.h
blob: 417c441d23a7e1f0d486b70f9f74a5ec755053c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
Minetest
Copyright (C) 2013 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 Lesser General Public License as published by
the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.

You should have received a copy of the GNU Lesser 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 NAMEIDMAPPING_HEADER
#define NAMEIDMAPPING_HEADER

#include <string>
#include <iostream>
#include <set>
#include <map>
#include "irrlichttypes_bloated.h"

class NameIdMapping
{
public:
	void serialize(std::ostream &os) const;
	void deSerialize(std::istream &is);
	
	void clear(){
		m_id_to_name.clear();
		m_name_to_id.clear();
	}
	void set(u16 id, const std::string &name){
		m_id_to_name[id] = name;
		m_name_to_id[name] = id;
	}
	void removeId(u16 id){
		std::string name;
		bool found = getName(id, name);
		if(!found) return;
		m_id_to_name.erase(id);
		m_name_to_id.erase(name);
	}
	void eraseName(const std::string &name){
		u16 id;
		bool found = getId(name, id);
		if(!found) return;
		m_id_to_name.erase(id);
		m_name_to_id.erase(name);
	}
	bool getName(u16 id, std::string &result) const{
		std::map<u16, std::string>::const_iterator i;
		i = m_id_to_name.find(id);
		if(i == m_id_to_name.end())
			return false;
		result = i->second;
		return true;
	}
	bool getId(const std::string &name, u16 &result) const{
		std::map<std::string, u16>::const_iterator i;
		i = m_name_to_id.find(name);
		if(i == m_name_to_id.end())
			return false;
		result = i->second;
		return true;
	}
	u16 size() const{
		return m_id_to_name.size();
	}
private:
	std::map<u16, std::string> m_id_to_name;
	std::map<std::string, u16> m_name_to_id;
};

#endif

id='n350' href='#n350'>350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: minetest\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-05-13 18:26+0200\n"
"PO-Revision-Date: 2013-05-29 01:59+0200\n"
"Last-Translator: manuel joaquim <ffrogger0@yahoo.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: pt\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Weblate 1.4-dev\n"

#: src/client.cpp:2846
msgid "Item textures..."
msgstr "Texturas dos itens..."

#: src/game.cpp:912
msgid "Loading..."
msgstr "A carregar..."

#: src/game.cpp:972
msgid "Creating server...."
msgstr "A criar servidor..."

#: src/game.cpp:988
msgid "Creating client..."
msgstr "A criar cliente..."

#: src/game.cpp:1003
msgid "Resolving address..."
msgstr "A resolver endereço..."

#: src/game.cpp:1079
msgid "Connecting to server..."
msgstr "A ligar ao servidor..."

#: src/game.cpp:3348
msgid "Shutting down stuff..."
msgstr "A desligar..."

#: src/game.cpp:3378 src/guiConfigureWorld.cpp:426
msgid ""
"\n"
"Check debug.txt for details."
msgstr ""
"\n"
"Consulte debug.txt para mais detalhes."

#: src/guiConfigureWorld.cpp:123
msgid ""
"Warning: Some mods are not configured yet.\n"
"They will be enabled by default when you save the configuration.  "
msgstr ""
"Atenção: Alguns mods ainda não estão configurados.\n"
"Eles vão ser ativados por predefinição quando guardar a configuração.  "

#: src/guiConfigureWorld.cpp:143
msgid ""
"Warning: Some configured mods are missing.\n"
"Their setting will be removed when you save the configuration.  "
msgstr ""
"Atenção: Alguns mods configurados estão em falta.\n"
"As suas definições vão ser removidas quando gravar a configuração.  "

#: src/guiConfigureWorld.cpp:208
msgid "enabled"
msgstr "ativo"

#: src/guiConfigureWorld.cpp:218
msgid "Enable All"
msgstr "Ativar Tudo"

#: src/guiConfigureWorld.cpp:227
msgid "Disable All"
msgstr "Desativar Tudo"

#: src/guiConfigureWorld.cpp:235
msgid "depends on:"
msgstr "depende de:"

#: src/guiConfigureWorld.cpp:248
msgid "is required by:"
msgstr "é necessário pelo:"

#: src/guiConfigureWorld.cpp:270 src/guiCreateWorld.cpp:177
#: src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223
msgid "Cancel"
msgstr "Cancelar"

#: src/guiConfigureWorld.cpp:277 src/guiKeyChangeMenu.cpp:187
msgid "Save"
msgstr "Guardar"

#: src/guiConfigureWorld.cpp:403
msgid "Configuration saved.  "
msgstr "Configuração gravada.  "

#: src/guiConfigureWorld.cpp:415
msgid "Warning: Configuration not consistent.  "
msgstr "Atenção: Configuração não compatível.  "

#: src/guiConfirmMenu.cpp:119
msgid "Yes"
msgstr "Sim"

#: src/guiConfirmMenu.cpp:127
msgid "No"
msgstr "Não"

#: src/guiCreateWorld.cpp:125
msgid "World name"
msgstr "Nome do Mundo"

#: src/guiCreateWorld.cpp:145
msgid "Game"
msgstr "Jogo"

#: src/guiCreateWorld.cpp:169
msgid "Create"
msgstr "Criar"

#: src/guiDeathScreen.cpp:96
msgid "You died."
msgstr "Morreste."

#: src/guiDeathScreen.cpp:104
msgid "Respawn"
msgstr "Reaparecer"

#: src/guiFormSpecMenu.cpp:582
msgid "Left click: Move all items, Right click: Move single item"
msgstr "Botão esq.: Mover todos os itens, Botão dir.: Mover um item"

#: src/guiFormSpecMenu.cpp:608 src/guiMessageMenu.cpp:107
#: src/guiTextInputMenu.cpp:130
msgid "Proceed"
msgstr "Continuar"

#: src/guiKeyChangeMenu.cpp:121
msgid "Keybindings. (If this menu screws up, remove stuff from minetest.conf)"
msgstr "Teclas. (Se este menu se estragar, remova as linhas do minetest.conf)"

#: src/guiKeyChangeMenu.cpp:161
msgid "\"Use\" = climb down"
msgstr "\"Use\" = descer"

#: src/guiKeyChangeMenu.cpp:176
msgid "Double tap \"jump\" to toggle fly"
msgstr "Carregue duas vezes em \"saltar\" para ativar o vôo"

#: src/guiKeyChangeMenu.cpp:290
msgid "Key already in use"
msgstr "Tecla já em uso"

#: src/guiKeyChangeMenu.cpp:372
msgid "press key"
msgstr "pressione a tecla"

#: src/guiKeyChangeMenu.cpp:400
msgid "Forward"
msgstr "Avançar"

#: src/guiKeyChangeMenu.cpp:401
msgid "Backward"
msgstr "Recuar"

#: src/guiKeyChangeMenu.cpp:402 src/keycode.cpp:228
msgid "Left"
msgstr "Esquerda"

#: src/guiKeyChangeMenu.cpp:403 src/keycode.cpp:228
msgid "Right"
msgstr "Direita"

#: src/guiKeyChangeMenu.cpp:404
msgid "Use"
msgstr "Usar"

#: src/guiKeyChangeMenu.cpp:405
msgid "Jump"
msgstr "Saltar"

#: src/guiKeyChangeMenu.cpp:406
msgid "Sneak"
msgstr "Agachar"

#: src/guiKeyChangeMenu.cpp:407
msgid "Drop"
msgstr "Largar"

#: src/guiKeyChangeMenu.cpp:408
msgid "Inventory"
msgstr "Inventário"

#: src/guiKeyChangeMenu.cpp:409
msgid "Chat"
msgstr "Conversa"

#: src/guiKeyChangeMenu.cpp:410
msgid "Command"
msgstr "Comando"

#: src/guiKeyChangeMenu.cpp:411
msgid "Console"
msgstr "Consola"

#: src/guiKeyChangeMenu.cpp:412
msgid "Toggle fly"
msgstr "Ativar/Desativar vôo"

#: src/guiKeyChangeMenu.cpp:413
msgid "Toggle fast"
msgstr "Ativar/Desativar correr"

#: src/guiKeyChangeMenu.cpp:414
msgid "Toggle noclip"
msgstr "Ativar/Desativar noclip"

#: src/guiKeyChangeMenu.cpp:415
msgid "Range select"
msgstr "Seleccionar Distância"

#: src/guiKeyChangeMenu.cpp:416
msgid "Print stacks"
msgstr "Imprimir stacks"

#: src/guiMainMenu.cpp:92
msgid "Cannot create world: Name contains invalid characters"
msgstr "Não foi possível criar mundo: Nome com caracteres inválidos"

#: src/guiMainMenu.cpp:103
msgid "Cannot create world: A world by this name already exists"
msgstr "Não foi possível criar mundo: Já existe um mundo com este nome"

#: src/guiMainMenu.cpp:285
msgid "Singleplayer"
msgstr "Um Jogador"

#: src/guiMainMenu.cpp:288
msgid "Multiplayer"
msgstr "Multiplayer"

#: src/guiMainMenu.cpp:291
msgid "Advanced"
msgstr "Avançado"

#: src/guiMainMenu.cpp:294
msgid "Settings"
msgstr "Definições"

#: src/guiMainMenu.cpp:297
msgid "Credits"
msgstr "Créditos"

#: src/guiMainMenu.cpp:330
msgid "Select World:"
msgstr "Seleccionar Mundo:"

#: src/guiMainMenu.cpp:360 src/guiMainMenu.cpp:578 src/keycode.cpp:229
msgid "Delete"
msgstr "Eliminar"

#: src/guiMainMenu.cpp:369
msgid "New"
msgstr "Novo"

#: src/guiMainMenu.cpp:379
msgid "Configure"
msgstr "Configurar"

#: src/guiMainMenu.cpp:396 src/keycode.cpp:248
msgid "Play"
msgstr "Jogar"

#: src/guiMainMenu.cpp:409 src/guiMainMenu.cpp:699
msgid "Creative Mode"
msgstr "Modo Criativo"

#: src/guiMainMenu.cpp:417 src/guiMainMenu.cpp:707
msgid "Enable Damage"
msgstr "Ativar Dano"

#: src/guiMainMenu.cpp:459 src/guiMainMenu.cpp:614
msgid "Name/Password"
msgstr "Nome/Senha"

#: src/guiMainMenu.cpp:498 src/guiMainMenu.cpp:519 src/guiMainMenu.cpp:1324
msgid "Favorites:"
msgstr "Favoritos:"

#: src/guiMainMenu.cpp:508 src/guiMainMenu.cpp:1338
msgid "Public Server List:"
msgstr "Lista de servidores públicos:"

#: src/guiMainMenu.cpp:532 src/guiMainMenu.cpp:643
msgid "Address/Port"
msgstr "Endereço/Porta"

#: src/guiMainMenu.cpp:560 src/guiMainMenu.cpp:1323
msgid "Show Public"
msgstr "Mostrar Públicos"

#: src/guiMainMenu.cpp:567 src/guiMainMenu.cpp:1337
msgid "Show Favorites"
msgstr "Mostrar Favoritos"

#: src/guiMainMenu.cpp:591
msgid "Connect"
msgstr "Ligar"

#: src/guiMainMenu.cpp:668
msgid "Leave address blank to start a local server."
msgstr "Deixe endereço em branco para iniciar servidor local."

#: src/guiMainMenu.cpp:678
msgid "Start Game / Connect"
msgstr "Iniciar Jogo / Conectar"

#: src/guiMainMenu.cpp:716
msgid "Public"
msgstr "Público"

#: src/guiMainMenu.cpp:726 src/guiMainMenu.cpp:1245
msgid "Delete world"
msgstr "Eliminar mundo"

#: src/guiMainMenu.cpp:735
msgid "Create world"
msgstr "Criar mundo"

#: src/guiMainMenu.cpp:773
msgid "Fancy trees"
msgstr "Árvores Melhoradas"

#: src/guiMainMenu.cpp:781
msgid "Smooth Lighting"
msgstr "Iluminação Suave"

#: src/guiMainMenu.cpp:789
msgid "3D Clouds"
msgstr "Nuvens 3D"

#: src/guiMainMenu.cpp:797
msgid "Opaque water"
msgstr "Água Opaca"

#: src/guiMainMenu.cpp:809
msgid "Mip-Mapping"
msgstr "Mip-Mapping"

#: src/guiMainMenu.cpp:818