DataTableProcessor.Int16Processor.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //------------------------------------------------------------
  2. // Game Framework
  3. // Copyright © 2013-2021 Jiang Yin. All rights reserved.
  4. // Homepage: https://gameframework.cn/
  5. // Feedback: mailto:ellan@gameframework.cn
  6. //------------------------------------------------------------
  7. using System.IO;
  8. namespace MetaClient.Editor.DataTableTools
  9. {
  10. public sealed partial class DataTableProcessor
  11. {
  12. private sealed class Int16Processor : GenericDataProcessor<short>
  13. {
  14. public override bool IsSystem
  15. {
  16. get
  17. {
  18. return true;
  19. }
  20. }
  21. public override string LanguageKeyword
  22. {
  23. get
  24. {
  25. return "short";
  26. }
  27. }
  28. public override string[] GetTypeStrings()
  29. {
  30. return new string[]
  31. {
  32. "short",
  33. "int16",
  34. "system.int16"
  35. };
  36. }
  37. public override short Parse(string value)
  38. {
  39. return short.Parse(value);
  40. }
  41. public override void WriteToStream(DataTableProcessor dataTableProcessor, BinaryWriter binaryWriter, string value)
  42. {
  43. binaryWriter.Write(Parse(value));
  44. }
  45. }
  46. }
  47. }