PBXBuildPhase.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. using UnityEngine;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. namespace cn.sharesdk.unity3d.sdkporter
  5. {
  6. public class PBXBuildPhase : PBXObject
  7. {
  8. protected const string FILES_KEY = "files";
  9. public PBXBuildPhase() :base()
  10. {
  11. // Debug.Log( "base" );
  12. }
  13. public PBXBuildPhase( string guid, PBXDictionary dictionary ) : base ( guid, dictionary )
  14. {
  15. // Debug.Log( "constructor " + GetType().Name );
  16. }
  17. public bool AddBuildFile( PBXBuildFile file )
  18. {
  19. // if( ((string)file[ ISA_KEY ]).CompareTo( "PBXBuildFile" ) != 0 )
  20. // return false;
  21. // Debug.Log( "--> buildphase " + (string)_data[ ISA_KEY ] );
  22. if( !ContainsKey( FILES_KEY ) ){
  23. // Debug.Log( "key not present" );
  24. this.Add( FILES_KEY, new PBXList() );
  25. }
  26. // Debug.Log( "key: " + _data[ FILES_KEY ] );
  27. // Debug.Log( "Adding: " + file.guid );
  28. ((PBXList)_data[ FILES_KEY ]).Add( file.guid );
  29. // if( ((PBXList)_data[ FILES_KEY ]).Contains( file.guid ) ) {
  30. // Debug.Log( "AGGIUNTO" );
  31. // }
  32. // else {
  33. // Debug.Log( "MANCA" );
  34. // }
  35. return true;
  36. }
  37. public void RemoveBuildFile( string id )
  38. {
  39. if( !ContainsKey( FILES_KEY ) ) {
  40. this.Add( FILES_KEY, new PBXList() );
  41. return;
  42. }
  43. ((PBXList)_data[ FILES_KEY ]).Remove( id );
  44. }
  45. public bool HasBuildFile( string id )
  46. {
  47. if( !ContainsKey( FILES_KEY ) ) {
  48. this.Add( FILES_KEY, new PBXList() );
  49. return false;
  50. }
  51. if( !IsGuid( id ) )
  52. return false;
  53. return ((PBXList)_data[ FILES_KEY ]).Contains( id );
  54. }
  55. // class PBXBuildPhase(PBXObject):
  56. // def add_build_file(self, bf):
  57. // if bf.get('isa') != 'PBXBuildFile':
  58. // return False
  59. //
  60. // if not self.has_key('files'):
  61. // self['files'] = PBXList()
  62. //
  63. // self['files'].add(bf.id)
  64. //
  65. // return True
  66. //
  67. // def remove_build_file(self, id):
  68. // if not self.has_key('files'):
  69. // self['files'] = PBXList()
  70. // return
  71. //
  72. // self['files'].remove(id)
  73. //
  74. // def has_build_file(self, id):
  75. // if not self.has_key('files'):
  76. // self['files'] = PBXList()
  77. // return False
  78. //
  79. // if not PBXObject.IsGuid(id):
  80. // id = id.id
  81. //
  82. // return id in self['files']
  83. }
  84. public class PBXFrameworksBuildPhase : PBXBuildPhase
  85. {
  86. public PBXFrameworksBuildPhase( string guid, PBXDictionary dictionary ) : base ( guid, dictionary )
  87. {
  88. // Debug.Log( "constructor child" + GetType().Name );
  89. }
  90. }
  91. public class PBXResourcesBuildPhase : PBXBuildPhase
  92. {
  93. public PBXResourcesBuildPhase( string guid, PBXDictionary dictionary ) : base ( guid, dictionary )
  94. {
  95. // Debug.Log( "constructor child" + GetType().Name );
  96. }
  97. }
  98. public class PBXShellScriptBuildPhase : PBXBuildPhase
  99. {
  100. public PBXShellScriptBuildPhase( string guid, PBXDictionary dictionary ) : base ( guid, dictionary )
  101. {
  102. // Debug.Log( "constructor child" + GetType().Name );
  103. }
  104. }
  105. public class PBXSourcesBuildPhase : PBXBuildPhase
  106. {
  107. public PBXSourcesBuildPhase( string guid, PBXDictionary dictionary ) : base ( guid, dictionary )
  108. {
  109. // Debug.Log( "constructor child" + GetType().Name );
  110. }
  111. }
  112. public class PBXCopyFilesBuildPhase : PBXBuildPhase
  113. {
  114. public PBXCopyFilesBuildPhase( string guid, PBXDictionary dictionary ) : base ( guid, dictionary )
  115. {
  116. // Debug.Log( "constructor child" + GetType().Name );
  117. }
  118. }
  119. }