GetFromHashtable.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using System;
  4. using System.Linq;
  5. using UnityEngine;
  6. public partial class CardEffectCommons
  7. {
  8. #region Get CardEffect from hashtable
  9. public static ICardEffect GetCardEffectFromHashtable(Hashtable hashtable)
  10. {
  11. if (hashtable != null)
  12. {
  13. if (hashtable.ContainsKey("CardEffect"))
  14. {
  15. if (hashtable["CardEffect"] is ICardEffect)
  16. {
  17. ICardEffect CardEffect = (ICardEffect)hashtable["CardEffect"];
  18. return CardEffect;
  19. }
  20. }
  21. }
  22. return null;
  23. }
  24. #endregion
  25. #region Get SkillInfo from hashtable
  26. public static List<SkillInfo> GetSkillFromHashtable(Hashtable hashtable)
  27. {
  28. if (hashtable != null)
  29. {
  30. if (hashtable.ContainsKey("SkillInfo"))
  31. {
  32. if (hashtable["SkillInfo"] is List<SkillInfo>)
  33. {
  34. List<SkillInfo> skillInfo = (List<SkillInfo>)hashtable["SkillInfo"];
  35. return skillInfo;
  36. }
  37. }
  38. }
  39. return null;
  40. }
  41. #endregion
  42. #region Get Root from hashtable
  43. public static SelectCardEffect.Root GetRootFromHashtable(Hashtable hashtable)
  44. {
  45. if (hashtable != null)
  46. {
  47. if (hashtable.ContainsKey("Root"))
  48. {
  49. if (hashtable["Root"] is SelectCardEffect.Root)
  50. {
  51. SelectCardEffect.Root Root = (SelectCardEffect.Root)hashtable["Root"];
  52. return Root;
  53. }
  54. }
  55. }
  56. return SelectCardEffect.Root.None;
  57. }
  58. #endregion
  59. #region Get IsAttack from hashtable
  60. public static bool IsAttack(Hashtable hashtable)
  61. {
  62. if (hashtable != null)
  63. {
  64. if (hashtable.ContainsKey("IsAttack"))
  65. {
  66. if (hashtable["IsAttack"] is bool)
  67. {
  68. return (bool)hashtable["IsAttack"];
  69. }
  70. }
  71. }
  72. return false;
  73. }
  74. #endregion
  75. #region Get IsBlock from hashtable
  76. public static bool IsBlock(Hashtable hashtable)
  77. {
  78. if (hashtable != null)
  79. {
  80. if (hashtable.ContainsKey("IsBlock"))
  81. {
  82. if (hashtable["IsBlock"] is bool)
  83. {
  84. return (bool)hashtable["IsBlock"];
  85. }
  86. }
  87. }
  88. return false;
  89. }
  90. #endregion
  91. #region Get IsBurst from hashtable
  92. public static bool IsBurst(Hashtable hashtable)
  93. {
  94. if (hashtable != null)
  95. {
  96. if (hashtable.ContainsKey("IsBurst"))
  97. {
  98. if (hashtable["IsBurst"] is bool)
  99. {
  100. return (bool)hashtable["IsBurst"];
  101. }
  102. }
  103. }
  104. return false;
  105. }
  106. #endregion
  107. #region Get IsFromSameDigimon from hashtable
  108. public static bool IsFromSameDigimon(Hashtable hashtable)
  109. {
  110. if (hashtable != null)
  111. {
  112. if (hashtable.ContainsKey("isFromSameDigimon"))
  113. {
  114. if (hashtable["isFromSameDigimon"] is bool)
  115. {
  116. return (bool)hashtable["isFromSameDigimon"];
  117. }
  118. }
  119. }
  120. return false;
  121. }
  122. #endregion
  123. #region Get IsFromDigimon from hashtable
  124. public static bool IsFromDigimon(Hashtable hashtable)
  125. {
  126. if (hashtable != null)
  127. {
  128. if (hashtable.ContainsKey("isFromDigimon"))
  129. {
  130. if (hashtable["isFromDigimon"] is bool)
  131. {
  132. return (bool)hashtable["isFromDigimon"];
  133. }
  134. }
  135. }
  136. return false;
  137. }
  138. #endregion
  139. #region Get IsFromDigimonDigivolutionCards from hashtable
  140. public static bool IsFromDigimonDigivolutionCards(Hashtable hashtable)
  141. {
  142. if (hashtable != null)
  143. {
  144. if (hashtable.ContainsKey("isFromDigimonDigivolutionCards"))
  145. {
  146. if (hashtable["isFromDigimonDigivolutionCards"] is bool)
  147. {
  148. return (bool)hashtable["isFromDigimonDigivolutionCards"];
  149. }
  150. }
  151. }
  152. return false;
  153. }
  154. #endregion
  155. #region Get TopCard from hashtable of card effect
  156. public static CardSource GetTopCardFromEffectHashtable(Hashtable hashtable)
  157. {
  158. List<Hashtable> hashtables = GetHashtablesFromHashtable(hashtable);
  159. if (hashtables != null)
  160. {
  161. foreach (Hashtable hashtable1 in hashtables)
  162. {
  163. CardSource TopCard = GetTopCardFromOneHashtable(hashtable1);
  164. if (TopCard != null)
  165. {
  166. return TopCard;
  167. }
  168. }
  169. }
  170. return null;
  171. }
  172. #endregion
  173. #region Get EvoRootTops from hashtable of card effect
  174. public static List<CardSource> GetEvoRootTopsFromEnterFieldHashtable(Hashtable hashtable, Func<Permanent, bool> permanentCondition)
  175. {
  176. List<Hashtable> hashtables = GetHashtablesFromHashtable(hashtable);
  177. if (hashtables != null)
  178. {
  179. foreach (Hashtable hashtable1 in hashtables)
  180. {
  181. Permanent permanent1 = GetPermanentFromHashtable(hashtable1);
  182. if (permanent1 != null)
  183. {
  184. if (permanentCondition == null || permanentCondition(permanent1))
  185. {
  186. if (hashtable1 != null)
  187. {
  188. if (hashtable1.ContainsKey("evoRootTops"))
  189. {
  190. if (hashtable1["evoRootTops"] is List<CardSource>)
  191. {
  192. return (List<CardSource>)hashtable1["evoRootTops"];
  193. }
  194. }
  195. }
  196. }
  197. }
  198. }
  199. }
  200. return null;
  201. }
  202. #endregion
  203. #region Get Permanents from hashtable
  204. public static List<Permanent> GetPlayedPermanentsFromEnterFieldHashtable(Hashtable hashtable, Func<SelectCardEffect.Root, bool> rootCondition)
  205. {
  206. List<Hashtable> hashtables = GetHashtablesFromHashtable(hashtable);
  207. if (hashtables != null)
  208. {
  209. return hashtables
  210. .Filter(hashtable1 => rootCondition == null || rootCondition(GetRootFromHashtable(hashtable1)))
  211. .Map(hashtable1 => GetPermanentFromHashtable(hashtable1)).Filter(permanent => permanent != null && permanent.TopCard != null);
  212. }
  213. return null;
  214. }
  215. #endregion
  216. #region Get Attacking Permanent from hashtable
  217. public static Permanent GetAttackerFromHashtable(Hashtable hashtable)
  218. {
  219. if (hashtable != null)
  220. {
  221. if (hashtable.ContainsKey("AttackingPermanent"))
  222. {
  223. if (hashtable["AttackingPermanent"] is Permanent)
  224. {
  225. Permanent permanent = (Permanent)hashtable["AttackingPermanent"];
  226. return permanent;
  227. }
  228. }
  229. }
  230. return null;
  231. }
  232. #endregion
  233. #region Get hashtables from hashtable of card effect
  234. public static List<Hashtable> GetHashtablesFromHashtable(Hashtable hashtable)
  235. {
  236. if (hashtable != null)
  237. {
  238. if (hashtable.ContainsKey("hashtables"))
  239. {
  240. if (hashtable["hashtables"] is List<Hashtable>)
  241. {
  242. List<Hashtable> hashtables = (List<Hashtable>)hashtable["hashtables"];
  243. if (hashtables != null)
  244. {
  245. return hashtables;
  246. }
  247. }
  248. }
  249. }
  250. return null;
  251. }
  252. #endregion
  253. #region Get TopCard from 1 hashtable
  254. public static CardSource GetTopCardFromOneHashtable(Hashtable hashtable)
  255. {
  256. if (hashtable != null)
  257. {
  258. if (hashtable.ContainsKey("TopCard"))
  259. {
  260. if (hashtable["TopCard"] is CardSource)
  261. {
  262. CardSource TopCard = (CardSource)hashtable["TopCard"];
  263. return TopCard;
  264. }
  265. }
  266. }
  267. return null;
  268. }
  269. #endregion
  270. #region Get Card from 1 hashtable
  271. public static CardSource GetCardFromHashtable(Hashtable hashtable)
  272. {
  273. if (hashtable != null)
  274. {
  275. if (hashtable.ContainsKey("Card"))
  276. {
  277. if (hashtable["Card"] is CardSource)
  278. {
  279. CardSource Card = (CardSource)hashtable["Card"];
  280. return Card;
  281. }
  282. }
  283. }
  284. return null;
  285. }
  286. #endregion
  287. #region Get Is Face Up from hashtable
  288. public static bool GetFaceDownFromHashtable(Hashtable hashtable)
  289. {
  290. if (hashtable != null)
  291. {
  292. if (hashtable.ContainsKey("isFaceDown"))
  293. {
  294. if (hashtable["isFaceDown"] is bool)
  295. {
  296. return (bool)hashtable["isFaceDown"];
  297. }
  298. }
  299. }
  300. return true;
  301. }
  302. #endregion
  303. #region Get battle info from hashtable
  304. public static IBattle GetBattleFromHashtable(Hashtable hashtable)
  305. {
  306. if (hashtable != null)
  307. {
  308. if (hashtable.ContainsKey("battle"))
  309. {
  310. if (hashtable["battle"] is IBattle)
  311. {
  312. return (IBattle)hashtable["battle"];
  313. }
  314. }
  315. }
  316. return null;
  317. }
  318. #endregion
  319. #region Get IsDP0 Delete from 1 hashtable
  320. public static bool IsDPZeroDelete(Hashtable hashtable)
  321. {
  322. if (hashtable != null)
  323. {
  324. if (hashtable.ContainsKey("DPZero"))
  325. {
  326. if (hashtable["DPZero"] is bool)
  327. {
  328. bool DPZero = (bool)hashtable["DPZero"];
  329. if (DPZero)
  330. {
  331. return true;
  332. }
  333. }
  334. }
  335. }
  336. return false;
  337. }
  338. #endregion
  339. #region Get whehter only 1 permanent is played from hashtable
  340. public static bool IsOnly1CardPlayed(Hashtable hashtable)
  341. {
  342. PlayCardClass playCardClass = GetPlayCardClassFromHashtable(hashtable);
  343. if (playCardClass != null)
  344. {
  345. if (playCardClass.CardSources.Count == 1)
  346. {
  347. return true;
  348. }
  349. }
  350. return false;
  351. }
  352. #endregion
  353. #region Get PlayCardClass from hashtable
  354. public static PlayCardClass GetPlayCardClassFromHashtable(Hashtable hashtable)
  355. {
  356. if (hashtable != null)
  357. {
  358. if (hashtable.ContainsKey("PlayCardClass"))
  359. {
  360. if (hashtable["PlayCardClass"] is PlayCardClass)
  361. {
  362. PlayCardClass IPlayCard = (PlayCardClass)hashtable["PlayCardClass"];
  363. if (IPlayCard != null)
  364. {
  365. return IPlayCard;
  366. }
  367. }
  368. }
  369. }
  370. return null;
  371. }
  372. #endregion
  373. #region whether the play associated with this hashtable is paying a cost or free
  374. public static bool GetPayCostFromHashtable(Hashtable hashtable)
  375. {
  376. return hashtable != null
  377. && hashtable.ContainsKey("PayCost")
  378. && hashtable["PayCost"] is bool
  379. && (bool)hashtable["PayCost"];
  380. }
  381. #endregion
  382. #region Get IsEvolution Delete from 1 hashtable
  383. public static bool IsEvolution(Hashtable hashtable)
  384. {
  385. if (hashtable.ContainsKey("isEvolution"))
  386. {
  387. if (hashtable["isEvolution"] is bool)
  388. {
  389. bool isEvolution = (bool)hashtable["isEvolution"];
  390. if (isEvolution)
  391. {
  392. return true;
  393. }
  394. }
  395. }
  396. return false;
  397. }
  398. #endregion
  399. #region Get Player from hashtable
  400. public static Player GetPlayerFromHashtable(Hashtable hashtable)
  401. {
  402. if (hashtable != null)
  403. {
  404. if (hashtable.ContainsKey("Player"))
  405. {
  406. if (hashtable["Player"] is Player)
  407. {
  408. Player Player = (Player)hashtable["Player"];
  409. return Player;
  410. }
  411. }
  412. }
  413. return null;
  414. }
  415. #endregion
  416. #region Get Players from hashtable
  417. public static List<Player> GetPlayersFromHashtable(Hashtable hashtable)
  418. {
  419. if (hashtable != null)
  420. {
  421. if (hashtable.ContainsKey("Players"))
  422. {
  423. if (hashtable["Players"] is List<Player>)
  424. {
  425. List<Player> Players = (List<Player>)hashtable["Players"];
  426. if (Players != null)
  427. {
  428. return Players;
  429. }
  430. }
  431. }
  432. }
  433. return null;
  434. }
  435. #endregion
  436. #region Get Permanents from hashtable
  437. public static List<Permanent> GetPermanentsFromHashtable(Hashtable hashtable)
  438. {
  439. if (hashtable != null)
  440. {
  441. if (hashtable.ContainsKey("Permanents"))
  442. {
  443. if (hashtable["Permanents"] is List<Permanent>)
  444. {
  445. List<Permanent> Permanents = (List<Permanent>)hashtable["Permanents"];
  446. if (Permanents != null)
  447. {
  448. return Permanents;
  449. }
  450. }
  451. }
  452. }
  453. return null;
  454. }
  455. #endregion
  456. #region Get WinnerPermanents_real from hashtable
  457. public static List<Permanent> GetWinnerPermanentsRealFromHashtable(Hashtable hashtable)
  458. {
  459. if (hashtable != null)
  460. {
  461. if (hashtable.ContainsKey("WinnerPermanents_real"))
  462. {
  463. if (hashtable["WinnerPermanents_real"] is List<Permanent>)
  464. {
  465. List<Permanent> WinnerPermanents_real = (List<Permanent>)hashtable["WinnerPermanents_real"];
  466. if (WinnerPermanents_real != null)
  467. {
  468. return WinnerPermanents_real;
  469. }
  470. }
  471. }
  472. }
  473. return null;
  474. }
  475. #endregion
  476. #region Get LoserPermanents from hashtable
  477. public static List<Permanent> GetLoserPermanentsFromHashtable(Hashtable hashtable)
  478. {
  479. if (hashtable != null)
  480. {
  481. if (hashtable.ContainsKey("LoserPermanents"))
  482. {
  483. if (hashtable["LoserPermanents"] is List<Permanent>)
  484. {
  485. List<Permanent> LoserPermanents = (List<Permanent>)hashtable["LoserPermanents"];
  486. if (LoserPermanents != null)
  487. {
  488. return LoserPermanents;
  489. }
  490. }
  491. }
  492. }
  493. return null;
  494. }
  495. #endregion
  496. #region Get Discarded Cards from hashtable
  497. public static List<CardSource> GetDiscardedCardsFromHashtable(Hashtable hashtable)
  498. {
  499. if (hashtable != null)
  500. {
  501. if (hashtable.ContainsKey("DiscardedCards"))
  502. {
  503. if (hashtable["DiscardedCards"] is List<CardSource>)
  504. {
  505. List<CardSource> DiscardedCards = (List<CardSource>)hashtable["DiscardedCards"];
  506. if (DiscardedCards != null)
  507. {
  508. return DiscardedCards;
  509. }
  510. }
  511. }
  512. }
  513. return null;
  514. }
  515. #endregion
  516. #region Get CardSources from hashtable
  517. public static List<CardSource> GetCardSourcesFromHashtable(Hashtable hashtable)
  518. {
  519. if (hashtable != null)
  520. {
  521. if (hashtable.ContainsKey("CardSources"))
  522. {
  523. if (hashtable["CardSources"] is List<CardSource>)
  524. {
  525. List<CardSource> CardSources = (List<CardSource>)hashtable["CardSources"];
  526. if (CardSources != null)
  527. {
  528. return CardSources;
  529. }
  530. }
  531. }
  532. }
  533. return null;
  534. }
  535. #endregion
  536. #region Get DigivolutionSources from hashtable
  537. public static List<CardSource> GetDigivolutionSourcesFromHashtable(Hashtable hashtable)
  538. {
  539. if (hashtable != null)
  540. {
  541. if (hashtable.ContainsKey("DigivolutionSources"))
  542. {
  543. if (hashtable["DigivolutionSources"] is List<CardSource>)
  544. {
  545. List<CardSource> CardSources = (List<CardSource>)hashtable["DigivolutionSources"];
  546. if (CardSources != null)
  547. {
  548. return CardSources;
  549. }
  550. }
  551. }
  552. }
  553. return null;
  554. }
  555. #endregion
  556. #region Get DeckBottom Cards from hashtable
  557. public static List<CardSource> GetDeckBottomCardsFromHashtable(Hashtable hashtable)
  558. {
  559. if (hashtable != null)
  560. {
  561. if (hashtable.ContainsKey("DeckBottomCards"))
  562. {
  563. if (hashtable["DeckBottomCards"] is List<CardSource>)
  564. {
  565. List<CardSource> DeckBottomCards = (List<CardSource>)hashtable["DeckBottomCards"];
  566. if (DeckBottomCards != null)
  567. {
  568. return DeckBottomCards;
  569. }
  570. }
  571. }
  572. }
  573. return null;
  574. }
  575. #endregion
  576. #region Get Digivolution roots from hashtable
  577. public static List<CardSource> GetDigivolutionRootsFromEnterFieldHashtable(Hashtable hashtable, Func<Permanent, bool> permanentCondition)
  578. {
  579. List<Hashtable> hashtables = GetHashtablesFromHashtable(hashtable);
  580. if (hashtables != null)
  581. {
  582. foreach (Hashtable hashtable1 in hashtables)
  583. {
  584. Permanent permanent1 = GetPermanentFromHashtable(hashtable1);
  585. if (permanent1 != null)
  586. {
  587. if (permanentCondition == null || permanentCondition(permanent1))
  588. {
  589. if (hashtable1 != null)
  590. {
  591. if (hashtable1.ContainsKey("evoRoots"))
  592. {
  593. if (hashtable1["evoRoots"] is List<CardSource>)
  594. {
  595. List<CardSource> evoRoots = (List<CardSource>)hashtable1["evoRoots"];
  596. if (evoRoots != null)
  597. {
  598. return evoRoots;
  599. }
  600. }
  601. }
  602. }
  603. }
  604. }
  605. }
  606. }
  607. return null;
  608. }
  609. #endregion
  610. #region Get Permanent from hashtable
  611. public static Permanent GetPermanentFromHashtable(Hashtable hashtable)
  612. {
  613. if (hashtable.ContainsKey("Permanent"))
  614. {
  615. if (hashtable["Permanent"] is Permanent)
  616. {
  617. Permanent Permanent = (Permanent)hashtable["Permanent"];
  618. if (Permanent != null)
  619. {
  620. return Permanent;
  621. }
  622. }
  623. }
  624. return null;
  625. }
  626. #endregion
  627. #region Get whether to digivolve from the same level from hashtable
  628. public static bool IsDigivolvedFromSameLevelFromEnterFieldHashtable(Hashtable hashtable, Permanent permanent)
  629. {
  630. if (IsPermanentExistsOnBattleArea(permanent))
  631. {
  632. if (permanent.TopCard.HasLevel)
  633. {
  634. List<Hashtable> hashtables = GetHashtablesFromHashtable(hashtable);
  635. if (hashtables != null)
  636. {
  637. foreach (Hashtable hashtable1 in hashtables)
  638. {
  639. Permanent permanent1 = GetPermanentFromHashtable(hashtable1);
  640. if (permanent1 == permanent)
  641. {
  642. if (hashtable1 != null)
  643. {
  644. if (hashtable1.ContainsKey("oldLevels"))
  645. {
  646. if (hashtable1["oldLevels"] is List<int>)
  647. {
  648. List<int> oldLevels = (List<int>)hashtable1["oldLevels"];
  649. if (oldLevels != null)
  650. {
  651. if (oldLevels.Count((oldLevel) => oldLevel == permanent.Level) >= 1)
  652. {
  653. return true;
  654. }
  655. }
  656. }
  657. }
  658. }
  659. }
  660. }
  661. }
  662. }
  663. }
  664. return false;
  665. }
  666. #endregion
  667. #region Get IsAlliance from 1 hashtable
  668. public static bool IsAlliance(Hashtable hashtable)
  669. {
  670. ICardEffect CardEffect = GetCardEffectFromHashtable(hashtable);
  671. if (CardEffect != null)
  672. {
  673. if (CardEffect.EffectName == "Alliance")
  674. {
  675. return true;
  676. }
  677. }
  678. return false;
  679. }
  680. #endregion
  681. #region Get isJogress from hashtable
  682. public static bool IsJogress(Hashtable hashtable)
  683. {
  684. if (hashtable != null)
  685. {
  686. if (hashtable.ContainsKey("isJogress"))
  687. {
  688. if (hashtable["isJogress"] is bool)
  689. {
  690. return (bool)hashtable["isJogress"];
  691. }
  692. }
  693. }
  694. return false;
  695. }
  696. #endregion
  697. #region If leaving for Digixros
  698. public static bool IsLeavingForDigiXros(Hashtable hashtable)
  699. {
  700. if (hashtable != null)
  701. {
  702. if (hashtable.ContainsKey("digixros"))
  703. {
  704. if (hashtable["digixros"] is bool)
  705. {
  706. return (bool)hashtable["digixros"]; ;
  707. }
  708. }
  709. }
  710. return false;
  711. }
  712. #endregion
  713. #region Get IsDijiXros from hashtable
  714. public static bool IsDijiXros(Hashtable hashtable, CardSource card, Func<int, bool> digixrosCountCondition)
  715. {
  716. List<Hashtable> hashtables = GetHashtablesFromHashtable(hashtable);
  717. if (hashtables != null)
  718. {
  719. foreach (Hashtable hashtable1 in hashtables)
  720. {
  721. Permanent permanent = GetPermanentFromHashtable(hashtable1);
  722. if (permanent != null && permanent.cardSources.Contains(card))
  723. {
  724. int digiXrosCount = GetDigiXrosCount(hashtable1);
  725. if (digixrosCountCondition != null)
  726. {
  727. return digixrosCountCondition(digiXrosCount);
  728. }
  729. }
  730. }
  731. }
  732. return false;
  733. }
  734. #endregion
  735. #region Get DigiXrosCount from hashtable
  736. public static int GetDigiXrosCount(Hashtable hashtable)
  737. {
  738. if (hashtable != null)
  739. {
  740. if (hashtable.ContainsKey("DigiXrosCount"))
  741. {
  742. if (hashtable["DigiXrosCount"] is int)
  743. {
  744. return (int)hashtable["DigiXrosCount"]; ;
  745. }
  746. }
  747. }
  748. return 0;
  749. }
  750. #endregion
  751. }