BrawlCrate v0.41
Wii File Editor
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Properties | List of all members
BrawlLib.SSBB.ResourceNodes.hkClassNode Class Reference
Inheritance diagram for BrawlLib.SSBB.ResourceNodes.hkClassNode:
BrawlLib.SSBB.ResourceNodes.HavokClassNode BrawlLib.SSBB.ResourceNodes.HavokEntryNode BrawlLib.SSBB.ResourceNodes.ResourceNode

Public Member Functions

override bool OnInitialize ()
 
void GetInheritance ()
 
override void OnPopulate ()
 
override int OnCalculateSize (bool force)
 
override void OnRebuild (VoidPtr address, int length, bool force)
 
override void WriteParams (System.Xml.XmlWriter writer, Dictionary< HavokClassNode, int > classNodes)
 
virtual void WriteParams (System.Xml.XmlWriter writer, Dictionary< HavokClassNode, int > classNodes)
 
- Public Member Functions inherited from BrawlLib.SSBB.ResourceNodes.ResourceNode
void OnRenamed ()
 
List< ResourceNodeGetChildrenRecursive ()
 Used primarily to get bone lists. Kept for all resource nodes for utility. More...
 
virtual void SignalPropertyChange ()
 
virtual void Dispose ()
 
void SelectChildAtIndex (int index)
 
void UpdateProperties ()
 
void UpdateCurrentControl ()
 
virtual bool MoveUp ()
 
virtual bool MoveDown ()
 
virtual void OnMoved ()
 
virtual void DoMoveDown ()
 
virtual void DoMoveDown (bool select)
 
virtual void DoMoveUp ()
 
virtual void DoMoveUp (bool select)
 
virtual bool AddUp ()
 
virtual bool AddDown ()
 
virtual bool ToParent ()
 
void Populate (int levels=-1)
 
virtual void OnPopulate ()
 
void Initialize (ResourceNode parent, FileMap source)
 
void Initialize (ResourceNode parent, VoidPtr address, int length)
 
void Initialize (ResourceNode parent, DataSource origSource)
 
virtual void Initialize (ResourceNode parent, DataSource origSource, DataSource uncompSource)
 
virtual bool OnInitialize ()
 
virtual void Restore ()
 
virtual void Remove ()
 
virtual void RemoveChild (ResourceNode child)
 
virtual void AddChild (ResourceNode child)
 
virtual void AddChild (ResourceNode child, bool change)
 
virtual void InsertChild (ResourceNode child, int index)
 
virtual void InsertChild (ResourceNode child, bool change, int index)
 
void SetSizeInternal (int size)
 
virtual void Replace (string fileName)
 
virtual void Replace (ResourceNode node)
 
virtual void Replace (string fileName, FileMapProtect prot, FileOptions options)
 
virtual void ReplaceRaw (VoidPtr address, int length)
 
virtual void ReplaceRaw (FileMap map)
 
virtual void Export (string outPath)
 
void Export (FileStream outStream)
 
virtual void ExportUncompressed (string outPath)
 
void ExportUncompressed (FileStream outStream)
 
virtual void Rebuild ()
 
virtual void Rebuild (bool force)
 
virtual void Rebuild (VoidPtr address, int length, bool force)
 
virtual void OnRebuild (VoidPtr address, int length, bool force)
 
virtual int CalculateSize (bool force)
 
virtual int OnCalculateSize (bool force)
 
void Merge ()
 
void Merge (bool forceBuild)
 
ResourceNode FindChildByType (string path, bool searchChildren, params ResourceType[] types)
 
ResourceNode FindChildByType (string path, bool searchChildren, StringComparison compare, params ResourceType[] types)
 
ResourceNode FindChild (string path)
 
ResourceNode FindChild (string path, bool searchChildren)
 
ResourceNode FindChild (string path, StringComparison compare)
 
ResourceNode FindChild (string path, bool searchChildren, StringComparison compare)
 
