+
+ if(set_as_global && !global_resources)
+ global_resources = this;
+}
+
+Resources::~Resources()
+{
+ if(this==global_resources)
+ global_resources = 0;
+}
+
+Resources &Resources::get_global()
+{
+ if(!global_resources)
+ throw invalid_operation("no global resources");
+ return *global_resources;