mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-05-09 00:38:55 +00:00
refactor: unglob std::pair
This commit is contained in:
parent
e918160231
commit
e506b8fe7a
|
|
@ -291,14 +291,14 @@ bool TexturePackRepository::canUseWebSkin()
|
|||
return false;
|
||||
}
|
||||
|
||||
std::vector< pair<DWORD,std::wstring> > *TexturePackRepository::getTexturePackIdNames()
|
||||
std::vector< std::pair<DWORD,std::wstring> > *TexturePackRepository::getTexturePackIdNames()
|
||||
{
|
||||
std::vector< pair<DWORD,std::wstring> > *packList = new std::vector< pair<DWORD,std::wstring> >();
|
||||
std::vector< std::pair<DWORD,std::wstring> > *packList = new std::vector< std::pair<DWORD,std::wstring> >();
|
||||
|
||||
for(AUTO_VAR(it,texturePacks->begin()); it != texturePacks->end(); ++it)
|
||||
{
|
||||
TexturePack *pack = *it;
|
||||
packList->push_back( pair<DWORD,std::wstring>(pack->getId(),pack->getName()) );
|
||||
packList->push_back( std::pair<DWORD,std::wstring>(pack->getId(),pack->getName()) );
|
||||
}
|
||||
return packList;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ public:
|
|||
bool isUsingDefaultSkin() { return selected == DEFAULT_TEXTURE_PACK; } // 4J Added
|
||||
TexturePack *getDefault() { return DEFAULT_TEXTURE_PACK; } // 4J Added
|
||||
|
||||
std::vector< pair<DWORD,std::wstring> > *getTexturePackIdNames();
|
||||
std::vector< std::pair<DWORD,std::wstring> > *getTexturePackIdNames();
|
||||
bool selectTexturePackById(DWORD id); // 4J Added
|
||||
TexturePack *getTexturePackById(DWORD id); // 4J Added
|
||||
|
||||
|
|
|
|||
|
|
@ -363,11 +363,11 @@ void PreStitchedTextureMap::loadUVs()
|
|||
texturesByName.insert(stringIconMap::value_type(L"compassP1",new SimpleIcon(L"compassP1",slotSize*8,slotSize*14,slotSize*(8+1),slotSize*(14+1))));
|
||||
texturesByName.insert(stringIconMap::value_type(L"compassP2",new SimpleIcon(L"compassP2",slotSize*9,slotSize*14,slotSize*(9+1),slotSize*(14+1))));
|
||||
texturesByName.insert(stringIconMap::value_type(L"compassP3",new SimpleIcon(L"compassP3",slotSize*10,slotSize*14,slotSize*(10+1),slotSize*(14+1))));
|
||||
texturesToAnimate.push_back(pair<std::wstring, std::wstring>(L"compass",L"compass"));
|
||||
texturesToAnimate.push_back(pair<std::wstring, std::wstring>(L"compassP0",L"compass"));
|
||||
texturesToAnimate.push_back(pair<std::wstring, std::wstring>(L"compassP1",L"compass"));
|
||||
texturesToAnimate.push_back(pair<std::wstring, std::wstring>(L"compassP2",L"compass"));
|
||||
texturesToAnimate.push_back(pair<std::wstring, std::wstring>(L"compassP3",L"compass"));
|
||||
texturesToAnimate.push_back(std::pair<std::wstring, std::wstring>(L"compass",L"compass"));
|
||||
texturesToAnimate.push_back(std::pair<std::wstring, std::wstring>(L"compassP0",L"compass"));
|
||||
texturesToAnimate.push_back(std::pair<std::wstring, std::wstring>(L"compassP1",L"compass"));
|
||||
texturesToAnimate.push_back(std::pair<std::wstring, std::wstring>(L"compassP2",L"compass"));
|
||||
texturesToAnimate.push_back(std::pair<std::wstring, std::wstring>(L"compassP3",L"compass"));
|
||||
texturesByName.insert(stringIconMap::value_type(L"diamond",new SimpleIcon(L"diamond",slotSize*7,slotSize*3,slotSize*(7+1),slotSize*(3+1))));
|
||||
texturesByName.insert(stringIconMap::value_type(L"redstone",new SimpleIcon(L"redstone",slotSize*8,slotSize*3,slotSize*(8+1),slotSize*(3+1))));
|
||||
texturesByName.insert(stringIconMap::value_type(L"clay",new SimpleIcon(L"clay",slotSize*9,slotSize*3,slotSize*(9+1),slotSize*(3+1))));
|
||||
|
|
@ -388,11 +388,11 @@ void PreStitchedTextureMap::loadUVs()
|
|||
texturesByName.insert(stringIconMap::value_type(L"clockP1",new SimpleIcon(L"clockP1",slotSize*12,slotSize*14,slotSize*(12+1),slotSize*(14+1))));
|
||||
texturesByName.insert(stringIconMap::value_type(L"clockP2",new SimpleIcon(L"clockP2",slotSize*13,slotSize*14,slotSize*(13+1),slotSize*(14+1))));
|
||||
texturesByName.insert(stringIconMap::value_type(L"clockP3",new SimpleIcon(L"clockP3",slotSize*14,slotSize*14,slotSize*(14+1),slotSize*(14+1))));
|
||||
texturesToAnimate.push_back(pair<std::wstring, std::wstring>(L"clock",L"clock"));
|
||||
texturesToAnimate.push_back(pair<std::wstring, std::wstring>(L"clockP0",L"clock"));
|
||||
texturesToAnimate.push_back(pair<std::wstring, std::wstring>(L"clockP1",L"clock"));
|
||||
texturesToAnimate.push_back(pair<std::wstring, std::wstring>(L"clockP2",L"clock"));
|
||||
texturesToAnimate.push_back(pair<std::wstring, std::wstring>(L"clockP3",L"clock"));
|
||||
texturesToAnimate.push_back(std::pair<std::wstring, std::wstring>(L"clock",L"clock"));
|
||||
texturesToAnimate.push_back(std::pair<std::wstring, std::wstring>(L"clockP0",L"clock"));
|
||||
texturesToAnimate.push_back(std::pair<std::wstring, std::wstring>(L"clockP1",L"clock"));
|
||||
texturesToAnimate.push_back(std::pair<std::wstring, std::wstring>(L"clockP2",L"clock"));
|
||||
texturesToAnimate.push_back(std::pair<std::wstring, std::wstring>(L"clockP3",L"clock"));
|
||||
texturesByName.insert(stringIconMap::value_type(L"bowl",new SimpleIcon(L"bowl",slotSize*7,slotSize*4,slotSize*(7+1),slotSize*(4+1))));
|
||||
texturesByName.insert(stringIconMap::value_type(L"mushroomStew",new SimpleIcon(L"mushroomStew",slotSize*8,slotSize*4,slotSize*(8+1),slotSize*(4+1))));
|
||||
texturesByName.insert(stringIconMap::value_type(L"yellowDust",new SimpleIcon(L"yellowDust",slotSize*9,slotSize*4,slotSize*(9+1),slotSize*(4+1))));
|
||||
|
|
@ -607,7 +607,7 @@ void PreStitchedTextureMap::loadUVs()
|
|||
texturesByName.insert(stringIconMap::value_type(L"rose",new SimpleIcon(L"rose",slotSize*12,slotSize*0,slotSize*(12+1),slotSize*(0+1))));
|
||||
texturesByName.insert(stringIconMap::value_type(L"flower",new SimpleIcon(L"flower",slotSize*13,slotSize*0,slotSize*(13+1),slotSize*(0+1))));
|
||||
texturesByName.insert(stringIconMap::value_type(L"portal",new SimpleIcon(L"portal",slotSize*14,slotSize*0,slotSize*(14+1),slotSize*(0+1))));
|
||||
texturesToAnimate.push_back(pair<std::wstring, std::wstring>(L"portal",L"portal"));
|
||||
texturesToAnimate.push_back(std::pair<std::wstring, std::wstring>(L"portal",L"portal"));
|
||||
texturesByName.insert(stringIconMap::value_type(L"sapling",new SimpleIcon(L"sapling",slotSize*15,slotSize*0,slotSize*(15+1),slotSize*(0+1))));
|
||||
texturesByName.insert(stringIconMap::value_type(L"stonebrick",new SimpleIcon(L"stonebrick",slotSize*0,slotSize*1,slotSize*(0+1),slotSize*(1+1))));
|
||||
texturesByName.insert(stringIconMap::value_type(L"bedrock",new SimpleIcon(L"bedrock",slotSize*1,slotSize*1,slotSize*(1+1),slotSize*(1+1))));
|
||||
|
|
@ -625,7 +625,7 @@ void PreStitchedTextureMap::loadUVs()
|
|||
texturesByName.insert(stringIconMap::value_type(L"mushroom_brown",new SimpleIcon(L"mushroom_brown",slotSize*13,slotSize*1,slotSize*(13+1),slotSize*(1+1))));
|
||||
texturesByName.insert(stringIconMap::value_type(L"sapling_jungle",new SimpleIcon(L"sapling_jungle",slotSize*14,slotSize*1,slotSize*(14+1),slotSize*(1+1))));
|
||||
texturesByName.insert(stringIconMap::value_type(L"fire_0",new SimpleIcon(L"fire_0",slotSize*15,slotSize*1,slotSize*(15+1),slotSize*(1+1))));
|
||||
texturesToAnimate.push_back(pair<std::wstring, std::wstring>(L"fire_0",L"fire_0"));
|
||||
texturesToAnimate.push_back(std::pair<std::wstring, std::wstring>(L"fire_0",L"fire_0"));
|
||||
texturesByName.insert(stringIconMap::value_type(L"oreGold",new SimpleIcon(L"oreGold",slotSize*0,slotSize*2,slotSize*(0+1),slotSize*(2+1))));
|
||||
texturesByName.insert(stringIconMap::value_type(L"oreIron",new SimpleIcon(L"oreIron",slotSize*1,slotSize*2,slotSize*(1+1),slotSize*(2+1))));
|
||||
texturesByName.insert(stringIconMap::value_type(L"oreCoal",new SimpleIcon(L"oreCoal",slotSize*2,slotSize*2,slotSize*(2+1),slotSize*(2+1))));
|
||||
|
|
@ -642,7 +642,7 @@ void PreStitchedTextureMap::loadUVs()
|
|||
texturesByName.insert(stringIconMap::value_type(L"furnace_side",new SimpleIcon(L"furnace_side",slotSize*13,slotSize*2,slotSize*(13+1),slotSize*(2+1))));
|
||||
texturesByName.insert(stringIconMap::value_type(L"dispenser_front",new SimpleIcon(L"dispenser_front",slotSize*14,slotSize*2,slotSize*(14+1),slotSize*(2+1))));
|
||||
texturesByName.insert(stringIconMap::value_type(L"fire_1",new SimpleIcon(L"fire_1",slotSize*15,slotSize*1,slotSize*(15+1),slotSize*(1+1))));
|
||||
texturesToAnimate.push_back(pair<std::wstring, std::wstring>(L"fire_1",L"fire_1"));
|
||||
texturesToAnimate.push_back(std::pair<std::wstring, std::wstring>(L"fire_1",L"fire_1"));
|
||||
texturesByName.insert(stringIconMap::value_type(L"sponge",new SimpleIcon(L"sponge",slotSize*0,slotSize*3,slotSize*(0+1),slotSize*(3+1))));
|
||||
texturesByName.insert(stringIconMap::value_type(L"glass",new SimpleIcon(L"glass",slotSize*1,slotSize*3,slotSize*(1+1),slotSize*(3+1))));
|
||||
texturesByName.insert(stringIconMap::value_type(L"oreDiamond",new SimpleIcon(L"oreDiamond",slotSize*2,slotSize*3,slotSize*(2+1),slotSize*(3+1))));
|
||||
|
|
@ -803,9 +803,9 @@ void PreStitchedTextureMap::loadUVs()
|
|||
texturesByName.insert(stringIconMap::value_type(L"potatoes_2",new SimpleIcon(L"potatoes_2",slotSize*10,slotSize*12,slotSize*(10+1),slotSize*(12+1))));
|
||||
texturesByName.insert(stringIconMap::value_type(L"potatoes_3",new SimpleIcon(L"potatoes_3",slotSize*12,slotSize*12,slotSize*(12+1),slotSize*(12+1))));
|
||||
texturesByName.insert(stringIconMap::value_type(L"water",new SimpleIcon(L"water",slotSize*13,slotSize*12,slotSize*(13+1),slotSize*(12+1))));
|
||||
texturesToAnimate.push_back(pair<std::wstring, std::wstring>(L"water",L"water"));
|
||||
texturesToAnimate.push_back(std::pair<std::wstring, std::wstring>(L"water",L"water"));
|
||||
texturesByName.insert(stringIconMap::value_type(L"water_flow",new SimpleIcon(L"water_flow",slotSize*14,slotSize*12,slotSize*(14+2),slotSize*(12+2))));
|
||||
texturesToAnimate.push_back(pair<std::wstring, std::wstring>(L"water_flow",L"water_flow"));
|
||||
texturesToAnimate.push_back(std::pair<std::wstring, std::wstring>(L"water_flow",L"water_flow"));
|
||||
texturesByName.insert(stringIconMap::value_type(L"sandstone_bottom",new SimpleIcon(L"sandstone_bottom",slotSize*0,slotSize*13,slotSize*(0+1),slotSize*(13+1))));
|
||||
texturesByName.insert(stringIconMap::value_type(L"cloth_9",new SimpleIcon(L"cloth_9",slotSize*1,slotSize*13,slotSize*(1+1),slotSize*(13+1))));
|
||||
texturesByName.insert(stringIconMap::value_type(L"cloth_1",new SimpleIcon(L"cloth_1",slotSize*2,slotSize*13,slotSize*(2+1),slotSize*(13+1))));
|
||||
|
|
@ -834,9 +834,9 @@ void PreStitchedTextureMap::loadUVs()
|
|||
texturesByName.insert(stringIconMap::value_type(L"quartzblock_side",new SimpleIcon(L"quartzblock_side",slotSize*11,slotSize*14,slotSize*(11+1),slotSize*(14+1))));
|
||||
texturesByName.insert(stringIconMap::value_type(L"hopper_inside",new SimpleIcon(L"hopper_inside",slotSize*12,slotSize*14,slotSize*(12+1),slotSize*(14+1))));
|
||||
texturesByName.insert(stringIconMap::value_type(L"lava",new SimpleIcon(L"lava",slotSize*13,slotSize*14,slotSize*(13+1),slotSize*(14+1))));
|
||||
texturesToAnimate.push_back(pair<std::wstring, std::wstring>(L"lava",L"lava"));
|
||||
texturesToAnimate.push_back(std::pair<std::wstring, std::wstring>(L"lava",L"lava"));
|
||||
texturesByName.insert(stringIconMap::value_type(L"lava_flow",new SimpleIcon(L"lava_flow",slotSize*14,slotSize*14,slotSize*(14+2),slotSize*(14+2))));
|
||||
texturesToAnimate.push_back(pair<std::wstring, std::wstring>(L"lava_flow",L"lava_flow"));
|
||||
texturesToAnimate.push_back(std::pair<std::wstring, std::wstring>(L"lava_flow",L"lava_flow"));
|
||||
texturesByName.insert(stringIconMap::value_type(L"destroy_0",new SimpleIcon(L"destroy_0",slotSize*0,slotSize*15,slotSize*(0+1),slotSize*(15+1))));
|
||||
texturesByName.insert(stringIconMap::value_type(L"destroy_1",new SimpleIcon(L"destroy_1",slotSize*1,slotSize*15,slotSize*(1+1),slotSize*(15+1))));
|
||||
texturesByName.insert(stringIconMap::value_type(L"destroy_2",new SimpleIcon(L"destroy_2",slotSize*2,slotSize*15,slotSize*(2+1),slotSize*(15+1))));
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ private:
|
|||
Texture *stitchResult;
|
||||
std::vector<StitchedTexture *> animatedTextures; // = new ArrayList<StitchedTexture>();
|
||||
|
||||
std::vector<pair<std::wstring, std::wstring> > texturesToAnimate;
|
||||
std::vector<std::pair<std::wstring, std::wstring> > texturesToAnimate;
|
||||
|
||||
void loadUVs();
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -189,7 +189,7 @@ void StitchedTexture::cycleFrames()
|
|||
{
|
||||
if (frameOverride != NULL)
|
||||
{
|
||||
pair<int, int> current = frameOverride->at(frame);
|
||||
std::pair<int, int> current = frameOverride->at(frame);
|
||||
subFrame++;
|
||||
if (subFrame >= current.second)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ protected:
|
|||
std::vector<Texture *> *frames;
|
||||
|
||||
private:
|
||||
typedef std::vector<pair<int, int> > intPairVector;
|
||||
typedef std::vector<std::pair<int, int> > intPairVector;
|
||||
intPairVector *frameOverride;
|
||||
int flags;
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ void ArchiveFile::_readHeader(DataInputStream *dis)
|
|||
}
|
||||
else meta->isCompressed = false;
|
||||
|
||||
m_index.insert( pair<std::wstring,PMetaData>(meta->filename,meta) );
|
||||
m_index.insert( std::pair<std::wstring,PMetaData>(meta->filename,meta) );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ std::vector<int> MemoryTracker::TEXTURE_IDS;
|
|||
int MemoryTracker::genLists(int count)
|
||||
{
|
||||
int id = glGenLists(count);
|
||||
GL_LIST_IDS.insert( pair<int,int>(id,count) );
|
||||
GL_LIST_IDS.insert( std::pair<int,int>(id,count) );
|
||||
return id;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,13 +17,13 @@ StringTable::StringTable(PBYTE pbData, DWORD dwSize)
|
|||
int versionNumber = dis.readInt();
|
||||
int languagesCount = dis.readInt();
|
||||
|
||||
std::vector< pair<std::wstring, int> > langSizeMap;
|
||||
std::vector< std::pair<std::wstring, int> > langSizeMap;
|
||||
for(int i = 0; i < languagesCount; ++i)
|
||||
{
|
||||
std::wstring langId = dis.readUTF();
|
||||
int langSize = dis.readInt();
|
||||
|
||||
langSizeMap.push_back( std::vector< pair<std::wstring, int> >::value_type(langId, langSize));
|
||||
langSizeMap.push_back( std::vector< std::pair<std::wstring, int> >::value_type(langId, langSize));
|
||||
}
|
||||
|
||||
std::vector<std::wstring> locales;
|
||||
|
|
|
|||
|
|
@ -21,8 +21,8 @@ UINT WstringLookup::lookup(std::wstring str)
|
|||
{
|
||||
if (str2int.find(str) == str2int.end())
|
||||
{
|
||||
pair<std::wstring,UINT> p =
|
||||
pair<std::wstring,UINT>(str, numIDs);
|
||||
std::pair<std::wstring,UINT> p =
|
||||
std::pair<std::wstring,UINT>(str, numIDs);
|
||||
|
||||
str2int.insert( p );
|
||||
int2str.push_back( str );
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@
|
|||
#include "../../../Minecraft.Client/Textures/Textures.h"
|
||||
#include "Villager.h"
|
||||
|
||||
std::unordered_map<int, pair<int,int> > Villager::MIN_MAX_VALUES;
|
||||
std::unordered_map<int, pair<int,int> > Villager::MIN_MAX_PRICES;
|
||||
std::unordered_map<int, std::pair<int,int> > Villager::MIN_MAX_VALUES;
|
||||
std::unordered_map<int, std::pair<int,int> > Villager::MIN_MAX_PRICES;
|
||||
|
||||
void Villager::_init(int profession)
|
||||
{
|
||||
|
|
@ -553,71 +553,71 @@ void Villager::overrideOffers(MerchantRecipeList *recipeList)
|
|||
|
||||
void Villager::staticCtor()
|
||||
{
|
||||
MIN_MAX_VALUES[Item::coal_Id] = pair<int,int>(16, 24);
|
||||
MIN_MAX_VALUES[Item::ironIngot_Id] = pair<int,int>(8, 10);
|
||||
MIN_MAX_VALUES[Item::goldIngot_Id] = pair<int,int>(8, 10);
|
||||
MIN_MAX_VALUES[Item::diamond_Id] = pair<int,int>(4, 6);
|
||||
MIN_MAX_VALUES[Item::paper_Id] = pair<int,int>(24, 36);
|
||||
MIN_MAX_VALUES[Item::book_Id] = pair<int,int>(11, 13);
|
||||
//MIN_MAX_VALUES.insert(Item::writtenBook_Id, pair<int,int>(1, 1));
|
||||
MIN_MAX_VALUES[Item::enderPearl_Id] = pair<int,int>(3, 4);
|
||||
MIN_MAX_VALUES[Item::eyeOfEnder_Id] = pair<int,int>(2, 3);
|
||||
MIN_MAX_VALUES[Item::porkChop_raw_Id] = pair<int,int>(14, 18);
|
||||
MIN_MAX_VALUES[Item::beef_raw_Id] = pair<int,int>(14, 18);
|
||||
MIN_MAX_VALUES[Item::chicken_raw_Id] = pair<int,int>(14, 18);
|
||||
MIN_MAX_VALUES[Item::fish_cooked_Id] = pair<int,int>(9, 13);
|
||||
MIN_MAX_VALUES[Item::seeds_wheat_Id] = pair<int,int>(34, 48);
|
||||
MIN_MAX_VALUES[Item::seeds_melon_Id] = pair<int,int>(30, 38);
|
||||
MIN_MAX_VALUES[Item::seeds_pumpkin_Id] = pair<int,int>(30, 38);
|
||||
MIN_MAX_VALUES[Item::wheat_Id] = pair<int,int>(18, 22);
|
||||
MIN_MAX_VALUES[Tile::cloth_Id] = pair<int,int>(14, 22);
|
||||
MIN_MAX_VALUES[Item::rotten_flesh_Id] = pair<int,int>(36, 64);
|
||||
MIN_MAX_VALUES[Item::coal_Id] = std::pair<int,int>(16, 24);
|
||||
MIN_MAX_VALUES[Item::ironIngot_Id] = std::pair<int,int>(8, 10);
|
||||
MIN_MAX_VALUES[Item::goldIngot_Id] = std::pair<int,int>(8, 10);
|
||||
MIN_MAX_VALUES[Item::diamond_Id] = std::pair<int,int>(4, 6);
|
||||
MIN_MAX_VALUES[Item::paper_Id] = std::pair<int,int>(24, 36);
|
||||
MIN_MAX_VALUES[Item::book_Id] = std::pair<int,int>(11, 13);
|
||||
//MIN_MAX_VALUES.insert(Item::writtenBook_Id, std::pair<int,int>(1, 1));
|
||||
MIN_MAX_VALUES[Item::enderPearl_Id] = std::pair<int,int>(3, 4);
|
||||
MIN_MAX_VALUES[Item::eyeOfEnder_Id] = std::pair<int,int>(2, 3);
|
||||
MIN_MAX_VALUES[Item::porkChop_raw_Id] = std::pair<int,int>(14, 18);
|
||||
MIN_MAX_VALUES[Item::beef_raw_Id] = std::pair<int,int>(14, 18);
|
||||
MIN_MAX_VALUES[Item::chicken_raw_Id] = std::pair<int,int>(14, 18);
|
||||
MIN_MAX_VALUES[Item::fish_cooked_Id] = std::pair<int,int>(9, 13);
|
||||
MIN_MAX_VALUES[Item::seeds_wheat_Id] = std::pair<int,int>(34, 48);
|
||||
MIN_MAX_VALUES[Item::seeds_melon_Id] = std::pair<int,int>(30, 38);
|
||||
MIN_MAX_VALUES[Item::seeds_pumpkin_Id] = std::pair<int,int>(30, 38);
|
||||
MIN_MAX_VALUES[Item::wheat_Id] = std::pair<int,int>(18, 22);
|
||||
MIN_MAX_VALUES[Tile::cloth_Id] = std::pair<int,int>(14, 22);
|
||||
MIN_MAX_VALUES[Item::rotten_flesh_Id] = std::pair<int,int>(36, 64);
|
||||
|
||||
MIN_MAX_PRICES[Item::flintAndSteel_Id] = pair<int,int>(3, 4);
|
||||
MIN_MAX_PRICES[Item::shears_Id] = pair<int,int>(3, 4);
|
||||
MIN_MAX_PRICES[Item::sword_iron_Id] = pair<int,int>(7, 11);
|
||||
MIN_MAX_PRICES[Item::sword_diamond_Id] = pair<int,int>(12, 14);
|
||||
MIN_MAX_PRICES[Item::hatchet_iron_Id] = pair<int,int>(6, 8);
|
||||
MIN_MAX_PRICES[Item::hatchet_diamond_Id] = pair<int,int>(9, 12);
|
||||
MIN_MAX_PRICES[Item::pickAxe_iron_Id] = pair<int,int>(7, 9);
|
||||
MIN_MAX_PRICES[Item::pickAxe_diamond_Id] = pair<int,int>(10, 12);
|
||||
MIN_MAX_PRICES[Item::shovel_iron_Id] = pair<int,int>(4, 6);
|
||||
MIN_MAX_PRICES[Item::shovel_diamond_Id] = pair<int,int>(7, 8);
|
||||
MIN_MAX_PRICES[Item::hoe_iron_Id] = pair<int,int>(4, 6);
|
||||
MIN_MAX_PRICES[Item::hoe_diamond_Id] = pair<int,int>(7, 8);
|
||||
MIN_MAX_PRICES[Item::boots_iron_Id] = pair<int,int>(4, 6);
|
||||
MIN_MAX_PRICES[Item::boots_diamond_Id] = pair<int,int>(7, 8);
|
||||
MIN_MAX_PRICES[Item::helmet_iron_Id] = pair<int,int>(4, 6);
|
||||
MIN_MAX_PRICES[Item::helmet_diamond_Id] = pair<int,int>(7, 8);
|
||||
MIN_MAX_PRICES[Item::chestplate_iron_Id] = pair<int,int>(10, 14);
|
||||
MIN_MAX_PRICES[Item::chestplate_diamond_Id] = pair<int,int>(16, 19);
|
||||
MIN_MAX_PRICES[Item::leggings_iron_Id] = pair<int,int>(8, 10);
|
||||
MIN_MAX_PRICES[Item::leggings_diamond_Id] = pair<int,int>(11, 14);
|
||||
MIN_MAX_PRICES[Item::boots_chain_Id] = pair<int,int>(5, 7);
|
||||
MIN_MAX_PRICES[Item::helmet_chain_Id] = pair<int,int>(5, 7);
|
||||
MIN_MAX_PRICES[Item::chestplate_chain_Id] = pair<int,int>(11, 15);
|
||||
MIN_MAX_PRICES[Item::leggings_chain_Id] = pair<int,int>(9, 11);
|
||||
MIN_MAX_PRICES[Item::bread_Id] = pair<int,int>(-4, -2);
|
||||
MIN_MAX_PRICES[Item::melon_Id] = pair<int,int>(-8, -4);
|
||||
MIN_MAX_PRICES[Item::apple_Id] = pair<int,int>(-8, -4);
|
||||
MIN_MAX_PRICES[Item::cookie_Id] = pair<int,int>(-10, -7);
|
||||
MIN_MAX_PRICES[Tile::glass_Id] = pair<int,int>(-5, -3);
|
||||
MIN_MAX_PRICES[Tile::bookshelf_Id] = pair<int,int>(3, 4);
|
||||
MIN_MAX_PRICES[Item::chestplate_cloth_Id] = pair<int,int>(4, 5);
|
||||
MIN_MAX_PRICES[Item::boots_cloth_Id] = pair<int,int>(2, 4);
|
||||
MIN_MAX_PRICES[Item::helmet_cloth_Id] = pair<int,int>(2, 4);
|
||||
MIN_MAX_PRICES[Item::leggings_cloth_Id] = pair<int,int>(2, 4);
|
||||
MIN_MAX_PRICES[Item::saddle_Id] = pair<int,int>(6, 8);
|
||||
MIN_MAX_PRICES[Item::expBottle_Id] = pair<int,int>(-4, -1);
|
||||
MIN_MAX_PRICES[Item::redStone_Id] = pair<int,int>(-4, -1);
|
||||
MIN_MAX_PRICES[Item::compass_Id] = pair<int,int>(10, 12);
|
||||
MIN_MAX_PRICES[Item::clock_Id] = pair<int,int>(10, 12);
|
||||
MIN_MAX_PRICES[Tile::lightGem_Id] = pair<int,int>(-3, -1);
|
||||
MIN_MAX_PRICES[Item::porkChop_cooked_Id] = pair<int,int>(-7, -5);
|
||||
MIN_MAX_PRICES[Item::beef_cooked_Id] = pair<int,int>(-7, -5);
|
||||
MIN_MAX_PRICES[Item::chicken_cooked_Id] = pair<int,int>(-8, -6);
|
||||
MIN_MAX_PRICES[Item::eyeOfEnder_Id] = pair<int,int>(7, 11);
|
||||
MIN_MAX_PRICES[Item::arrow_Id] = pair<int,int>(-12, -8);
|
||||
MIN_MAX_PRICES[Item::flintAndSteel_Id] = std::pair<int,int>(3, 4);
|
||||
MIN_MAX_PRICES[Item::shears_Id] = std::pair<int,int>(3, 4);
|
||||
MIN_MAX_PRICES[Item::sword_iron_Id] = std::pair<int,int>(7, 11);
|
||||
MIN_MAX_PRICES[Item::sword_diamond_Id] = std::pair<int,int>(12, 14);
|
||||
MIN_MAX_PRICES[Item::hatchet_iron_Id] = std::pair<int,int>(6, 8);
|
||||
MIN_MAX_PRICES[Item::hatchet_diamond_Id] = std::pair<int,int>(9, 12);
|
||||
MIN_MAX_PRICES[Item::pickAxe_iron_Id] = std::pair<int,int>(7, 9);
|
||||
MIN_MAX_PRICES[Item::pickAxe_diamond_Id] = std::pair<int,int>(10, 12);
|
||||
MIN_MAX_PRICES[Item::shovel_iron_Id] = std::pair<int,int>(4, 6);
|
||||
MIN_MAX_PRICES[Item::shovel_diamond_Id] = std::pair<int,int>(7, 8);
|
||||
MIN_MAX_PRICES[Item::hoe_iron_Id] = std::pair<int,int>(4, 6);
|
||||
MIN_MAX_PRICES[Item::hoe_diamond_Id] = std::pair<int,int>(7, 8);
|
||||
MIN_MAX_PRICES[Item::boots_iron_Id] = std::pair<int,int>(4, 6);
|
||||
MIN_MAX_PRICES[Item::boots_diamond_Id] = std::pair<int,int>(7, 8);
|
||||
MIN_MAX_PRICES[Item::helmet_iron_Id] = std::pair<int,int>(4, 6);
|
||||
MIN_MAX_PRICES[Item::helmet_diamond_Id] = std::pair<int,int>(7, 8);
|
||||
MIN_MAX_PRICES[Item::chestplate_iron_Id] = std::pair<int,int>(10, 14);
|
||||
MIN_MAX_PRICES[Item::chestplate_diamond_Id] = std::pair<int,int>(16, 19);
|
||||
MIN_MAX_PRICES[Item::leggings_iron_Id] = std::pair<int,int>(8, 10);
|
||||
MIN_MAX_PRICES[Item::leggings_diamond_Id] = std::pair<int,int>(11, 14);
|
||||
MIN_MAX_PRICES[Item::boots_chain_Id] = std::pair<int,int>(5, 7);
|
||||
MIN_MAX_PRICES[Item::helmet_chain_Id] = std::pair<int,int>(5, 7);
|
||||
MIN_MAX_PRICES[Item::chestplate_chain_Id] = std::pair<int,int>(11, 15);
|
||||
MIN_MAX_PRICES[Item::leggings_chain_Id] = std::pair<int,int>(9, 11);
|
||||
MIN_MAX_PRICES[Item::bread_Id] = std::pair<int,int>(-4, -2);
|
||||
MIN_MAX_PRICES[Item::melon_Id] = std::pair<int,int>(-8, -4);
|
||||
MIN_MAX_PRICES[Item::apple_Id] = std::pair<int,int>(-8, -4);
|
||||
MIN_MAX_PRICES[Item::cookie_Id] = std::pair<int,int>(-10, -7);
|
||||
MIN_MAX_PRICES[Tile::glass_Id] = std::pair<int,int>(-5, -3);
|
||||
MIN_MAX_PRICES[Tile::bookshelf_Id] = std::pair<int,int>(3, 4);
|
||||
MIN_MAX_PRICES[Item::chestplate_cloth_Id] = std::pair<int,int>(4, 5);
|
||||
MIN_MAX_PRICES[Item::boots_cloth_Id] = std::pair<int,int>(2, 4);
|
||||
MIN_MAX_PRICES[Item::helmet_cloth_Id] = std::pair<int,int>(2, 4);
|
||||
MIN_MAX_PRICES[Item::leggings_cloth_Id] = std::pair<int,int>(2, 4);
|
||||
MIN_MAX_PRICES[Item::saddle_Id] = std::pair<int,int>(6, 8);
|
||||
MIN_MAX_PRICES[Item::expBottle_Id] = std::pair<int,int>(-4, -1);
|
||||
MIN_MAX_PRICES[Item::redStone_Id] = std::pair<int,int>(-4, -1);
|
||||
MIN_MAX_PRICES[Item::compass_Id] = std::pair<int,int>(10, 12);
|
||||
MIN_MAX_PRICES[Item::clock_Id] = std::pair<int,int>(10, 12);
|
||||
MIN_MAX_PRICES[Tile::lightGem_Id] = std::pair<int,int>(-3, -1);
|
||||
MIN_MAX_PRICES[Item::porkChop_cooked_Id] = std::pair<int,int>(-7, -5);
|
||||
MIN_MAX_PRICES[Item::beef_cooked_Id] = std::pair<int,int>(-7, -5);
|
||||
MIN_MAX_PRICES[Item::chicken_cooked_Id] = std::pair<int,int>(-8, -6);
|
||||
MIN_MAX_PRICES[Item::eyeOfEnder_Id] = std::pair<int,int>(7, 11);
|
||||
MIN_MAX_PRICES[Item::arrow_Id] = std::pair<int,int>(-12, -8);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -648,7 +648,7 @@ int Villager::getTradeInValue(int itemId, Random *random)
|
|||
{
|
||||
return 1;
|
||||
}
|
||||
pair<int, int> minMax = it->second;
|
||||
std::pair<int, int> minMax = it->second;
|
||||
if (minMax.first >= minMax.second)
|
||||
{
|
||||
return minMax.first;
|
||||
|
|
@ -693,7 +693,7 @@ int Villager::getPurchaseCost(int itemId, Random *random)
|
|||
{
|
||||
return 1;
|
||||
}
|
||||
pair<int, int> minMax = it->second;
|
||||
std::pair<int, int> minMax = it->second;
|
||||
if (minMax.first >= minMax.second)
|
||||
{
|
||||
return minMax.first;
|
||||
|
|
|
|||
|
|
@ -109,8 +109,8 @@ public:
|
|||
void overrideOffers(MerchantRecipeList *recipeList);
|
||||
|
||||
private:
|
||||
static std::unordered_map<int, pair<int,int> > MIN_MAX_VALUES;
|
||||
static std::unordered_map<int, pair<int,int> > MIN_MAX_PRICES;
|
||||
static std::unordered_map<int, std::pair<int,int> > MIN_MAX_VALUES;
|
||||
static std::unordered_map<int, std::pair<int,int> > MIN_MAX_PRICES;
|
||||
|
||||
public:
|
||||
static void staticCtor();
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ const std::wstring PotionItem::THROWABLE_ICON = L"potion_splash";
|
|||
const std::wstring PotionItem::CONTENTS_ICON = L"potion_contents";
|
||||
|
||||
// 4J Added
|
||||
std::vector<pair<int, int> > PotionItem::s_uniquePotionValues;
|
||||
std::vector<std::pair<int, int> > PotionItem::s_uniquePotionValues;
|
||||
|
||||
PotionItem::PotionItem(int id) : Item(id)
|
||||
{
|
||||
|
|
@ -327,7 +327,7 @@ Icon *PotionItem::getTexture(const std::wstring &name)
|
|||
|
||||
|
||||
// 4J Stu - Based loosely on a function that gets added in java much later on (1.3)
|
||||
std::vector<pair<int, int> > *PotionItem::getUniquePotionValues()
|
||||
std::vector<std::pair<int, int> > *PotionItem::getUniquePotionValues()
|
||||
{
|
||||
if (s_uniquePotionValues.empty())
|
||||
{
|
||||
|
|
@ -361,7 +361,7 @@ std::vector<pair<int, int> > *PotionItem::getUniquePotionValues()
|
|||
}
|
||||
if( toAdd )
|
||||
{
|
||||
s_uniquePotionValues.push_back(pair<int,int>(effectsHashCode, brew) );
|
||||
s_uniquePotionValues.push_back(std::pair<int,int>(effectsHashCode, brew) );
|
||||
}
|
||||
}
|
||||
delete effects;
|
||||
|
|
|
|||
|
|
@ -50,8 +50,8 @@ public:
|
|||
static Icon *getTexture(const std::wstring &name);
|
||||
|
||||
// 4J Stu - Based loosely on a function that gets added in java much later on (1.3)
|
||||
static std::vector<pair<int, int> > *getUniquePotionValues();
|
||||
static std::vector<std::pair<int, int> > *getUniquePotionValues();
|
||||
private:
|
||||
// 4J Stu - Added to support function above, different from Java implementation
|
||||
static std::vector<pair<int, int> > s_uniquePotionValues;
|
||||
static std::vector<std::pair<int, int> > s_uniquePotionValues;
|
||||
};
|
||||
|
|
@ -40,7 +40,7 @@ Stat *Stat::postConstruct()
|
|||
//}
|
||||
Stats::all->push_back(this);
|
||||
|
||||
pair<int, Stat *> id1(id,this);
|
||||
std::pair<int, Stat *> id1(id,this);
|
||||
#ifdef __PS3__
|
||||
Stats::statsById->emplace(id1 );// assert(0); // MGH - TODO - FIX - find out where this move function comes from
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -394,7 +394,7 @@ int Village::modifyStanding(const std::wstring &playerName, int delta)
|
|||
{
|
||||
int current = getStanding(playerName);
|
||||
int newValue = Mth::clamp(current + delta, -30, 10);
|
||||
playerStanding.insert(pair<std::wstring,int>(playerName, newValue));
|
||||
playerStanding.insert(std::pair<std::wstring,int>(playerName, newValue));
|
||||
return newValue;
|
||||
}
|
||||
|
||||
|
|
@ -441,7 +441,7 @@ void Village::readAdditionalSaveData(CompoundTag *tag)
|
|||
for (int i = 0; i < playerTags->size(); i++)
|
||||
{
|
||||
CompoundTag *pTag = playerTags->get(i);
|
||||
playerStanding.insert(pair<std::wstring,int>(pTag->getString(L"Name"), pTag->getInt(L"S")));
|
||||
playerStanding.insert(std::pair<std::wstring,int>(pTag->getString(L"Name"), pTag->getInt(L"S")));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue