Esempio n. 1
0
bool Semester::dropLine(Node *snode, Node *par, Course *course){
  Node *temp = snode,
       *temp2 = par;
  std::vector<int> pos;
  bool dragtemp;
  while(temp != NULL){
    if(!drageffect){
      pos = checkDragEffect(temp);
      if(pos.size() != 0){
        dropUpdate(temp2, temp, course);
        drageffect = false;
        return true;
      }
    }
    temp2 = temp;
    switch(temp->GetNodeType()){
      case NODE_NORMAL:
        temp = temp->GetChild();
        break;
      case NODE_SPLIT:
        dragtemp = drageffect;
        if(dropLine(temp->GetChild(1), temp, course))
          return true;
        drageffect = dragtemp;
        temp = temp->GetChild();
        break;
      case NODE_CHOICE:
      default: break;
    }
  }
  if(!drageffect){
    if(temp2 != NULL && temp2 == par){
      pos = checkUnder(temp2->GetX()+125, temp2->GetY() - 70);
    }
    else if(temp2 != NULL && temp2->GetNodeType() == NODE_SPLIT){
      pos = checkUnder(temp2->GetX()-125, temp2->GetY() - 70);
    }
    else
      pos = checkUnder(temp2);
    if(pos.size() != 0){
      dropUpdate(temp2, temp, course);
      return true;
    }
  }
  else
    drageffect = false;
  return false;
}
Esempio n. 2
0
bool Semester::drop(wxPoint dragpos, Course *course){
  this->dragpos = dragpos;
  return dropLine(root, NULL, course);
}
Esempio n. 3
0
void PlayingField::dropLinesBetweenIndices(int startIndex, int endIndex) {
	for (int i = endIndex - 1; i >= startIndex; i--) {
		dropLine(i);
	}
}