Browse Source

Update Custom Modules Latest to include header and class name changes. (#5205)

Nora 3 years ago
parent
commit
c1b7505ef8

+ 4 - 4
development/cpp/binding_to_external_libraries.rst

@@ -26,10 +26,10 @@ Next, you will create a header file with a TTS class:
     #ifndef GODOT_TTS_H
     #ifndef GODOT_TTS_H
     #define GODOT_TTS_H
     #define GODOT_TTS_H
 
 
-    #include "core/reference.h"
+    #include "core/object/ref_counted.h"
 
 
-    class TTS : public Reference {
-        GDCLASS(TTS, Reference);
+    class TTS : public RefCounted {
+        GDCLASS(TTS, RefCounted);
 
 
     protected:
     protected:
         static void _bind_methods();
         static void _bind_methods();
@@ -95,7 +95,7 @@ These files should contain the following:
 
 
     #include "register_types.h"
     #include "register_types.h"
 
 
-    #include "core/class_db.h"
+    #include "core/object/class_db.h"
     #include "tts.h"
     #include "tts.h"
 
 
     void register_tts_types() {
     void register_tts_types() {

+ 8 - 12
development/cpp/custom_godot_servers.rst

@@ -43,13 +43,13 @@ an initialization state and a cleanup procedure.
 	#ifndef HILBERT_HOTEL_H
 	#ifndef HILBERT_HOTEL_H
 	#define HILBERT_HOTEL_H
 	#define HILBERT_HOTEL_H
 
 
-	#include "core/list.h"
-	#include "core/object.h"
+	#include "core/object/object.h"
 	#include "core/os/thread.h"
 	#include "core/os/thread.h"
 	#include "core/os/mutex.h"
 	#include "core/os/mutex.h"
-	#include "core/rid.h"
-	#include "core/set.h"
-	#include "core/variant.h"
+	#include "core/templates/list.h"
+	#include "core/templates/rid.h"
+	#include "core/templates/set.h"
+	#include "core/variant/variant.h"
 
 
 	class HilbertHotel : public Object {
 	class HilbertHotel : public Object {
 		GDCLASS(HilbertHotel, Object);
 		GDCLASS(HilbertHotel, Object);
@@ -96,10 +96,8 @@ an initialization state and a cleanup procedure.
 
 
 	#include "hilbert_hotel.h"
 	#include "hilbert_hotel.h"
 
 
-	#include "core/dictionary.h"
-	#include "core/list.h"
+	#include "core/variant/dictionary.h"
 	#include "core/os/os.h"
 	#include "core/os/os.h"
-	#include "core/variant.h"
 
 
 	#include "prime_225.h"
 	#include "prime_225.h"
 
 
@@ -240,8 +238,6 @@ an initialization state and a cleanup procedure.
 
 
 	/* prime_225.h */
 	/* prime_225.h */
 
 
-	#include "core/int_types.h"
-
 	const uint64_t PRIME[225] = {
 	const uint64_t PRIME[225] = {
 			2,3,5,7,11,13,17,19,23,
 			2,3,5,7,11,13,17,19,23,
 			29,31,37,41,43,47,53,59,61,
 			29,31,37,41,43,47,53,59,61,
@@ -338,8 +334,8 @@ is used to register the dummy class in GDScript.
 
 
 	#include "register_types.h"
 	#include "register_types.h"
 
 
-	#include "core/class_db.h"
-	#include "core/engine.h"
+	#include "core/object/class_db.h"
+	#include "core/config/engine.h"
 
 
 	#include "hilbert_hotel.h"
 	#include "hilbert_hotel.h"
 
 

+ 5 - 5
development/cpp/custom_modules_in_cpp.rst

@@ -51,10 +51,10 @@ Inside we will create a summator class:
     #ifndef SUMMATOR_H
     #ifndef SUMMATOR_H
     #define SUMMATOR_H
     #define SUMMATOR_H
 
 
-    #include "core/reference.h"
+    #include "core/object/ref_counted.h"
 
 
-    class Summator : public Reference {
-        GDCLASS(Summator, Reference);
+    class Summator : public RefCounted {
+        GDCLASS(Summator, RefCounted);
 
 
         int count;
         int count;
 
 
@@ -129,7 +129,7 @@ These files should contain the following:
 
 
     #include "register_types.h"
     #include "register_types.h"
 
 
-    #include "core/class_db.h"
+    #include "core/object/class_db.h"
     #include "summator.h"
     #include "summator.h"
 
 
     void register_summator_types() {
     void register_summator_types() {
@@ -366,7 +366,7 @@ We now need to add this method to ``register_types`` header and source files:
 
 
     #include "register_types.h"
     #include "register_types.h"
 
 
-    #include "core/class_db.h"
+    #include "core/object/class_db.h"
     #include "summator.h"
     #include "summator.h"
 
 
     void preregister_summator_types() {
     void preregister_summator_types() {