Guest User

Untitled

a guest
Jul 16th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. using System;
  2. using System.Text;
  3.  
  4. namespace Gemini.Datasets
  5. {
  6. public class SceneObjInfo114 : BinaryMap
  7. {
  8. public static readonly int BlockSize = 0x114;
  9.  
  10. #region Game properties
  11. //1 +
  12. [Field(0x04)]
  13. public int ID = 0;
  14.  
  15. //2 +
  16. [Field(0x08, 0x48)]
  17. public string Name1 = "0";
  18.  
  19. //3 +
  20. [Field(0x6C, 0x2C)]
  21. public string Name2 = "0";
  22.  
  23. //4
  24. [Field(0x93)]
  25. public byte Unknown1 = 0;
  26.  
  27. //5 - is it string or float-array??
  28. [Field(0xB0, 0x0C)]
  29. public string Unknown2 = "0";
  30.  
  31. //6 +
  32. [Field(0xBC)]
  33. public int Unknown3 = 0;
  34. //7
  35.  
  36. //8
  37.  
  38. //9
  39.  
  40. //10 +
  41. [Field(0x98)]
  42. public int Unknown4 = 0;
  43. //11
  44.  
  45. //12
  46.  
  47. //13
  48. #endregion
  49.  
  50. public SceneObjInfo114()
  51. {
  52. RawData = new byte[BlockSize];
  53. }
  54.  
  55. public bool checkThirdField(string s)
  56. {
  57. for (int i=0;i<s.length();i++)
  58. {
  59. if (Convert.ToByte(s[i]) == '205')
  60. return false;
  61. }
  62. return true;
  63. }
  64.  
  65. public override void Compile()
  66. {
  67. base.Compile();
  68.  
  69. Buffer.BlockCopy(BitConverter.GetBytes(1.0f), 0, RawData, 0x84, 4);
  70. Buffer.BlockCopy(BitConverter.GetBytes(1.0f), 0, RawData, 0x88, 4);
  71. Buffer.BlockCopy(BitConverter.GetBytes(-1.0f), 0, RawData, 0x8C, 4);
  72. Buffer.BlockCopy(new byte[] { 0xFF, 0xFF, 0xFF }, 0, RawData, 0x90, 3);
  73. }
  74.  
  75. public override string ToString()
  76. {
  77. StringBuilder stringBuilder = new StringBuilder();
  78.  
  79. // Ugly but working (and simple) string building
  80. if (checkThirdField(Unknown2.ToString()))
  81. {
  82. stringBuilder.Append("+++");
  83. }
  84. else
  85. {
  86. stringBuilder.Append("---");
  87. }
  88. return stringBuilder.ToString();
  89. }
  90. }
  91. }
Add Comment
Please, Sign In to add comment