ResourceNode[] FindChildrenByClassType (string path, Type type)
 
ResourceNode[] FindChildrenByType (string path, ResourceType type)
 
ResourceNode[] FindChildrenByTypeInGroup (string path, ResourceType type, byte group)
 
ResourceNode[] FindChildrenByName (string name)
 
unsafe string FindName (string name)
 
ResourceNode FindEmbeddedIndex (int index)
 
virtual unsafe byte[] MD5 ()
 Find the MD5 checksum of this node's data. If this node doesn't have any data (BRESGroupNode, for example), this method will return null. More...
 
string MD5Str ()
 Get the result of the MD5() function as a string of hexadecimal digits. If MD5() returns null, this method will return an empty string. More...
 
ResourceNode PrevSibling ()
 
ResourceNode NextSibling ()
 
override string ToString ()
 
virtual void SortChildren ()
 

Public Attributes

List< hkClassNode_inheritance
 
- Public Attributes inherited from BrawlLib.SSBB.ResourceNodes.HavokClassNode
string _className
 
uint _signature
 
- Public Attributes inherited from BrawlLib.SSBB.ResourceNodes.ResourceNode
Form _mainForm
 
string _name
 
string _origPath
 
ResourceNode _parent
 
List< ResourceNode_children = new List<ResourceNode>()
 
int _calcSize
 
EventHandler UpdateControl
 
MoveEventHandler MovedDown
 
ResourceEventHandler Renamed
 
ResourceEventHandler PropertyChanged
 
ResourceEventHandler Replaced
 
ResourceEventHandler Restored
 
ResourceChildEventHandler ChildRemoved
 
bool _isPopulating
 
bool _replaced
 

Properties

string Inheritance [get]
 
string ParentClass [get]
 
int InterfaceCount [get]
 
int EnumCount [get]
 
int MemberCount [get]
 
int Version [get]
 
int Size [get]
 
int Flags [get]
 
int DefaultsPtr [get]
 
- Properties inherited from BrawlLib.SSBB.ResourceNodes.HavokClassNode
string ClassName [get]
 
- Properties inherited from BrawlLib.SSBB.ResourceNodes.HavokEntryNode
override ResourceType ResourceFileType [get]
 
HavokNode HavokNode [get]
 
int DataOffset [get]
 
string Offset [get]
 
string DataSize [get]
 
- Properties inherited from BrawlLib.SSBB.ResourceNodes.ResourceNode
string FilePath [get]
 
string FileName [get]
 
string DirectoryName [get]
 
ResourceNode RootNode [get]
 
DataSource OriginalSource [get]
 
DataSource UncompressedSource [get]
 
DataSource WorkingSource [get]
 
DataSource WorkingUncompressed [get]
 
virtual bool HasChildren [get]
 
virtual ResourceType ResourceFileType [get]
 
string NodeType [get]
 
virtual string TreePathAbsolute [get]
 
virtual string TreePath [get]
 
virtual int Level [get]
 
virtual int MaxNameLength [get]
 
virtual bool AllowDuplicateNames [get]
 
virtual bool AllowNullNames [get]
 
virtual string Name [get, set]
 
ResourceNode Parent [get, set]
 
List< ResourceNodeChildren [get]
 
int Index [get]
 
int HexIndex [get]
 
bool IsCompressed [get]
 
bool HasChanged [get, set]
 
bool IsBranch [get]
 
bool HasMerged [get]
 
virtual bool AllowSaving [get, set]
 
virtual bool IsDirty [get, set]
 
virtual uint UncompressedSize [get]
 
virtual Type[] AllowedChildTypes [get]
 
virtual string Compression [get, set]
 
virtual bool RetainChildrenOnReplace [get]
 
virtual bool supportsCompression [get]
 
static MD5CryptoServiceProvider MD5Provider [get]
 

Additional Inherited Members

