コード例 #1
0
ファイル: floor.cpp プロジェクト: ToonTalk/desktop-toontalk
void Floor::load(InputStream *stream, int notebook_version, NaturalLanguage language) {
   if (stream->get() != FLOOR_MARKER) {
		say_error(IDS_BAD_FLOOR_IN_CITY_FILE,TRUE);
      return;
   };
   Sprites *floor_items = load_items(stream,notebook_version,language);
   if (floor_items != NULL) {
//      add_items(floor_items);
		Sprites *remaining = floor_items;
		while (remaining != NULL) {
			// new on 101099 if priority of item is fixed then don't reset it
			// so Marty, for example, loads in with correct priority
			add_item(remaining->first(),FALSE); 
			// FALSE replaced !remaining->first()->priority_fixed() above on 211199 since priority is now saved correctly
			remaining = remaining->rest();
		};
		floor_items->recursively_propagate_changes();
		floor_items->activate();
      floor_items->remove_all();
      delete floor_items;
   };
	if (notebook_version >= first_version_to_save_number_colors) {
		stream->read((string) &current_priority, sizeof(current_priority)); // new on 150100
	};
};
コード例 #2
0
ファイル: floor.cpp プロジェクト: ToonTalk/desktop-toontalk
void Floor::need_new_main_cubby() {
	Sprites *remaining = alternative_body_cubbies;
	while (remaining != NULL) {
		Cubby *cubby = (Cubby *) (remaining->first());
		if (cubby->vacuum_if_left_on_floor(NULL,0)) { // args are ignored
			record_event(NEW_MAIN_CUBBY,tt_programmer->pointer_to_appearance(),this,cubby);
		};
		remaining = remaining->rest();
	};
};
コード例 #3
0
ファイル: room.cpp プロジェクト: ToonTalk/desktop-toontalk
void Room::set_wall_decoration(Sprites *sprites, boolean give_priority, boolean subpicture) {
   initialize_wall_decoration();
   if (sprites == NULL) {
      wall_decoration->set_visible(FALSE);
   } else {
//      wall_decoration->set_visible(TRUE);
      Sprites *remaining = sprites;
      while (remaining != NULL) {
         add_decoration(remaining->first(),give_priority,subpicture);
//         wall_decoration->add_follower(sprite,TRUE,FALSE);  // is completely inside but want insertion by priority
//         sprite->recursively_activate_pictures();
         remaining->set_first(NULL); // since about to destroy list
         remaining = remaining->rest();
      };
      delete sprites; // just the list not the contents
   };
};
コード例 #4
0
ファイル: thought.cpp プロジェクト: ToonTalk/desktop-toontalk
void Thought_Bubble::xml(xml_element *element, xml_document *document) {
//#if TT_DEBUG_ON
//	if (!geometry_worth_saving()) {
//		log("debug this");
//	};
//#endif
	// taken care of below now -- uncommented out on 280803 since if saving a city just after giving an untrained robot a box then cubby isn't yet a follower
	if (cubby != NULL && followers == NULL) {
		cubby->xml_create_and_append_element(element,document)->Release();
	};
	// what about robot?? -- apparently not needed since is only a back pointer and robot will do the work
	Sprites *remaining = followers; // new on 130703 -- needed if saving while expanding thought bubble to enter training
	while (remaining != NULL) {
		Sprite *sprite = remaining->first();
//		if (sprite != cubby) { // if not already dealt with above
			sprite->xml_create_and_append_element(element,document)->Release(); // shouldn't be any more cubbies - right? otherwise confusion
//		};
		remaining = remaining->rest();
	};
	Sprite::xml(element,document);
//   return(create_xml_element(L"ThoughtBubble",document,cubby,TRUE)); // last arg was FALSE prior to 120603 but can be shared if is current selection when city is saved - everything is like this
};