• Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • CardDB.cs: Why all this?

    Discussion in 'Hearthbuddy Support' started by Dcrew, Jan 31, 2015.

    1. Dcrew

      Dcrew New Member

      Joined:
      Jan 24, 2015
      Messages:
      38
      Likes Received:
      0
      Trophy Points:
      0
      Why:

      Code:
              public cardIDEnum cardIdstringToEnum(string s)
              {
                  if (s == "CS1h_001") return CardDB.cardIDEnum.CS1h_001;
                  if (s == "CS1_042") return CardDB.cardIDEnum.CS1_042;
                  if (s == "CS1_112") return CardDB.cardIDEnum.CS1_112;
                  if (s == "CS1_113") return CardDB.cardIDEnum.CS1_113;
                  if (s == "CS1_113e") return CardDB.cardIDEnum.CS1_113e;
                  if (s == "CS1_130") return CardDB.cardIDEnum.CS1_130;
                  if (s == "CS2_003") return CardDB.cardIDEnum.CS2_003;
                  if (s == "CS2_004") return CardDB.cardIDEnum.CS2_004;
                  if (s == "CS2_004e") return CardDB.cardIDEnum.CS2_004e;
                  if (s == "CS2_005") return CardDB.cardIDEnum.CS2_005;
                  if (s == "CS2_005o") return CardDB.cardIDEnum.CS2_005o;
                  if (s == "CS2_007") return CardDB.cardIDEnum.CS2_007;
                  if (s == "CS2_008") return CardDB.cardIDEnum.CS2_008;
                  if (s == "CS2_009") return CardDB.cardIDEnum.CS2_009;
                  if (s == "CS2_009e") return CardDB.cardIDEnum.CS2_009e;
                  if (s == "CS2_011") return CardDB.cardIDEnum.CS2_011;
                  if (s == "CS2_011o") return CardDB.cardIDEnum.CS2_011o;
                  if (s == "CS2_012") return CardDB.cardIDEnum.CS2_012;
                  if (s == "CS2_013") return CardDB.cardIDEnum.CS2_013;
                  if (s == "CS2_013t") return CardDB.cardIDEnum.CS2_013t;
                  if (s == "CS2_017") return CardDB.cardIDEnum.CS2_017;
                  if (s == "CS2_017o") return CardDB.cardIDEnum.CS2_017o;
                  if (s == "CS2_022") return CardDB.cardIDEnum.CS2_022;
                  if (s == "CS2_022e") return CardDB.cardIDEnum.CS2_022e;
                  if (s == "CS2_023") return CardDB.cardIDEnum.CS2_023;
                  if (s == "CS2_024") return CardDB.cardIDEnum.CS2_024;
                  if (s == "CS2_025") return CardDB.cardIDEnum.CS2_025;
                  if (s == "CS2_026") return CardDB.cardIDEnum.CS2_026;
                  if (s == "CS2_027") return CardDB.cardIDEnum.CS2_027;
                  if (s == "CS2_029") return CardDB.cardIDEnum.CS2_029;
                  if (s == "CS2_032") return CardDB.cardIDEnum.CS2_032;
                  if (s == "CS2_033") return CardDB.cardIDEnum.CS2_033;
                  if (s == "CS2_034") return CardDB.cardIDEnum.CS2_034;
                  if (s == "CS2_037") return CardDB.cardIDEnum.CS2_037;
                  if (s == "CS2_039") return CardDB.cardIDEnum.CS2_039;
                  if (s == "CS2_041") return CardDB.cardIDEnum.CS2_041;
                  if (s == "CS2_041e") return CardDB.cardIDEnum.CS2_041e;
                  if (s == "CS2_042") return CardDB.cardIDEnum.CS2_042;
                  if (s == "CS2_045") return CardDB.cardIDEnum.CS2_045;
                  if (s == "CS2_045e") return CardDB.cardIDEnum.CS2_045e;
                  if (s == "CS2_046") return CardDB.cardIDEnum.CS2_046;
                  if (s == "CS2_046e") return CardDB.cardIDEnum.CS2_046e;
                  if (s == "CS2_049") return CardDB.cardIDEnum.CS2_049;
                  if (s == "CS2_050") return CardDB.cardIDEnum.CS2_050;
                  if (s == "CS2_051") return CardDB.cardIDEnum.CS2_051;
                  if (s == "CS2_052") return CardDB.cardIDEnum.CS2_052;
                  if (s == "CS2_056") return CardDB.cardIDEnum.CS2_056;
                  if (s == "CS2_057") return CardDB.cardIDEnum.CS2_057;
                  if (s == "CS2_061") return CardDB.cardIDEnum.CS2_061;
                  if (s == "CS2_062") return CardDB.cardIDEnum.CS2_062;
                  if (s == "CS2_063") return CardDB.cardIDEnum.CS2_063;
                  if (s == "CS2_063e") return CardDB.cardIDEnum.CS2_063e;
                  if (s == "CS2_064") return CardDB.cardIDEnum.CS2_064;
                  if (s == "CS2_065") return CardDB.cardIDEnum.CS2_065;
                  if (s == "CS2_072") return CardDB.cardIDEnum.CS2_072;
                  if (s == "CS2_074") return CardDB.cardIDEnum.CS2_074;
                  if (s == "CS2_074e") return CardDB.cardIDEnum.CS2_074e;
                  if (s == "CS2_075") return CardDB.cardIDEnum.CS2_075;
                  if (s == "CS2_076") return CardDB.cardIDEnum.CS2_076;
                  if (s == "CS2_077") return CardDB.cardIDEnum.CS2_077;
                  if (s == "CS2_080") return CardDB.cardIDEnum.CS2_080;
                  if (s == "CS2_082") return CardDB.cardIDEnum.CS2_082;
                  if (s == "CS2_083b") return CardDB.cardIDEnum.CS2_083b;
                  if (s == "CS2_083e") return CardDB.cardIDEnum.CS2_083e;
                  if (s == "CS2_084") return CardDB.cardIDEnum.CS2_084;
                  if (s == "CS2_084e") return CardDB.cardIDEnum.CS2_084e;
                  if (s == "CS2_087") return CardDB.cardIDEnum.CS2_087;
                  if (s == "CS2_087e") return CardDB.cardIDEnum.CS2_087e;
                  if (s == "CS2_088") return CardDB.cardIDEnum.CS2_088;
                  if (s == "CS2_089") return CardDB.cardIDEnum.CS2_089;
                  if (s == "CS2_091") return CardDB.cardIDEnum.CS2_091;
                  if (s == "CS2_092") return CardDB.cardIDEnum.CS2_092;
                  if (s == "CS2_092e") return CardDB.cardIDEnum.CS2_092e;
                  if (s == "CS2_093") return CardDB.cardIDEnum.CS2_093;
                  if (s == "CS2_094") return CardDB.cardIDEnum.CS2_094;
                  if (s == "CS2_097") return CardDB.cardIDEnum.CS2_097;
                  if (s == "CS2_101") return CardDB.cardIDEnum.CS2_101;
                  if (s == "CS2_101t") return CardDB.cardIDEnum.CS2_101t;
                  if (s == "CS2_102") return CardDB.cardIDEnum.CS2_102;
                  if (s == "CS2_103") return CardDB.cardIDEnum.CS2_103;
                  if (s == "CS2_103e2") return CardDB.cardIDEnum.CS2_103e2;
                  if (s == "CS2_105") return CardDB.cardIDEnum.CS2_105;
                  if (s == "CS2_105e") return CardDB.cardIDEnum.CS2_105e;
                  if (s == "CS2_106") return CardDB.cardIDEnum.CS2_106;
                  if (s == "CS2_108") return CardDB.cardIDEnum.CS2_108;
                  if (s == "CS2_112") return CardDB.cardIDEnum.CS2_112;
                  if (s == "CS2_114") return CardDB.cardIDEnum.CS2_114;
                  if (s == "CS2_118") return CardDB.cardIDEnum.CS2_118;
                  if (s == "CS2_119") return CardDB.cardIDEnum.CS2_119;
                  if (s == "CS2_120") return CardDB.cardIDEnum.CS2_120;
                  if (s == "CS2_121") return CardDB.cardIDEnum.CS2_121;
                  if (s == "CS2_122") return CardDB.cardIDEnum.CS2_122;
                  if (s == "CS2_122e") return CardDB.cardIDEnum.CS2_122e;
                  if (s == "CS2_124") return CardDB.cardIDEnum.CS2_124;
                  if (s == "CS2_125") return CardDB.cardIDEnum.CS2_125;
                  if (s == "CS2_127") return CardDB.cardIDEnum.CS2_127;
                  if (s == "CS2_131") return CardDB.cardIDEnum.CS2_131;
                  if (s == "CS2_141") return CardDB.cardIDEnum.CS2_141;
                  if (s == "CS2_142") return CardDB.cardIDEnum.CS2_142;
                  if (s == "CS2_147") return CardDB.cardIDEnum.CS2_147;
                  if (s == "CS2_150") return CardDB.cardIDEnum.CS2_150;
                  if (s == "CS2_155") return CardDB.cardIDEnum.CS2_155;
                  if (s == "CS2_162") return CardDB.cardIDEnum.CS2_162;
                  if (s == "CS2_168") return CardDB.cardIDEnum.CS2_168;
                  if (s == "CS2_171") return CardDB.cardIDEnum.CS2_171;
                  if (s == "CS2_172") return CardDB.cardIDEnum.CS2_172;
                  if (s == "CS2_173") return CardDB.cardIDEnum.CS2_173;
                  if (s == "CS2_179") return CardDB.cardIDEnum.CS2_179;
                  if (s == "CS2_182") return CardDB.cardIDEnum.CS2_182;
                  if (s == "CS2_186") return CardDB.cardIDEnum.CS2_186;
                  if (s == "CS2_187") return CardDB.cardIDEnum.CS2_187;
                  if (s == "CS2_189") return CardDB.cardIDEnum.CS2_189;
                  if (s == "CS2_196") return CardDB.cardIDEnum.CS2_196;
                  if (s == "CS2_197") return CardDB.cardIDEnum.CS2_197;
                  if (s == "CS2_200") return CardDB.cardIDEnum.CS2_200;
                  if (s == "CS2_201") return CardDB.cardIDEnum.CS2_201;
                  if (s == "CS2_213") return CardDB.cardIDEnum.CS2_213;
                  if (s == "CS2_222") return CardDB.cardIDEnum.CS2_222;
                  if (s == "CS2_222o") return CardDB.cardIDEnum.CS2_222o;
                  if (s == "CS2_226") return CardDB.cardIDEnum.CS2_226;
                  if (s == "CS2_226e") return CardDB.cardIDEnum.CS2_226e;
                  if (s == "CS2_232") return CardDB.cardIDEnum.CS2_232;
                  if (s == "CS2_234") return CardDB.cardIDEnum.CS2_234;
                  if (s == "CS2_235") return CardDB.cardIDEnum.CS2_235;
                  if (s == "CS2_236") return CardDB.cardIDEnum.CS2_236;
                  if (s == "CS2_236e") return CardDB.cardIDEnum.CS2_236e;
                  if (s == "CS2_237") return CardDB.cardIDEnum.CS2_237;
                  if (s == "CS2_boar") return CardDB.cardIDEnum.CS2_boar;
                  if (s == "CS2_mirror") return CardDB.cardIDEnum.CS2_mirror;
                  if (s == "CS2_tk1") return CardDB.cardIDEnum.CS2_tk1;
                  if (s == "DS1h_292") return CardDB.cardIDEnum.DS1h_292;
                  if (s == "DS1_055") return CardDB.cardIDEnum.DS1_055;
                  if (s == "DS1_070") return CardDB.cardIDEnum.DS1_070;
                  if (s == "DS1_070o") return CardDB.cardIDEnum.DS1_070o;
                  if (s == "DS1_175") return CardDB.cardIDEnum.DS1_175;
                  if (s == "DS1_175o") return CardDB.cardIDEnum.DS1_175o;
                  if (s == "DS1_178") return CardDB.cardIDEnum.DS1_178;
                  if (s == "DS1_178e") return CardDB.cardIDEnum.DS1_178e;
                  if (s == "DS1_183") return CardDB.cardIDEnum.DS1_183;
                  if (s == "DS1_184") return CardDB.cardIDEnum.DS1_184;
                  if (s == "DS1_185") return CardDB.cardIDEnum.DS1_185;
                  if (s == "DS1_233") return CardDB.cardIDEnum.DS1_233;
                  if (s == "EX1_011") return CardDB.cardIDEnum.EX1_011;
                  if (s == "EX1_015") return CardDB.cardIDEnum.EX1_015;
                  if (s == "EX1_019") return CardDB.cardIDEnum.EX1_019;
                  if (s == "EX1_019e") return CardDB.cardIDEnum.EX1_019e;
                  if (s == "EX1_025") return CardDB.cardIDEnum.EX1_025;
                  if (s == "EX1_025t") return CardDB.cardIDEnum.EX1_025t;
                  if (s == "EX1_066") return CardDB.cardIDEnum.EX1_066;
                  if (s == "EX1_084") return CardDB.cardIDEnum.EX1_084;
                  if (s == "EX1_084e") return CardDB.cardIDEnum.EX1_084e;
                  if (s == "EX1_129") return CardDB.cardIDEnum.EX1_129;
                  if (s == "EX1_169") return CardDB.cardIDEnum.EX1_169;
                  if (s == "EX1_173") return CardDB.cardIDEnum.EX1_173;
                  if (s == "EX1_244") return CardDB.cardIDEnum.EX1_244;
                  if (s == "EX1_244e") return CardDB.cardIDEnum.EX1_244e;
                  if (s == "EX1_246") return CardDB.cardIDEnum.EX1_246;
                  if (s == "EX1_246e") return CardDB.cardIDEnum.EX1_246e;
                  if (s == "EX1_277") return CardDB.cardIDEnum.EX1_277;
                  if (s == "EX1_278") return CardDB.cardIDEnum.EX1_278;
                  if (s == "EX1_302") return CardDB.cardIDEnum.EX1_302;
                  if (s == "EX1_306") return CardDB.cardIDEnum.EX1_306;
                  if (s == "EX1_308") return CardDB.cardIDEnum.EX1_308;
                  if (s == "EX1_360") return CardDB.cardIDEnum.EX1_360;
                  if (s == "EX1_360e") return CardDB.cardIDEnum.EX1_360e;
                  if (s == "EX1_371") return CardDB.cardIDEnum.EX1_371;
                  if (s == "EX1_399") return CardDB.cardIDEnum.EX1_399;
                  if (s == "EX1_399e") return CardDB.cardIDEnum.EX1_399e;
                  if (s == "EX1_400") return CardDB.cardIDEnum.EX1_400;
                  if (s == "EX1_506") return CardDB.cardIDEnum.EX1_506;
                  if (s == "EX1_506a") return CardDB.cardIDEnum.EX1_506a;
                  if (s == "EX1_508") return CardDB.cardIDEnum.EX1_508;
                  if (s == "EX1_508o") return CardDB.cardIDEnum.EX1_508o;
                  if (s == "EX1_539") return CardDB.cardIDEnum.EX1_539;
                  if (s == "EX1_565") return CardDB.cardIDEnum.EX1_565;
                  if (s == "EX1_565o") return CardDB.cardIDEnum.EX1_565o;
                  if (s == "EX1_581") return CardDB.cardIDEnum.EX1_581;
                  if (s == "EX1_582") return CardDB.cardIDEnum.EX1_582;
                  if (s == "EX1_587") return CardDB.cardIDEnum.EX1_587;
                  if (s == "EX1_593") return CardDB.cardIDEnum.EX1_593;
                  if (s == "EX1_606") return CardDB.cardIDEnum.EX1_606;
                  if (s == "EX1_622") return CardDB.cardIDEnum.EX1_622;
                  if (s == "GAME_001") return CardDB.cardIDEnum.GAME_001;
                  if (s == "GAME_002") return CardDB.cardIDEnum.GAME_002;
                  if (s == "GAME_003") return CardDB.cardIDEnum.GAME_003;
                  if (s == "GAME_003e") return CardDB.cardIDEnum.GAME_003e;
                  if (s == "GAME_004") return CardDB.cardIDEnum.GAME_004;
                  if (s == "GAME_005") return CardDB.cardIDEnum.GAME_005;
                  if (s == "GAME_005e") return CardDB.cardIDEnum.GAME_005e;
                  if (s == "GAME_006") return CardDB.cardIDEnum.GAME_006;
                  if (s == "HERO_01") return CardDB.cardIDEnum.HERO_01;
                  if (s == "HERO_02") return CardDB.cardIDEnum.HERO_02;
                  if (s == "HERO_03") return CardDB.cardIDEnum.HERO_03;
                  if (s == "HERO_04") return CardDB.cardIDEnum.HERO_04;
                  if (s == "HERO_05") return CardDB.cardIDEnum.HERO_05;
                  if (s == "HERO_06") return CardDB.cardIDEnum.HERO_06;
                  if (s == "HERO_07") return CardDB.cardIDEnum.HERO_07;
                  if (s == "HERO_08") return CardDB.cardIDEnum.HERO_08;
                  if (s == "HERO_09") return CardDB.cardIDEnum.HERO_09;
                  if (s == "hexfrog") return CardDB.cardIDEnum.hexfrog;
                  if (s == "NEW1_003") return CardDB.cardIDEnum.NEW1_003;
                  if (s == "NEW1_004") return CardDB.cardIDEnum.NEW1_004;
                  if (s == "NEW1_009") return CardDB.cardIDEnum.NEW1_009;
                  if (s == "NEW1_011") return CardDB.cardIDEnum.NEW1_011;
                  if (s == "NEW1_031") return CardDB.cardIDEnum.NEW1_031;
                  if (s == "NEW1_032") return CardDB.cardIDEnum.NEW1_032;
                  if (s == "NEW1_033") return CardDB.cardIDEnum.NEW1_033;
                  if (s == "NEW1_033o") return CardDB.cardIDEnum.NEW1_033o;
                  if (s == "NEW1_034") return CardDB.cardIDEnum.NEW1_034;
                  if (s == "skele11") return CardDB.cardIDEnum.skele11;
                  if (s == "CS1_069") return CardDB.cardIDEnum.CS1_069;
                  if (s == "CS1_129") return CardDB.cardIDEnum.CS1_129;
                  if (s == "CS1_129e") return CardDB.cardIDEnum.CS1_129e;
                  if (s == "CS2_028") return CardDB.cardIDEnum.CS2_028;
                  if (s == "CS2_031") return CardDB.cardIDEnum.CS2_031;
                  if (s == "CS2_038") return CardDB.cardIDEnum.CS2_038;
                  if (s == "CS2_038e") return CardDB.cardIDEnum.CS2_038e;
                  if (s == "CS2_053") return CardDB.cardIDEnum.CS2_053;
                  if (s == "CS2_053e") return CardDB.cardIDEnum.CS2_053e;
                  if (s == "CS2_059") return CardDB.cardIDEnum.CS2_059;
                  if (s == "CS2_059o") return CardDB.cardIDEnum.CS2_059o;
                  if (s == "CS2_073") return CardDB.cardIDEnum.CS2_073;
                  if (s == "CS2_073e") return CardDB.cardIDEnum.CS2_073e;
                  if (s == "CS2_073e2") return CardDB.cardIDEnum.CS2_073e2;
                  if (s == "CS2_104") return CardDB.cardIDEnum.CS2_104;
                  if (s == "CS2_104e") return CardDB.cardIDEnum.CS2_104e;
                  if (s == "CS2_117") return CardDB.cardIDEnum.CS2_117;
                  if (s == "CS2_146") return CardDB.cardIDEnum.CS2_146;
                  if (s == "CS2_146o") return CardDB.cardIDEnum.CS2_146o;
                  if (s == "CS2_151") return CardDB.cardIDEnum.CS2_151;
                  if (s == "CS2_152") return CardDB.cardIDEnum.CS2_152;
                  if (s == "CS2_161") return CardDB.cardIDEnum.CS2_161;
                  if (s == "CS2_169") return CardDB.cardIDEnum.CS2_169;
                  if (s == "CS2_181") return CardDB.cardIDEnum.CS2_181;
                  if (s == "CS2_181e") return CardDB.cardIDEnum.CS2_181e;
                  if (s == "CS2_188") return CardDB.cardIDEnum.CS2_188;
                  if (s == "CS2_188o") return CardDB.cardIDEnum.CS2_188o;
                  if (s == "CS2_203") return CardDB.cardIDEnum.CS2_203;
                  if (s == "CS2_221") return CardDB.cardIDEnum.CS2_221;
                  if (s == "CS2_221e") return CardDB.cardIDEnum.CS2_221e;
                  if (s == "CS2_227") return CardDB.cardIDEnum.CS2_227;
                  if (s == "CS2_231") return CardDB.cardIDEnum.CS2_231;
                  if (s == "CS2_233") return CardDB.cardIDEnum.CS2_233;
                  if (s == "DREAM_01") return CardDB.cardIDEnum.DREAM_01;
                  if (s == "DREAM_02") return CardDB.cardIDEnum.DREAM_02;
                  if (s == "DREAM_03") return CardDB.cardIDEnum.DREAM_03;
                  if (s == "DREAM_04") return CardDB.cardIDEnum.DREAM_04;
                  if (s == "DREAM_05") return CardDB.cardIDEnum.DREAM_05;
                  if (s == "DREAM_05e") return CardDB.cardIDEnum.DREAM_05e;
                  if (s == "DS1_188") return CardDB.cardIDEnum.DS1_188;
                  if (s == "ds1_whelptoken") return CardDB.cardIDEnum.ds1_whelptoken;
                  if (s == "EX1_001") return CardDB.cardIDEnum.EX1_001;
                  if (s == "EX1_001e") return CardDB.cardIDEnum.EX1_001e;
                  if (s == "EX1_002") return CardDB.cardIDEnum.EX1_002;
                  if (s == "EX1_004") return CardDB.cardIDEnum.EX1_004;
                  if (s == "EX1_004e") return CardDB.cardIDEnum.EX1_004e;
                  if (s == "EX1_005") return CardDB.cardIDEnum.EX1_005;
                  if (s == "EX1_006") return CardDB.cardIDEnum.EX1_006;
                  if (s == "EX1_007") return CardDB.cardIDEnum.EX1_007;
                  if (s == "EX1_008") return CardDB.cardIDEnum.EX1_008;
                  if (s == "EX1_009") return CardDB.cardIDEnum.EX1_009;
                  if (s == "EX1_010") return CardDB.cardIDEnum.EX1_010;
                  if (s == "EX1_012") return CardDB.cardIDEnum.EX1_012;
                  if (s == "EX1_014") return CardDB.cardIDEnum.EX1_014;
                  if (s == "EX1_014t") return CardDB.cardIDEnum.EX1_014t;
                  if (s == "EX1_014te") return CardDB.cardIDEnum.EX1_014te;
                  if (s == "EX1_016") return CardDB.cardIDEnum.EX1_016;
                  if (s == "EX1_017") return CardDB.cardIDEnum.EX1_017;
                  if (s == "EX1_020") return CardDB.cardIDEnum.EX1_020;
                  if (s == "EX1_021") return CardDB.cardIDEnum.EX1_021;
                  if (s == "EX1_023") return CardDB.cardIDEnum.EX1_023;
                  if (s == "EX1_028") return CardDB.cardIDEnum.EX1_028;
                  if (s == "EX1_029") return CardDB.cardIDEnum.EX1_029;
                  if (s == "EX1_032") return CardDB.cardIDEnum.EX1_032;
                  if (s == "EX1_033") return CardDB.cardIDEnum.EX1_033;
                  if (s == "EX1_043") return CardDB.cardIDEnum.EX1_043;
                  if (s == "EX1_043e") return CardDB.cardIDEnum.EX1_043e;
                  if (s == "EX1_044") return CardDB.cardIDEnum.EX1_044;
                  if (s == "EX1_044e") return CardDB.cardIDEnum.EX1_044e;
                  if (s == "EX1_045") return CardDB.cardIDEnum.EX1_045;
                  if (s == "EX1_046") return CardDB.cardIDEnum.EX1_046;
                  if (s == "EX1_046e") return CardDB.cardIDEnum.EX1_046e;
                  if (s == "EX1_048") return CardDB.cardIDEnum.EX1_048;
                  if (s == "EX1_049") return CardDB.cardIDEnum.EX1_049;
                  if (s == "EX1_050") return CardDB.cardIDEnum.EX1_050;
                  if (s == "EX1_055") return CardDB.cardIDEnum.EX1_055;
                  if (s == "EX1_055o") return CardDB.cardIDEnum.EX1_055o;
                  if (s == "EX1_057") return CardDB.cardIDEnum.EX1_057;
                  if (s == "EX1_058") return CardDB.cardIDEnum.EX1_058;
                  if (s == "EX1_059") return CardDB.cardIDEnum.EX1_059;
                  if (s == "EX1_059e") return CardDB.cardIDEnum.EX1_059e;
                  if (s == "EX1_067") return CardDB.cardIDEnum.EX1_067;
                  if (s == "EX1_076") return CardDB.cardIDEnum.EX1_076;
                  if (s == "EX1_080") return CardDB.cardIDEnum.EX1_080;
                  if (s == "EX1_080o") return CardDB.cardIDEnum.EX1_080o;
                  if (s == "EX1_082") return CardDB.cardIDEnum.EX1_082;
                  if (s == "EX1_083") return CardDB.cardIDEnum.EX1_083;
                  if (s == "EX1_085") return CardDB.cardIDEnum.EX1_085;
                  if (s == "EX1_089") return CardDB.cardIDEnum.EX1_089;
                  if (s == "EX1_091") return CardDB.cardIDEnum.EX1_091;
                  if (s == "EX1_093") return CardDB.cardIDEnum.EX1_093;
                  //...
                  if (s == "PlaceholderCard") return CardDB.cardIDEnum.PlaceholderCard;
                  return CardDB.cardIDEnum.None;
              }
      When you can just use:

      Code:
              public cardIDEnum cardIdstringToEnum(string s)
              {
                  cardIDEnum type;
                  if (Enum.TryParse<cardIDEnum>(s, out type)) return type;
                  else return cardIDEnum.None;
              }
       
      Last edited: Jan 31, 2015
    2. Dcrew

      Dcrew New Member

      Joined:
      Jan 24, 2015
      Messages:
      38
      Likes Received:
      0
      Trophy Points:
      0
      I replaced the code with my new bit, and it still works, hell I'm sure it's a faster and more efficient bit of code.
       
    3. Dcrew

      Dcrew New Member

      Joined:
      Jan 24, 2015
      Messages:
      38
      Likes Received:
      0
      Trophy Points:
      0
      The same thing with this function:

      Code:
              public cardName cardNamestringToEnum(string s)
              {
                  cardName name;
                  if (Enum.TryParse<cardName>(s, out name)) return name;
                  if (s == "unknown") return CardDB.cardName.unknown;
                  if (s == "lesserheal") return CardDB.cardName.lesserheal;
                  if (s == "goldshirefootman") return CardDB.cardName.goldshirefootman;
                  if (s == "holynova") return CardDB.cardName.holynova;
                  if (s == "mindcontrol") return CardDB.cardName.mindcontrol;
                  if (s == "holysmite") return CardDB.cardName.holysmite;
                  if (s == "mindvision") return CardDB.cardName.mindvision;
                  if (s == "powerwordshield") return CardDB.cardName.powerwordshield;
                  if (s == "claw") return CardDB.cardName.claw;
                  if (s == "healingtouch") return CardDB.cardName.healingtouch;
                  if (s == "moonfire") return CardDB.cardName.moonfire;
                  if (s == "markofthewild") return CardDB.cardName.markofthewild;
                  if (s == "savageroar") return CardDB.cardName.savageroar;
                  if (s == "swipe") return CardDB.cardName.swipe;
                  if (s == "wildgrowth") return CardDB.cardName.wildgrowth;
                  if (s == "excessmana") return CardDB.cardName.excessmana;
                  if (s == "shapeshift") return CardDB.cardName.shapeshift;
                  if (s == "polymorph") return CardDB.cardName.polymorph;
                  if (s == "arcaneintellect") return CardDB.cardName.arcaneintellect;
                  if (s == "frostbolt") return CardDB.cardName.frostbolt;
                  if (s == "arcaneexplosion") return CardDB.cardName.arcaneexplosion;
                  if (s == "frostnova") return CardDB.cardName.frostnova;
                  if (s == "mirrorimage") return CardDB.cardName.mirrorimage;
                  if (s == "fireball") return CardDB.cardName.fireball;
                  if (s == "flamestrike") return CardDB.cardName.flamestrike;
                  if (s == "waterelemental") return CardDB.cardName.waterelemental;
                  if (s == "fireblast") return CardDB.cardName.fireblast;
                  if (s == "frostshock") return CardDB.cardName.frostshock;
                  if (s == "windfury") return CardDB.cardName.windfury;
                  if (s == "ancestralhealing") return CardDB.cardName.ancestralhealing;
                  if (s == "fireelemental") return CardDB.cardName.fireelemental;
                  if (s == "rockbiterweapon") return CardDB.cardName.rockbiterweapon;
                  if (s == "bloodlust") return CardDB.cardName.bloodlust;
                  if (s == "totemiccall") return CardDB.cardName.totemiccall;
                  if (s == "searingtotem") return CardDB.cardName.searingtotem;
                  if (s == "stoneclawtotem") return CardDB.cardName.stoneclawtotem;
                  if (s == "wrathofairtotem") return CardDB.cardName.wrathofairtotem;
                  if (s == "lifetap") return CardDB.cardName.lifetap;
                  if (s == "shadowbolt") return CardDB.cardName.shadowbolt;
                  if (s == "drainlife") return CardDB.cardName.drainlife;
                  if (s == "hellfire") return CardDB.cardName.hellfire;
                  if (s == "corruption") return CardDB.cardName.corruption;
                  if (s == "dreadinfernal") return CardDB.cardName.dreadinfernal;
                  if (s == "voidwalker") return CardDB.cardName.voidwalker;
                  if (s == "backstab") return CardDB.cardName.backstab;
                  if (s == "deadlypoison") return CardDB.cardName.deadlypoison;
                  if (s == "sinisterstrike") return CardDB.cardName.sinisterstrike;
                  if (s == "assassinate") return CardDB.cardName.assassinate;
                  if (s == "sprint") return CardDB.cardName.sprint;
                  if (s == "assassinsblade") return CardDB.cardName.assassinsblade;
                  if (s == "wickedknife") return CardDB.cardName.wickedknife;
                  if (s == "daggermastery") return CardDB.cardName.daggermastery;
                  if (s == "huntersmark") return CardDB.cardName.huntersmark;
                  if (s == "blessingofmight") return CardDB.cardName.blessingofmight;
                  if (s == "guardianofkings") return CardDB.cardName.guardianofkings;
                  if (s == "holylight") return CardDB.cardName.holylight;
                  if (s == "lightsjustice") return CardDB.cardName.lightsjustice;
                  if (s == "blessingofkings") return CardDB.cardName.blessingofkings;
                  if (s == "consecration") return CardDB.cardName.consecration;
                  if (s == "hammerofwrath") return CardDB.cardName.hammerofwrath;
                  if (s == "truesilverchampion") return CardDB.cardName.truesilverchampion;
                  if (s == "reinforce") return CardDB.cardName.reinforce;
                  if (s == "silverhandrecruit") return CardDB.cardName.silverhandrecruit;
                  if (s == "armorup") return CardDB.cardName.armorup;
                  if (s == "charge") return CardDB.cardName.charge;
                  if (s == "heroicstrike") return CardDB.cardName.heroicstrike;
                  if (s == "fierywaraxe") return CardDB.cardName.fierywaraxe;
                  if (s == "execute") return CardDB.cardName.execute;
                  if (s == "arcanitereaper") return CardDB.cardName.arcanitereaper;
                  if (s == "cleave") return CardDB.cardName.cleave;
                  if (s == "magmarager") return CardDB.cardName.magmarager;
                  if (s == "oasissnapjaw") return CardDB.cardName.oasissnapjaw;
                  if (s == "rivercrocolisk") return CardDB.cardName.rivercrocolisk;
                  if (s == "frostwolfgrunt") return CardDB.cardName.frostwolfgrunt;
                  if (s == "raidleader") return CardDB.cardName.raidleader;
                  if (s == "wolfrider") return CardDB.cardName.wolfrider;
                  if (s == "ironfurgrizzly") return CardDB.cardName.ironfurgrizzly;
                  if (s == "silverbackpatriarch") return CardDB.cardName.silverbackpatriarch;
                  if (s == "stormwindknight") return CardDB.cardName.stormwindknight;
                  if (s == "ironforgerifleman") return CardDB.cardName.ironforgerifleman;
                  if (s == "koboldgeomancer") return CardDB.cardName.koboldgeomancer;
                  if (s == "gnomishinventor") return CardDB.cardName.gnomishinventor;
                  if (s == "stormpikecommando") return CardDB.cardName.stormpikecommando;
                  if (s == "archmage") return CardDB.cardName.archmage;
                  if (s == "lordofthearena") return CardDB.cardName.lordofthearena;
                  if (s == "murlocraider") return CardDB.cardName.murlocraider;
                  if (s == "stonetuskboar") return CardDB.cardName.stonetuskboar;
                  if (s == "bloodfenraptor") return CardDB.cardName.bloodfenraptor;
                  if (s == "bluegillwarrior") return CardDB.cardName.bluegillwarrior;
                  if (s == "senjinshieldmasta") return CardDB.cardName.senjinshieldmasta;
                  if (s == "chillwindyeti") return CardDB.cardName.chillwindyeti;
                  if (s == "wargolem") return CardDB.cardName.wargolem;
                  if (s == "bootybaybodyguard") return CardDB.cardName.bootybaybodyguard;
                  if (s == "elvenarcher") return CardDB.cardName.elvenarcher;
                  if (s == "razorfenhunter") return CardDB.cardName.razorfenhunter;
                  if (s == "ogremagi") return CardDB.cardName.ogremagi;
                  if (s == "boulderfistogre") return CardDB.cardName.boulderfistogre;
                  if (s == "corehound") return CardDB.cardName.corehound;
                  if (s == "recklessrocketeer") return CardDB.cardName.recklessrocketeer;
                  if (s == "stormwindchampion") return CardDB.cardName.stormwindchampion;
                  if (s == "frostwolfwarlord") return CardDB.cardName.frostwolfwarlord;
                  if (s == "ironbarkprotector") return CardDB.cardName.ironbarkprotector;
                  if (s == "shadowwordpain") return CardDB.cardName.shadowwordpain;
                  if (s == "northshirecleric") return CardDB.cardName.northshirecleric;
                  if (s == "divinespirit") return CardDB.cardName.divinespirit;
                  if (s == "starvingbuzzard") return CardDB.cardName.starvingbuzzard;
                  if (s == "boar") return CardDB.cardName.boar;
                  if (s == "sheep") return CardDB.cardName.sheep;
                  if (s == "steadyshot") return CardDB.cardName.steadyshot;
                  if (s == "darkscalehealer") return CardDB.cardName.darkscalehealer;
                  if (s == "houndmaster") return CardDB.cardName.houndmaster;
                  if (s == "timberwolf") return CardDB.cardName.timberwolf;
                  if (s == "tundrarhino") return CardDB.cardName.tundrarhino;
                  if (s == "multishot") return CardDB.cardName.multishot;
                  if (s == "tracking") return CardDB.cardName.tracking;
                  if (s == "arcaneshot") return CardDB.cardName.arcaneshot;
                  if (s == "mindblast") return CardDB.cardName.mindblast;
                  if (s == "voodoodoctor") return CardDB.cardName.voodoodoctor;
                  if (s == "noviceengineer") return CardDB.cardName.noviceengineer;
                  if (s == "shatteredsuncleric") return CardDB.cardName.shatteredsuncleric;
                  if (s == "dragonlingmechanic") return CardDB.cardName.dragonlingmechanic;
                  if (s == "mechanicaldragonling") return CardDB.cardName.mechanicaldragonling;
                  if (s == "acidicswampooze") return CardDB.cardName.acidicswampooze;
                  if (s == "warsongcommander") return CardDB.cardName.warsongcommander;
                  if (s == "fanofknives") return CardDB.cardName.fanofknives;
                  if (s == "innervate") return CardDB.cardName.innervate;
                  if (s == "starfire") return CardDB.cardName.starfire;
                  if (s == "totemicmight") return CardDB.cardName.totemicmight;
                  if (s == "hex") return CardDB.cardName.hex;
                  if (s == "arcanemissiles") return CardDB.cardName.arcanemissiles;
                  if (s == "shiv") return CardDB.cardName.shiv;
                  if (s == "mortalcoil") return CardDB.cardName.mortalcoil;
                  if (s == "succubus") return CardDB.cardName.succubus;
                  if (s == "soulfire") return CardDB.cardName.soulfire;
                  if (s == "humility") return CardDB.cardName.humility;
                  if (s == "handofprotection") return CardDB.cardName.handofprotection;
                  if (s == "gurubashiberserker") return CardDB.cardName.gurubashiberserker;
                  if (s == "whirlwind") return CardDB.cardName.whirlwind;
                  if (s == "murloctidehunter") return CardDB.cardName.murloctidehunter;
                  if (s == "murlocscout") return CardDB.cardName.murlocscout;
                  if (s == "grimscaleoracle") return CardDB.cardName.grimscaleoracle;
                  if (s == "killcommand") return CardDB.cardName.killcommand;
                  if (s == "flametonguetotem") return CardDB.cardName.flametonguetotem;
                  if (s == "sap") return CardDB.cardName.sap;
                  if (s == "dalaranmage") return CardDB.cardName.dalaranmage;
                  if (s == "windspeaker") return CardDB.cardName.windspeaker;
                  if (s == "nightblade") return CardDB.cardName.nightblade;
                  if (s == "shieldblock") return CardDB.cardName.shieldblock;
                  if (s == "shadowworddeath") return CardDB.cardName.shadowworddeath;
                  if (s == "avatarofthecoin") return CardDB.cardName.avatarofthecoin;
                  if (s == "thecoin") return CardDB.cardName.thecoin;
                  if (s == "noooooooooooo") return CardDB.cardName.noooooooooooo;
                  if (s == "garroshhellscream") return CardDB.cardName.garroshhellscream;
                  if (s == "thrall") return CardDB.cardName.thrall;
                  if (s == "valeerasanguinar") return CardDB.cardName.valeerasanguinar;
                  if (s == "utherlightbringer") return CardDB.cardName.utherlightbringer;
                  if (s == "rexxar") return CardDB.cardName.rexxar;
                  if (s == "malfurionstormrage") return CardDB.cardName.malfurionstormrage;
                  if (s == "guldan") return CardDB.cardName.guldan;
                  if (s == "jainaproudmoore") return CardDB.cardName.jainaproudmoore;
                  if (s == "anduinwrynn") return CardDB.cardName.anduinwrynn;
                  if (s == "frog") return CardDB.cardName.frog;
                  if (s == "sacrificialpact") return CardDB.cardName.sacrificialpact;
                  if (s == "vanish") return CardDB.cardName.vanish;
                  if (s == "healingtotem") return CardDB.cardName.healingtotem;
                  if (s == "korkronelite") return CardDB.cardName.korkronelite;
                  if (s == "animalcompanion") return CardDB.cardName.animalcompanion;
                  if (s == "misha") return CardDB.cardName.misha;
                  if (s == "leokk") return CardDB.cardName.leokk;
                  if (s == "huffer") return CardDB.cardName.huffer;
                  if (s == "skeleton") return CardDB.cardName.skeleton;
                  if (s == "fencreeper") return CardDB.cardName.fencreeper;
                  if (s == "innerfire") return CardDB.cardName.innerfire;
                  if (s == "blizzard") return CardDB.cardName.blizzard;
                  if (s == "icelance") return CardDB.cardName.icelance;
                  if (s == "ancestralspirit") return CardDB.cardName.ancestralspirit;
                  if (s == "farsight") return CardDB.cardName.farsight;
                  if (s == "bloodimp") return CardDB.cardName.bloodimp;
                  if (s == "coldblood") return CardDB.cardName.coldblood;
                  if (s == "rampage") return CardDB.cardName.rampage;
                  if (s == "earthenringfarseer") return CardDB.cardName.earthenringfarseer;
                  if (s == "southseadeckhand") return CardDB.cardName.southseadeckhand;
                  if (s == "silverhandknight") return CardDB.cardName.silverhandknight;
                  if (s == "squire") return CardDB.cardName.squire;
                  if (s == "ravenholdtassassin") return CardDB.cardName.ravenholdtassassin;
                  if (s == "youngdragonhawk") return CardDB.cardName.youngdragonhawk;
                  if (s == "injuredblademaster") return CardDB.cardName.injuredblademaster;
                  if (s == "abusivesergeant") return CardDB.cardName.abusivesergeant;
                  if (s == "ironbeakowl") return CardDB.cardName.ironbeakowl;
                  if (s == "spitefulsmith") return CardDB.cardName.spitefulsmith;
                  if (s == "venturecomercenary") return CardDB.cardName.venturecomercenary;
                  if (s == "wisp") return CardDB.cardName.wisp;
                  if (s == "bladeflurry") return CardDB.cardName.bladeflurry;
                  if (s == "laughingsister") return CardDB.cardName.laughingsister;
                  if (s == "yseraawakens") return CardDB.cardName.yseraawakens;
                  if (s == "emeralddrake") return CardDB.cardName.emeralddrake;
                  if (s == "dream") return CardDB.cardName.dream;
                  if (s == "nightmare") return CardDB.cardName.nightmare;
                  if (s == "gladiatorslongbow") return CardDB.cardName.gladiatorslongbow;
                  if (s == "whelp") return CardDB.cardName.whelp;
                  if (s == "lightwarden") return CardDB.cardName.lightwarden;
                  if (s == "theblackknight") return CardDB.cardName.theblackknight;
                  if (s == "youngpriestess") return CardDB.cardName.youngpriestess;
                  if (s == "biggamehunter") return CardDB.cardName.biggamehunter;
                  if (s == "alarmobot") return CardDB.cardName.alarmobot;
                  if (s == "acolyteofpain") return CardDB.cardName.acolyteofpain;
                  if (s == "argentsquire") return CardDB.cardName.argentsquire;
                  if (s == "angrychicken") return CardDB.cardName.angrychicken;
                  if (s == "worgeninfiltrator") return CardDB.cardName.worgeninfiltrator;
                  if (s == "bloodmagethalnos") return CardDB.cardName.bloodmagethalnos;
                  if (s == "kingmukla") return CardDB.cardName.kingmukla;
                  if (s == "bananas") return CardDB.cardName.bananas;
                  if (s == "sylvanaswindrunner") return CardDB.cardName.sylvanaswindrunner;
                  if (s == "junglepanther") return CardDB.cardName.junglepanther;
                  if (s == "scarletcrusader") return CardDB.cardName.scarletcrusader;
                  if (s == "thrallmarfarseer") return CardDB.cardName.thrallmarfarseer;
                  if (s == "silvermoonguardian") return CardDB.cardName.silvermoonguardian;
                  if (s == "stranglethorntiger") return CardDB.cardName.stranglethorntiger;
                  if (s == "lepergnome") return CardDB.cardName.lepergnome;
                  if (s == "sunwalker") return CardDB.cardName.sunwalker;
                  if (s == "windfuryharpy") return CardDB.cardName.windfuryharpy;
                  if (s == "twilightdrake") return CardDB.cardName.twilightdrake;
                  if (s == "questingadventurer") return CardDB.cardName.questingadventurer;
                  if (s == "ancientwatcher") return CardDB.cardName.ancientwatcher;
                  if (s == "darkirondwarf") return CardDB.cardName.darkirondwarf;
                  if (s == "spellbreaker") return CardDB.cardName.spellbreaker;
                  if (s == "youthfulbrewmaster") return CardDB.cardName.youthfulbrewmaster;
                  if (s == "coldlightoracle") return CardDB.cardName.coldlightoracle;
                  if (s == "manaaddict") return CardDB.cardName.manaaddict;
                  if (s == "ancientbrewmaster") return CardDB.cardName.ancientbrewmaster;
                  if (s == "sunfuryprotector") return CardDB.cardName.sunfuryprotector;
                  if (s == "crazedalchemist") return CardDB.cardName.crazedalchemist;
                  if (s == "argentcommander") return CardDB.cardName.argentcommander;
                  if (s == "pintsizedsummoner") return CardDB.cardName.pintsizedsummoner;
                  if (s == "secretkeeper") return CardDB.cardName.secretkeeper;
                  if (s == "madbomber") return CardDB.cardName.madbomber;
                  if (s == "tinkmasteroverspark") return CardDB.cardName.tinkmasteroverspark;
                  if (s == "mindcontroltech") return CardDB.cardName.mindcontroltech;
                  if (s == "arcanegolem") return CardDB.cardName.arcanegolem;
                  if (s == "cabalshadowpriest") return CardDB.cardName.cabalshadowpriest;
                  if (s == "defenderofargus") return CardDB.cardName.defenderofargus;
                  if (s == "gadgetzanauctioneer") return CardDB.cardName.gadgetzanauctioneer;
                  if (s == "loothoarder") return CardDB.cardName.loothoarder;
                  if (s == "abomination") return CardDB.cardName.abomination;
                  if (s == "lorewalkercho") return CardDB.cardName.lorewalkercho;
                  if (s == "demolisher") return CardDB.cardName.demolisher;
                  if (s == "coldlightseer") return CardDB.cardName.coldlightseer;
                  if (s == "mountaingiant") return CardDB.cardName.mountaingiant;
                  if (s == "cairnebloodhoof") return CardDB.cardName.cairnebloodhoof;
                  if (s == "bainebloodhoof") return CardDB.cardName.bainebloodhoof;
                  if (s == "leeroyjenkins") return CardDB.cardName.leeroyjenkins;
                  if (s == "eviscerate") return CardDB.cardName.eviscerate;
                  if (s == "betrayal") return CardDB.cardName.betrayal;
                  if (s == "conceal") return CardDB.cardName.conceal;
                  if (s == "noblesacrifice") return CardDB.cardName.noblesacrifice;
                  if (s == "defender") return CardDB.cardName.defender;
                  if (s == "defiasringleader") return CardDB.cardName.defiasringleader;
                  if (s == "defiasbandit") return CardDB.cardName.defiasbandit;
                  if (s == "eyeforaneye") return CardDB.cardName.eyeforaneye;
                  if (s == "perditionsblade") return CardDB.cardName.perditionsblade;
                  if (s == "si7agent") return CardDB.cardName.si7agent;
                  if (s == "redemption") return CardDB.cardName.redemption;
                  if (s == "head*****") return CardDB.cardName.head*****;
                  if (s == "shadowstep") return CardDB.cardName.shadowstep;
                  if (s == "preparation") return CardDB.cardName.preparation;
                  if (s == "wrath") return CardDB.cardName.wrath;
                  if (s == "markofnature") return CardDB.cardName.markofnature;
                  if (s == "souloftheforest") return CardDB.cardName.souloftheforest;
                  if (s == "treant") return CardDB.cardName.treant;
                  if (s == "powerofthewild") return CardDB.cardName.powerofthewild;
                  if (s == "summonapanther") return CardDB.cardName.summonapanther;
                  if (s == "leaderofthepack") return CardDB.cardName.leaderofthepack;
                  if (s == "panther") return CardDB.cardName.panther;
                  if (s == "naturalize") return CardDB.cardName.naturalize;
                  if (s == "direwolfalpha") return CardDB.cardName.direwolfalpha;
                  if (s == "nourish") return CardDB.cardName.nourish;
                  if (s == "druidoftheclaw") return CardDB.cardName.druidoftheclaw;
                  if (s == "catform") return CardDB.cardName.catform;
                  if (s == "bearform") return CardDB.cardName.bearform;
                  if (s == "keeperofthegrove") return CardDB.cardName.keeperofthegrove;
                  if (s == "dispel") return CardDB.cardName.dispel;
                  if (s == "emperorcobra") return CardDB.cardName.emperorcobra;
                  if (s == "ancientofwar") return CardDB.cardName.ancientofwar;
                  if (s == "rooted") return CardDB.cardName.rooted;
                  if (s == "uproot") return CardDB.cardName.uproot;
                  if (s == "lightningbolt") return CardDB.cardName.lightningbolt;
                  if (s == "lavaburst") return CardDB.cardName.lavaburst;
                  if (s == "dustdevil") return CardDB.cardName.dustdevil;
                  if (s == "earthshock") return CardDB.cardName.earthshock;
                  if (s == "stormforgedaxe") return CardDB.cardName.stormforgedaxe;
                  if (s == "feralspirit") return CardDB.cardName.feralspirit;
                  if (s == "barongeddon") return CardDB.cardName.barongeddon;
                  if (s == "earthelemental") return CardDB.cardName.earthelemental;
                  if (s == "forkedlightning") return CardDB.cardName.forkedlightning;
                  if (s == "unboundelemental") return CardDB.cardName.unboundelemental;
                  if (s == "lightningstorm") return CardDB.cardName.lightningstorm;
                  if (s == "etherealarcanist") return CardDB.cardName.etherealarcanist;
                  if (s == "coneofcold") return CardDB.cardName.coneofcold;
                  if (s == "pyroblast") return CardDB.cardName.pyroblast;
                  if (s == "frostelemental") return CardDB.cardName.frostelemental;
                  if (s == "azuredrake") return CardDB.cardName.azuredrake;
                  if (s == "counterspell") return CardDB.cardName.counterspell;
                  if (s == "icebarrier") return CardDB.cardName.icebarrier;
                  if (s == "mirrorentity") return CardDB.cardName.mirrorentity;
                  if (s == "iceblock") return CardDB.cardName.iceblock;
                  if (s == "ragnarosthefirelord") return CardDB.cardName.ragnarosthefirelord;
                  if (s == "felguard") return CardDB.cardName.felguard;
                  if (s == "shadowflame") return CardDB.cardName.shadowflame;
                  if (s == "voidterror") return CardDB.cardName.voidterror;
                  if (s == "siphonsoul") return CardDB.cardName.siphonsoul;
                  if (s == "doomguard") return CardDB.cardName.doomguard;
                  if (s == "twistingnether") return CardDB.cardName.twistingnether;
                  if (s == "pitlord") return CardDB.cardName.pitlord;
                  if (s == "summoningportal") return CardDB.cardName.summoningportal;
                  if (s == "poweroverwhelming") return CardDB.cardName.poweroverwhelming;
                  if (s == "sensedemons") return CardDB.cardName.sensedemons;
                  if (s == "worthlessimp") return CardDB.cardName.worthlessimp;
                  if (s == "flameimp") return CardDB.cardName.flameimp;
                  //...
                  if (s == "placeholdercard") return CardDB.cardName.placeholdercard;
                  return CardDB.cardName.unknown;
              }
      Code:
              public cardName cardNamestringToEnum(string s)
              {
                  cardName name;
                  if (Enum.TryParse<cardName>(s, out name)) return name;
                  else return CardDB.cardName.unknown;
              }
       

    Share This Page