Advertisement
tankcr

Untitled

Jun 14th, 2014
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.44 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Net;
  7. using System.IO;
  8. using System.Diagnostics;
  9.  
  10. namespace ROD_Deck_Builder
  11. {
  12. public class Cards
  13. {
  14. public List<Card> tableData;
  15.  
  16. public List<Card> TableData
  17. {
  18. get { return tableData; }
  19. set { tableData = value; }
  20. }
  21.  
  22. public Cards()
  23. {
  24.  
  25. }
  26. }
  27. public class GetTable
  28. {
  29. public static Cards GetTableData(string tablepath)
  30. {
  31. Cards table = new Cards();
  32. using (StreamReader streamReader = new StreamReader(tablepath))
  33. //("Http://");
  34. {
  35. string singleLine;
  36. while ((singleLine = streamReader.ReadLine()) != null)
  37. {
  38. string[] splitApart = singleLine.Split(',');
  39. if (splitApart[0] != "RY ")
  40. {
  41. Card item = new Card();
  42. splitApart[0] = splitApart[0].Replace("?","");
  43. item.Rarity = Convert.ToInt32(splitApart[0]);
  44. item.Name = splitApart[1];
  45. item.Realm = splitApart[2];
  46. item.Faction = splitApart[3];
  47. item.MaxAtk = splitApart[4];
  48. item.MaxDef = splitApart[5];
  49. item.Total = Convert.ToInt32(splitApart[6]);
  50. item.Cost = Convert.ToInt32(splitApart[7]);
  51. item.AttEff = Convert.ToInt32(splitApart[8]);
  52. item.DefEff = Convert.ToInt32(splitApart[9]);
  53. item.OverallEff = Convert.ToInt32(splitApart[10]);
  54. item.Skill = splitApart[11];
  55. item.EventSkl1 = splitApart[12];
  56. item.EventSkl2 = splitApart[13];
  57. table.TableData.Add(item);
  58. }
  59.  
  60. }
  61.  
  62. }
  63. var reader = new StreamReader(File.OpenRead(@tablepath));
  64. while (!reader.EndOfStream)
  65. {
  66. var line = reader.ReadLine();
  67. var values = line.Split(';');
  68.  
  69. }
  70.  
  71. return table;
  72. }
  73.  
  74. }
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement