protected boolean shopKeeperItemTypeCheck(Environmental E, int dealCode, ShopKeeper shopKeeper)
	{
		switch(dealCode)
		{
		case ShopKeeper.DEAL_ANYTHING:
			return !(E instanceof LandTitle);
		case ShopKeeper.DEAL_ARMOR:
			return (E instanceof Armor);
		case ShopKeeper.DEAL_MAGIC:
			return (E instanceof MiscMagic);
		case ShopKeeper.DEAL_WEAPONS:
			return (E instanceof Weapon)||(E instanceof Ammunition);
		case ShopKeeper.DEAL_GENERAL:
			return ((E instanceof Item)
					&&(!(E instanceof Armor))
					&&(!(E instanceof MiscMagic))
					&&(!(E instanceof ClanItem))
					&&(!(E instanceof Weapon))
					&&(!(E instanceof Ammunition))
					&&(!(E instanceof MOB))
					&&(!(E instanceof LandTitle))
					&&(!(E instanceof BoardableShip))
					&&(!(E instanceof RawMaterial))
					&&(!(E instanceof Ability)));
		case ShopKeeper.DEAL_LEATHER:
			return ((E instanceof Item)
					&&((((Item)E).material()&RawMaterial.MATERIAL_MASK)==RawMaterial.MATERIAL_LEATHER)
					&&(!(E instanceof RawMaterial)));
		case ShopKeeper.DEAL_PETS:
			return ((E instanceof MOB)&&(CMLib.flags().isAnimalIntelligence((MOB)E)));
		case ShopKeeper.DEAL_SLAVES:
			return ((E instanceof MOB)&&(!CMLib.flags().isAnimalIntelligence((MOB)E)));
		case ShopKeeper.DEAL_INVENTORYONLY:
			return (shopKeeper.getShop().inEnumerableInventory(E));
		case ShopKeeper.DEAL_INNKEEPER:
			return E instanceof InnKey;
		case ShopKeeper.DEAL_JEWELLER:
			return ((E instanceof Item)
					&&(!(E instanceof Weapon))
					&&(!(E instanceof MiscMagic))
					&&(!(E instanceof ClanItem))
					&&(((((Item)E).material()&RawMaterial.MATERIAL_MASK)==RawMaterial.MATERIAL_GLASS)
					||((((Item)E).material()&RawMaterial.MATERIAL_MASK)==RawMaterial.MATERIAL_PRECIOUS)
					||((Item)E).fitsOn(Wearable.WORN_EARS)
					||((Item)E).fitsOn(Wearable.WORN_NECK)
					||((Item)E).fitsOn(Wearable.WORN_RIGHT_FINGER)
					||((Item)E).fitsOn(Wearable.WORN_LEFT_FINGER)));
		case ShopKeeper.DEAL_ALCHEMIST:
			return (E instanceof Potion);
		case ShopKeeper.DEAL_LANDSELLER:
		case ShopKeeper.DEAL_CLANDSELLER:
			return ((E instanceof LandTitle)&&(CMLib.map().getShip(((LandTitle)E).landPropertyID())==null));
		case ShopKeeper.DEAL_SHIPSELLER:
		case ShopKeeper.DEAL_CSHIPSELLER:
			return ((E instanceof BoardableShip)
					||((E instanceof LandTitle)&&(CMLib.map().getShip(((LandTitle)E).landPropertyID())!=null)));
		case ShopKeeper.DEAL_ANYTECHNOLOGY:
			return (E instanceof Electronics);
		case ShopKeeper.DEAL_BUTCHER:
			return ((E instanceof RawMaterial)
				&&(((RawMaterial)E).material()&RawMaterial.MATERIAL_MASK)==RawMaterial.MATERIAL_FLESH);
		case ShopKeeper.DEAL_FOODSELLER:
			return (((E instanceof Food)||(E instanceof Drink))
					&&(!(E instanceof RawMaterial)));
		case ShopKeeper.DEAL_GROWER:
			return ((E instanceof RawMaterial)
				&&(((RawMaterial)E).material()&RawMaterial.MATERIAL_MASK)==RawMaterial.MATERIAL_VEGETATION);
		case ShopKeeper.DEAL_HIDESELLER:
			return ((E instanceof RawMaterial)
				&&((((RawMaterial)E).material()==RawMaterial.RESOURCE_HIDE)
				||(((RawMaterial)E).material()==RawMaterial.RESOURCE_FEATHERS)
				||(((RawMaterial)E).material()==RawMaterial.RESOURCE_LEATHER)
				||(((RawMaterial)E).material()==RawMaterial.RESOURCE_SCALES)
				||(((RawMaterial)E).material()==RawMaterial.RESOURCE_WOOL)
				||(((RawMaterial)E).material()==RawMaterial.RESOURCE_FUR)));
		case ShopKeeper.DEAL_LUMBERER:
			return ((E instanceof RawMaterial)
				&&((((RawMaterial)E).material()&RawMaterial.MATERIAL_MASK)==RawMaterial.MATERIAL_WOODEN));
		case ShopKeeper.DEAL_METALSMITH:
			return ((E instanceof RawMaterial)
				&&(((((RawMaterial)E).material()&RawMaterial.MATERIAL_MASK)==RawMaterial.MATERIAL_METAL)
				||(((RawMaterial)E).material()&RawMaterial.MATERIAL_MASK)==RawMaterial.MATERIAL_MITHRIL));
		case ShopKeeper.DEAL_STONEYARDER:
			return ((E instanceof RawMaterial)
				&&((((RawMaterial)E).material()&RawMaterial.MATERIAL_MASK)==RawMaterial.MATERIAL_ROCK));
		}
		return false;
	}