Changes

Jump to navigation Jump to search
1,255 bytes added ,  21:57, 27 June 2017
→‎Object system: class CMwNod: Completed the virtual member functions and added some important static member functions
Line 256: Line 256:  
     virtual CMwId* MwGetId();              // Returns meta information about the object, like name and author
 
     virtual CMwId* MwGetId();              // Returns meta information about the object, like name and author
 
     virtual void SetIdName(char* psz);      // Sets the name of the object (affects MwGetId())
 
     virtual void SetIdName(char* psz);      // Sets the name of the object (affects MwGetId())
     virtual void m1C();
+
     virtual void MwIsKilled(CMwNod*);
 
     virtual void MwIsUnreferenced(CMwNod*);
 
     virtual void MwIsUnreferenced(CMwNod*);
 
     virtual void VirtualParam_Get(CMwStack* pStack, CMwValueStd* ppValue); // Gets the value of a property
 
     virtual void VirtualParam_Get(CMwStack* pStack, CMwValueStd* ppValue); // Gets the value of a property
Line 264: Line 264:  
     virtual void Archive(CClassicArchive* pArchive);                      // (De)serializes the [[GBX#Reading_the_body|nod]] from a stream
 
     virtual void Archive(CClassicArchive* pArchive);                      // (De)serializes the [[GBX#Reading_the_body|nod]] from a stream
 
     virtual void Chunk(CClassicArchive* pArchive, int chunkID);            // (De)serializes a single chunk from a stream
 
     virtual void Chunk(CClassicArchive* pArchive, int chunkID);            // (De)serializes a single chunk from a stream
    virtual void m3C();
   
     virtual int GetChunkInfo(int chunkID);        // Gets chunk-specific flags, e.g. if it is skippable
 
     virtual int GetChunkInfo(int chunkID);        // Gets chunk-specific flags, e.g. if it is skippable
     virtual int GetUidMessageFromIndex(int index); // Used during serialization: which chunk to write next
+
     virtual int GetUidChunkFromIndex(int index);   // Used during serialization: which chunk to write next
     virtual int GetHeaderChunkCount();             // Used during serialization: how many chunks to write
+
     virtual int GetChunkCount();                   // Used during serialization: how many chunks to write
 
     virtual void OnNodLoaded();                    // Called after the last chunk has been read/written
 
     virtual void OnNodLoaded();                    // Called after the last chunk has been read/written
     virtual void m50();
+
     virtual void CreateDefaultData();
     virtual void m54();
+
     virtual void OnPackAvailable(CSystemFid*, CSystemFid*);
     virtual void m58();
+
     virtual void ApplyFidParameters(CSystemFidParameters*, CSystemFidParameters*, CFastBuffer<SManuallyLoadedFid>*);
 
     virtual void OnCrashDump(CFastString*);
 
     virtual void OnCrashDump(CFastString*);
     virtual void m60();
+
     virtual void CopyFrom(CMwNod*);
 
     virtual void HeaderChunk(CClassicArchive* pArchive, int* pHeaderChunkID, bool* pbLight); // Writes a header chunk to a stream
 
     virtual void HeaderChunk(CClassicArchive* pArchive, int* pHeaderChunkID, bool* pbLight); // Writes a header chunk to a stream
 +
    virtual int GetUidHeaderChunkFromIndex(int index); // Used during serialization: which header chunk to write next
 +
    virtual int GetHeaderChunkCount();                // Used during serialization: how many header chunks to write
 +
    virtual int GetUidMessageFromIndex(int index);
 +
    virtual int GetMessageCount();
 +
    virtual void MwReceiveMessage(int*, CMwNod*, int*);
 +
 +
    int Param_Get(CMwStack* pStack, CMwValueStd* ppValue);
 +
    int Param_Set(CMwStack* pStack, void* pValue);
 +
    int Param_Add(CMwStack* pStack, void* pValue);
 +
    int Param_Sub(CMwStack* pStack, void* pValue);
 +
    int Param_Check(CMwStack* pStack);
 +
    int Param_Set(CFastString*, CFastStringInt*);
 +
 +
    int MwAddRef();                    // Increments countRef
 +
    int MwRelease();                  // Decrements countRef. If zero, the object and all dependants are destroyed.
 +
 +
    void MwAddDependant(CMwNod*);
 +
    void MwAddReceiver(CMwNod*);
 +
    void MwSubDependant(CMwNod*);
 +
    void MwSubDependantSafe(CMwNod*);
 +
    void MwFinalSubDependant(CMwNod*);
 +
    void DependantSendMwIsKilled();
 
   
 
   
 
  private:
 
  private:
     int refcount;               // Reference count. If this reaches zero, the object is destroyed.
+
     int countRef;                     // Reference count. If this reaches zero, the object is destroyed.
     CSystemFid* pFid;           // File which the object originates from (if it was deserialized; NULL otherwise)
+
     CSystemFid* pFid;                 // File which the object originates from (if it was deserialized; NULL otherwise)
     FastBuffer<CMwNod*>* pList;  // Optional list of child objects
+
     FastBuffer<CMwNod*>* pDependants;  // Optional list of child objects
 
     int unknown;
 
     int unknown;
 
  };
 
  };
 
   
 
   
VirtualParam_Get() and VirtualParam_Set() should not be used directly. These only exist for handling calculated properties (where the value doesn't come directly from a field in the class but is calculated). Instead, use the nonvirtual wrapper methods GetProperty() and CallMethod() which handle both field properties and calculated properties.
+
VirtualParam_Get() and VirtualParam_Set() should not be used directly. These only exist for handling calculated properties (where the value doesn't come directly from a field in the class but is calculated). Instead, use the nonvirtual wrapper methods Param_Get() and Param_Set() which handle both field properties and calculated properties.
    
===Runtime class inspection===
 
===Runtime class inspection===

Navigation menu