Colobot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
taskmanager.h
1 // * This file is part of the COLOBOT source code
2 // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
3 // *
4 // * This program is free software: you can redistribute it and/or modify
5 // * it under the terms of the GNU General Public License as published by
6 // * the Free Software Foundation, either version 3 of the License, or
7 // * (at your option) any later version.
8 // *
9 // * This program is distributed in the hope that it will be useful,
10 // * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // * GNU General Public License for more details.
13 // *
14 // * You should have received a copy of the GNU General Public License
15 // * along with this program. If not, see http://www.gnu.org/licenses/.
16 
17 // taskmanager.h
18 
19 #pragma once
20 
21 
22 #include "object/object.h"
23 #include "object/task/task.h"
24 #include "object/task/taskmanip.h"
25 #include "object/task/taskgoto.h"
26 #include "object/task/taskshield.h"
27 #include "object/task/taskflag.h"
28 
29 
30 
32 {
33 public:
34  CTaskManager(CObject* object);
35  ~CTaskManager();
36 
37  Error StartTaskWait(float time);
38  Error StartTaskAdvance(float length);
39  Error StartTaskTurn(float angle);
40  Error StartTaskGoto(Math::Vector pos, float altitude, TaskGotoGoal goalMode, TaskGotoCrash crashMode);
41  Error StartTaskTake();
42  Error StartTaskManip(TaskManipOrder order, TaskManipArm arm);
43  Error StartTaskFlag(TaskFlagOrder order, int rank);
44  Error StartTaskBuild(ObjectType type);
45  Error StartTaskSearch();
46  Error StartTaskInfo(const char *name, float value, float power, bool bSend);
47  Error StartTaskTerraform();
48  Error StartTaskPen(bool bDown, int color);
49  Error StartTaskRecover();
50  Error StartTaskShield(TaskShieldMode mode, float delay);
51  Error StartTaskFire(float delay);
52  Error StartTaskFireAnt(Math::Vector impact);
53  Error StartTaskGunGoal(float dirV, float dirH);
54  Error StartTaskSpiderExplo();
55  Error StartTaskReset(Math::Vector goal, Math::Vector angle);
56 
57  bool EventProcess(const Event &event);
58  Error IsEnded();
59  bool IsBusy();
60  bool IsPilot();
61  bool Abort();
62 
63 protected:
64  CTask* m_task;
65  CObject* m_object;
66  bool m_bPilot;
67 };
68