- Static Public Member Functions inherited from BrawlLib.SSBB.ResourceNodes.ResourceNode
static ResourceNode[] FindAllSubNodes (ResourceNode root)
 
static ResourceNode FindNode (ResourceNode root, string path, bool searchChildren, StringComparison compare)
 
- Protected Member Functions inherited from BrawlLib.SSBB.ResourceNodes.ResourceNode
void ForceReplacedEvent ()
 
virtual void MergeInternal ()
 
- Events inherited from BrawlLib.SSBB.ResourceNodes.ResourceNode
SelectEventHandler SelectChild
 
EventHandler UpdateProps
 
MoveEventHandler MovedUp
 
ResourceEventHandler Disposing
 
ResourceChildEventHandler ChildAdded
 
ResourceChildInsertEventHandler ChildInserted
 

Member Function Documentation

◆ GetInheritance()

void BrawlLib.SSBB.ResourceNodes.hkClassNode.GetInheritance ( )
inline
94 {
95 _inheritance = new List<hkClassNode>();
96 ResourceNode current = this;
97
98 //First, get classes inheriting this one
99 TOP:
100 bool found = false;
101 if (current != null)
102 {
103 foreach (HavokSectionNode section in HavokNode.Children)
104 {
105 if (section._classCache != null && section != HavokNode._dataSection)
106 {
107 foreach (HavokClassNode c in section._classCache)
108 {
109 hkClassNode x = c as hkClassNode;
110 if (x != null && x != this && x.ParentClass == current.Name)
111 {
112 current = x;
113 _inheritance.Insert(0, x);
114 found = true;
115 break;
116 }
117 }
118 }
119
120 if (found)
121 {
122 break;
123 }
124 }
125 }
126
127 if (found)
128 {
129 goto TOP;
130 }
131
132 current = this;
133
134 //Now add this class and the classes it inherits
135 while (current is hkClassNode)
136 {
137 hkClassNode cNode = (hkClassNode) current;
138
139 _inheritance.Add(cNode);
140
142 {
143 current = current.Parent;
144 }
145
146 //else if (!string.IsNullOrEmpty(cNode.ParentClass))
147 //{
148 // current = null;
149 // HavokClassNode parent = HavokNode.GetClassNode(cNode.ParentClass);
150 // if (parent is hkClassNode)
151 // {
152 // current = parent;
153 // }
154 //}
155 }
156
157 //Start with the eldest class, added last
158 _inheritance.Reverse();
159 }
HavokNode HavokNode
Definition: HavokNode.cs:436
HavokSectionNode _dataSection
Definition: HavokNode.cs:43
const bool AssignClassParents
Definition: HavokNode.cs:14
List< ResourceNode > Children
Definition: ResourceNode.cs:262
List< hkClassNode > _inheritance
Definition: hkClassNode.cs:15

◆ OnCalculateSize()

override int BrawlLib.SSBB.ResourceNodes.hkClassNode.OnCalculateSize ( bool  force)
inlinevirtual

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

202 {
203 return 0;
204 }

◆ OnInitialize()

override bool BrawlLib.SSBB.ResourceNodes.hkClassNode.OnInitialize ( )
inlinevirtual

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

