VeEnvironmentNode.cs 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #region License information
  2. // ----------------------------------------------------------------------------
  3. //
  4. // libeq2 - A library for analyzing the Everquest II File Format
  5. // Blaz (blaz@blazlabs.com)
  6. //
  7. // This program is free software; you can redistribute it and/or
  8. // modify it under the terms of the GNU General Public License
  9. // as published by the Free Software Foundation; either version 2
  10. // of the License, or (at your option) any later version.
  11. //
  12. // This program is distributed in the hope that it will be useful,
  13. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. // GNU General Public License for more details.
  16. //
  17. // You should have received a copy of the GNU General Public License
  18. // along with this program; if not, write to the Free Software
  19. // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  20. //
  21. // ( The full text of the license can be found in the License.txt file )
  22. //
  23. // ----------------------------------------------------------------------------
  24. #endregion
  25. #region Using directives
  26. using System;
  27. using System.IO;
  28. using Everquest2.Util;
  29. #endregion
  30. namespace Everquest2.Visualization
  31. {
  32. public class VeEnvironmentNode : VeNode
  33. {
  34. public VeEnvironmentNode()
  35. {
  36. }
  37. /// <summary>
  38. /// Special constructor used when deserializing the instance of the class.
  39. /// </summary>
  40. /// <param name="reader">Reader used to read the instance data.</param>
  41. protected VeEnvironmentNode(Util.Eq2Reader reader, Util.StreamingContext context)
  42. : base(reader, context)
  43. {
  44. byte classVersion = context.ClassVersions[typeof(VeEnvironmentNode)];
  45. bool hasRegionDefinition = reader.ReadBoolean();
  46. if (hasRegionDefinition) regionDefinitionFile = reader.ReadString(2);
  47. byte environmentDefinitionCount = reader.ReadByte();
  48. if (environmentDefinitionCount > 0)
  49. {
  50. environmentDefinitions = new string[environmentDefinitionCount];
  51. for (byte i = 0; i < environmentDefinitionCount; ++i)
  52. {
  53. environmentDefinitions[i] = reader.ReadString(2);
  54. }
  55. }
  56. if (classVersion >= 2)
  57. {
  58. //4 bytes, not sure if its a float
  59. float unk1 = reader.ReadSingle();
  60. }
  61. if (classVersion >= 3)
  62. {
  63. byte unk2 = reader.ReadByte();
  64. }
  65. }
  66. public string regionDefinitionFile;
  67. public string[] environmentDefinitions;
  68. }
  69. }