| 884 | */ |
| 885 | |
| 886 | int CTaskManager::MarkTask( int id, int operation, CIcarus* icarus ) |
| 887 | { |
| 888 | CTaskGroup *group = GetTaskGroup( id, icarus ); |
| 889 | |
| 890 | assert( group ); |
| 891 | |
| 892 | if ( group == NULL ) |
| 893 | return TASK_FAILED; |
| 894 | |
| 895 | if ( operation == TASK_START ) |
| 896 | { |
| 897 | //Reset all the completion information |
| 898 | group->Init(); |
| 899 | |
| 900 | group->SetParent( m_curGroup ); |
| 901 | m_curGroup = group; |
| 902 | } |
| 903 | else if ( operation == TASK_END ) |
| 904 | { |
| 905 | assert( m_curGroup ); |
| 906 | if ( m_curGroup == NULL ) |
| 907 | return TASK_FAILED; |
| 908 | |
| 909 | m_curGroup = m_curGroup->GetParent(); |
| 910 | } |
| 911 | |
| 912 | #ifdef _DEBUG |
| 913 | else |
| 914 | { |
| 915 | assert(0); |
| 916 | } |
| 917 | #endif |
| 918 | |
| 919 | return TASK_OK; |
| 920 | } |
| 921 | |
| 922 | /* |
| 923 | ------------------------- |