34 {
35 if (Header->_namePtr > 0)
36 {
37 _name = new string((sbyte*) Header->_namePtr.OffsetAddress);
38 }
39
40 _interfaceCount = Header->_interfaceCount;
41 _enumCount = Header->_enumCount;
42 _memberCount = Header->_propertyCount;
43 _version = Header->_version;
44 _size = Header->_size;
45 _flags = Header->_flags;
46 _defaultsPtr = Header->_defaultsPtr;
47
48 if (Header->_parentPtr != 0)
49 {
50 hkClass* parent = (hkClass*) Header->_parentPtr.OffsetAddress;
51 _parentName = new string((sbyte*) parent->_namePtr.OffsetAddress);
52 }
53
54 int attribCount = 0;
55 if (Header->_attribPtr != 0)
56 {
58 attribCount = attribHeader->_count;
59 }
60
61 if (Header->_defaultsPtr != 0)
62 {
63 Console.WriteLine(Name + " has defaults");
64 }
65
67
68 return Header->_propertyCount > 0 || Header->_enumCount > 0 || attribCount > 0;
69 }
void SetSizeInternal(int size)
Definition: ResourceNode.cs:799
string _name
Definition: ResourceNode.cs:139
virtual string Name
Definition: ResourceNode.cs:223
VoidPtr OffsetAddress
Definition: BigEndianTypes.cs:44
Definition: HKX.cs:205
bint _propertyCount
Definition: HKX.cs:213
bint _enumCount
Definition: HKX.cs:211
bint _version
Definition: HKX.cs:217
bint _size
Definition: HKX.cs:208
bint _defaultsPtr
Definition: HKX.cs:214
bint _flags
Definition: HKX.cs:216
bint _namePtr
Definition: HKX.cs:206
bint _interfaceCount
Definition: HKX.cs:209
bint _parentPtr
Definition: HKX.cs:207
bint _attribPtr
Definition: HKX.cs:215
bint _count
Definition: HKX.cs:235

◆ OnPopulate()

override void BrawlLib.SSBB.ResourceNodes.hkClassNode.OnPopulate ( )
inlinevirtual

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

162 {
163 if (Header->_propertyPtr != 0 && Header->_propertyCount > 0)
164 {
165 HavokGroupNode memberGroup = new HavokGroupNode {_name = "Members"};
166 memberGroup.Parent = this;
168 for (int i = 0; i < Header->_propertyCount; i++, member++)
169 {
170 new hkClassMemberNode().Initialize(memberGroup, member, 20);
171 }
172 }
173
174 if (Header->_enumPtr != 0 && Header->_enumCount > 0)
175 {
176 HavokGroupNode enumGroup = new HavokGroupNode {_name = "Enums"};
177 enumGroup.Parent = this;
179 for (int i = 0; i < Header->_enumCount; i++, Enum++)
180 {
181 new hkClassEnumNode().Initialize(enumGroup, Enum, 16);
182 }
183 }
184
185 if (Header->_attribPtr != 0)
186 {
188 if (attribHeader->_count > 0)
189 {
190 HavokGroupNode attribGroup = new HavokGroupNode {_name = "Attributes"};
191 attribGroup.Parent = this;
192 HavokAttribute* attrib = (HavokAttribute*) attribHeader->_attribPtr.OffsetAddress;
193 for (int i = 0; i < attribHeader->_count; i++, attrib++)
194 {
195 new HavokAttributeNode().Initialize(attribGroup, attrib, 12);
196 }
197 }
198 }
199 }
Definition: HKX.cs:343
bint _propertyPtr
Definition: HKX.cs:212
bint _enumPtr
Definition: HKX.cs:210
Definition: HKX.cs:380
bint _attribPtr
Definition: HKX.cs:234

◆ OnRebuild()

override void BrawlLib.SSBB.ResourceNodes.hkClassNode.OnRebuild ( VoidPtr  address,
int  length,
bool  force 
)
inlinevirtual

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

207 {
208 base.OnRebuild(address, length, force);
209 }

◆ WriteParams()

override void BrawlLib.SSBB.ResourceNodes.hkClassNode.WriteParams ( System.Xml.XmlWriter  writer,
Dictionary< HavokClassNode, int >  classNodes 
)
inlinevirtual

Reimplemented from BrawlLib.SSBB.ResourceNodes.HavokClassNode.

