/* Marks status of assignment as complete, places a copy of assignment in completed_assignments, then deletes it from assigned_list. */ void Assignment_Book::complete_assignment(Date userEntered_assigned_date, Date userEntered_completion_date) { if (userEntered_assigned_date > userEntered_completion_date) { cout << "The completion date cannot be earlier than the assigned date." << endl; return; } SetFound(true); list<Assignment>::iterator iter = find_assignment(userEntered_assigned_date); if (GetFound() == false) { cout << "Assignment not found" << endl; return; } if (userEntered_completion_date > iter->get_due_date()){ iter->set_status(late); } else{ iter->set_status(completed); } add_completed_assignment(*iter); cout << *iter << endl; assigned_list.remove(*iter); return; }
void HornOfValere::DropHorn(CvUnit* pUnit) { if (pUnit && pUnit->GetID() == GetOwnerUnitID() && pUnit->getOwner() == GetOwnerPlayerID()) { SetFound(false); SetOwnerPlayerID(-1); SetOwnerUnitID(-1); MoveHorn(pUnit->plot()); } }