本文整理汇总了C++中Notebook::is_left_page_selected方法的典型用法代码示例。如果您正苦于以下问题:C++ Notebook::is_left_page_selected方法的具体用法?C++ Notebook::is_left_page_selected怎么用?C++ Notebook::is_left_page_selected使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Notebook
的用法示例。
在下文中一共展示了Notebook::is_left_page_selected方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Path
Path *Floor::compute_path(Sprite *subject, EventCode code, Robot *by,
boolean notebook_page_really_selected
#if TT_POST3187
,Sprite *original_subject
#endif
) {
if (subject == body_cubby &&
(subject->pointer_to_leader() == NULL ||
subject->pointer_to_leader() == by)) {
return(new Path(MAIN_CUBBY));
};
if (subject == NULL) { // e.g. APPLY_VACUUM_RESTORE
return(new Path(NO_ARG));
};
if (subject == by->pointer_to_tool()) {
return(new Path(ITEM_HELD));
};
Path *path;
int backup_path_index = 0;
int working_set_length;
SpritePointer *working_set = by->working_set_and_size(working_set_length);
for (int index = 0; index < working_set_length; index++) {
Sprite *item = working_set[index];
if (item == subject && backup_path_index == 0 && !item->available_for_indexing()) {
backup_path_index = -(index+1);
};
if (item != NULL &&
(item->available_for_indexing() || // ok to be grasping it and typing
code == KEYBOARD_CHARACTER || code == KEYBOARD_CHARACTER_AND_SELECT)) {
boolean notebook_page = (notebook_page_really_selected && item->kind_of() == PROGRAM_PAD);
#if TT_POST3187
// this fixes Jack's bug "Wrong book" -- new on 280507
for (int i = index+1; i < working_set_length; i++) {
if (working_set[i] == original_subject) { // another vacuum really did this
notebook_page = FALSE;
break;
};
};
#endif );
if (item == subject || item == tt_just_vacuumed_remote || (code == VACUUM_APPLY && notebook_page)) {
// second disjunct added 091000 --
// third on 110205 -- removed on 160205 || code == VACUUM_APPLY -- added back on 170205 with added notebook_page condition
if (notebook_page && (item != subject || code != VACUUM_APPLY)) { // rewritten on 240205
// added second condition on 170205 in case vacuuming up entire notebook
Notebook *notebook = (Notebook *) item;
// int page_number = notebook->return_recent_page_number()
// -notebook->return_page_number_offset();
if (code == VACUUM_APPLY) {
// new on 110205 -- not clear why the other branch uses ! but that's worked for a long time...
return(new Path(-(index+1),new Path(notebook->is_left_page_selected())));
} else {
return(new Path(-(index+1),new Path(!notebook->is_left_page_selected()))); // page_number)));
};
} else if (tt_just_vacuumed == subject) { // new on 290704
return(new Path(-(index+1),new Path(SPECIAL_PATH_MARKER,new Path(subject->kind_of()))));
} else {
return(new Path(-(index+1)));
};
} else if (tt_just_vacuumed == item) { // item was subject prior to 191199 so sometimes things not recorded right when vacuum used
// not clear when this branch applies -- asked 290704
// item->reset_appearance_before_vacuuming();
return(new Path(-(index+1),new Path(SPECIAL_PATH_MARKER,new Path(item->kind_of())))); // ,new Path(SPECIAL_PATH_MARKER)
};
boolean ok = TRUE; // path is ok unless found otherwise
path = item->path_to(subject,ok);
if (ok) {
// if (item->kind_of() == CUBBY) {
return(new Path(-(index+1),path));
// } else {
// return(new Path(-(index+1),new Path(SPECIAL_PATH_MARKER,path)));
// };
};
/*
switch (item->kind_of()) {
case CUBBY:
path = ((Cubby *) item)->path_to(subject);
if (path != NULL) {
return(new Path(-(index+1),path));
};
break;
case NEST: {
Nest *nest = (Nest *) item;
Sprite *nest_top = nest->pointer_to_contents();
if (nest_top == NULL) break;
if (nest_top == subject) {
return(new Path(-(index+1),NULL));
} else if (nest_top->kind_of() == CUBBY) {
Path *cubby_path = ((Cubby *) nest_top)->path_to(subject);
if (cubby_path != NULL) {
return(new Path(-(index+1),cubby_path));
};
};
break;
};
case TRUCK: {
// Cubby *trucks_cubby = ((Truck *) item)->pointer_to_cubby();
// if (trucks_cubby != NULL) {
// path = trucks_cubby->path_to(subject);
// };
CargoType type = ((Truck_Inside *) item)->cargo_type(subject);
//.........这里部分代码省略.........