llwearabledictionary.cpp
上传用户:king477883
上传日期:2021-03-01
资源大小:9553k
文件大小:4k
源码类别:

游戏引擎

开发平台:

C++ Builder

  1. /** 
  2.  * @file llwearableDictionary.cpp
  3.  * @brief LLWearableDictionary class implementation
  4.  *
  5.  * $LicenseInfo:firstyear=2002&license=viewergpl$
  6.  * 
  7.  * Copyright (c) 2002-2010, Linden Research, Inc.
  8.  * 
  9.  * Second Life Viewer Source Code
  10.  * The source code in this file ("Source Code") is provided by Linden Lab
  11.  * to you under the terms of the GNU General Public License, version 2.0
  12.  * ("GPL"), unless you have obtained a separate licensing agreement
  13.  * ("Other License"), formally executed by you and Linden Lab.  Terms of
  14.  * the GPL can be found in doc/GPL-license.txt in this distribution, or
  15.  * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
  16.  * 
  17.  * There are special exceptions to the terms and conditions of the GPL as
  18.  * it is applied to this Source Code. View the full text of the exception
  19.  * in the file doc/FLOSS-exception.txt in this software distribution, or
  20.  * online at
  21.  * http://secondlifegrid.net/programs/open_source/licensing/flossexception
  22.  * 
  23.  * By copying, modifying or distributing this software, you acknowledge
  24.  * that you have read and understood your obligations described above,
  25.  * and agree to abide by those obligations.
  26.  * 
  27.  * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
  28.  * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
  29.  * COMPLETENESS OR PERFORMANCE.
  30.  * $/LicenseInfo$
  31.  */
  32. #include "llviewerprecompiledheaders.h"
  33. #include "llwearabledictionary.h"
  34. #include "lltrans.h"
  35. LLWearableDictionary::LLWearableDictionary()
  36. {
  37. }
  38. LLWearableDictionary::~LLWearableDictionary()
  39. {
  40. }
  41. LLWearableDictionary::Wearables::Wearables()
  42. {
  43. addEntry(WT_SHAPE,        new WearableEntry("shape",       LLAssetType::AT_BODYPART));
  44. addEntry(WT_SKIN,         new WearableEntry("skin",        LLAssetType::AT_BODYPART));
  45. addEntry(WT_HAIR,         new WearableEntry("hair",        LLAssetType::AT_BODYPART));
  46. addEntry(WT_EYES,         new WearableEntry("eyes",        LLAssetType::AT_BODYPART));
  47. addEntry(WT_SHIRT,        new WearableEntry("shirt",       LLAssetType::AT_CLOTHING));
  48. addEntry(WT_PANTS,        new WearableEntry("pants",       LLAssetType::AT_CLOTHING));
  49. addEntry(WT_SHOES,        new WearableEntry("shoes",       LLAssetType::AT_CLOTHING));
  50. addEntry(WT_SOCKS,        new WearableEntry("socks",       LLAssetType::AT_CLOTHING));
  51. addEntry(WT_JACKET,       new WearableEntry("jacket",      LLAssetType::AT_CLOTHING));
  52. addEntry(WT_GLOVES,       new WearableEntry("gloves",      LLAssetType::AT_CLOTHING));
  53. addEntry(WT_UNDERSHIRT,   new WearableEntry("undershirt",  LLAssetType::AT_CLOTHING));
  54. addEntry(WT_UNDERPANTS,   new WearableEntry("underpants",  LLAssetType::AT_CLOTHING));
  55. addEntry(WT_SKIRT,        new WearableEntry("skirt",       LLAssetType::AT_CLOTHING));
  56. addEntry(WT_ALPHA,        new WearableEntry("alpha",       LLAssetType::AT_CLOTHING));
  57. addEntry(WT_TATTOO,       new WearableEntry("tattoo",      LLAssetType::AT_CLOTHING));
  58. addEntry(WT_INVALID,      new WearableEntry("invalid",     LLAssetType::AT_NONE));
  59. addEntry(WT_COUNT,        NULL);
  60. }
  61. LLWearableDictionary::WearableEntry::WearableEntry(const std::string &name,
  62.    LLAssetType::EType assetType) :
  63. LLDictionaryEntry(name),
  64. mAssetType(assetType),
  65. mLabel(LLTrans::getString(name))
  66. {
  67. }
  68. // static
  69. EWearableType LLWearableDictionary::typeNameToType(const std::string& type_name)
  70. {
  71. const EWearableType wearable = getInstance()->getWearableEntry(type_name);
  72. return wearable;
  73. }
  74. // static 
  75. const std::string& LLWearableDictionary::getTypeName(EWearableType type)
  76. return getInstance()->getWearableEntry(type)->mName;
  77. }
  78. // static 
  79. const std::string& LLWearableDictionary::getTypeLabel(EWearableType type)
  80. return getInstance()->getWearableEntry(type)->mLabel;
  81. }
  82. // static 
  83. LLAssetType::EType LLWearableDictionary::getAssetType(EWearableType type)
  84. {
  85. return getInstance()->getWearableEntry(type)->mAssetType;
  86. }