212 {
213 writer.WriteStartElement("hkparam");
214 writer.WriteAttributeString("name", "name");
215 writer.WriteString(Name);
216 writer.WriteEndElement();
217
218 writer.WriteStartElement("hkparam");
219 writer.WriteAttributeString("name", "parent");
220 writer.WriteString(_parent is HavokClassNode
221 ? HavokXML.GetObjectName(classNodes, _parent as HavokClassNode)
222 : "null");
223 writer.WriteEndElement();
224
225 writer.WriteStartElement("hkparam");
226 writer.WriteAttributeString("name", "objectSize");
227 writer.WriteString(Size.ToString(CultureInfo.InvariantCulture));
228 writer.WriteEndElement();
229
230 writer.WriteStartElement("hkparam");
231 writer.WriteAttributeString("name", "numImplementedInterfaces");
232 writer.WriteString(InterfaceCount.ToString(CultureInfo.InvariantCulture));
233 writer.WriteEndElement();
234
235 ResourceNode enums = FindChild("Enums", false);
236 writer.WriteStartElement("hkparam");
237 writer.WriteAttributeString("name", "declaredEnums");
238 writer.WriteAttributeString("numelements", enums == null ? "0" : enums.Children.Count.ToString());
239 {
240 if (enums != null)
241 {
242 foreach (hkClassEnumNode e in enums.Children)
243 {
244 e.WriteParams(writer, classNodes);
245 }
246 }
247 }
248 writer.WriteEndElement();
249
250 ResourceNode members = FindChild("Members", false);
251 writer.WriteStartElement("hkparam");
252 writer.WriteAttributeString("name", "declaredMembers");
253 writer.WriteAttributeString("numelements", members == null ? "0" : members.Children.Count.ToString());
254 {
255 if (members != null)
256 {
257 foreach (hkClassMemberNode e in members.Children)
258 {
259 e.WriteParams(writer, classNodes);
260 }
261 }
262 }
263 writer.WriteEndElement();
264
265 writer.WriteComment(" defaults SERIALIZE_IGNORED ");
266 writer.WriteComment(" attributes SERIALIZE_IGNORED ");
267
268 writer.WriteStartElement("hkparam");
269 writer.WriteAttributeString("name", "flags");
270 writer.WriteString(Flags.ToString(CultureInfo.InvariantCulture));
271 writer.WriteEndElement();
272
273 writer.WriteStartElement("hkparam");
274 writer.WriteAttributeString("name", "describedVersion");
275 writer.WriteString(Version.ToString(CultureInfo.InvariantCulture));
276 writer.WriteEndElement();
277 }
ResourceNode _parent
Definition: ResourceNode.cs:142
ResourceNode FindChild(string path)
Definition: ResourceNode.cs:1342
int Size
Definition: hkClassNode.cs:29
int Version
Definition: hkClassNode.cs:28
int InterfaceCount
Definition: hkClassNode.cs:25
int Flags
Definition: hkClassNode.cs:30

Member Data Documentation

◆ _inheritance

List<hkClassNode> BrawlLib.SSBB.ResourceNodes.hkClassNode._inheritance

Property Documentation

◆ DefaultsPtr

int BrawlLib.SSBB.ResourceNodes.hkClassNode.DefaultsPtr
get

◆ EnumCount

int BrawlLib.SSBB.ResourceNodes.hkClassNode.EnumCount
get

◆ Flags

int BrawlLib.SSBB.ResourceNodes.hkClassNode.Flags
get

◆ Inheritance

string BrawlLib.SSBB.ResourceNodes.hkClassNode.Inheritance
get

◆ InterfaceCount

int BrawlLib.SSBB.ResourceNodes.hkClassNode.InterfaceCount
get

◆ MemberCount

int BrawlLib.SSBB.ResourceNodes.hkClassNode.MemberCount
get

◆ ParentClass

string BrawlLib.SSBB.ResourceNodes.hkClassNode.ParentClass
get

◆ Size

int BrawlLib.SSBB.ResourceNodes.hkClassNode.Size
get

◆ Version

int BrawlLib.SSBB.ResourceNodes.hkClassNode.Version
get

The documentation for this class was generated from the following file: