Colobot
task_executor_object.h
1 /*
2  * This file is part of the Colobot: Gold Edition source code
3  * Copyright (C) 2001-2015, Daniel Roux, EPSITEC SA & TerranovaTeam
4  * http://epsitec.ch; http://colobot.info; http://github.com/colobot
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14  * See the GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see http://gnu.org/licenses
18  */
19 
20 #pragma once
21 
22 #include "object/object.h"
24 
25 #include "object/interface/trace_drawing_object.h"
26 
27 #include "object/task/taskflag.h"
28 #include "object/task/taskgoto.h"
29 #include "object/task/taskmanip.h"
30 #include "object/task/taskshield.h"
31 
32 class CTask;
33 
39 {
40 public:
41  explicit CTaskExecutorObject(ObjectInterfaceTypes& types)
42  {
43  types[static_cast<int>(ObjectInterfaceType::TaskExecutor)] = true;
44  }
45  virtual ~CTaskExecutorObject()
46  {}
47 
49 
50  virtual Error StartTaskTake() = 0;
51  virtual Error StartTaskManip(TaskManipOrder order, TaskManipArm arm) = 0;
52  virtual Error StartTaskFlag(TaskFlagOrder order, int rank) = 0;
53  virtual Error StartTaskBuild(ObjectType type) = 0;
54  virtual Error StartTaskSearch() = 0;
55  virtual Error StartTaskDeleteMark() = 0;
56  virtual Error StartTaskTerraform() = 0;
57  virtual Error StartTaskRecover() = 0;
58  virtual Error StartTaskFire(float delay) = 0;
59  virtual Error StartTaskFireAnt(Math::Vector impact) = 0;
60  virtual Error StartTaskSpiderExplo() = 0;
61  virtual Error StartTaskPen(bool down, TraceColor color = TraceColor::Default) = 0;
63 
65  virtual Error StartTaskWait(float time) = 0;
66  virtual Error StartTaskAdvance(float length) = 0;
67  virtual Error StartTaskTurn(float angle) = 0;
68  virtual Error StartTaskGoto(Math::Vector pos, float altitude, TaskGotoGoal goalMode, TaskGotoCrash crashMode) = 0;
69  virtual Error StartTaskInfo(const char *name, float value, float power, bool bSend) = 0;
71 
73  virtual Error StartTaskShield(TaskShieldMode mode, float delay = 1000.0f) = 0;
74  virtual Error StartTaskGunGoal(float dirV, float dirH) = 0;
76 
78  virtual bool IsForegroundTask() = 0;
80  virtual bool IsBackgroundTask() = 0;
81 
83  virtual CForegroundTask* GetForegroundTask() = 0;
85  virtual CBackgroundTask* GetBackgroundTask() = 0;
86 
88  virtual void StopForegroundTask() = 0;
90  virtual void StopBackgroundTask() = 0;
91 };
virtual void StopForegroundTask()=0
Stop foreground task.
virtual Error StartTaskTake()=0
Start a foreground task.
virtual bool IsBackgroundTask()=0
Is executing background task?
Interface for objects that can execute tasks.
Definition: task_executor_object.h:38
virtual Error StartTaskWait(float time)=0
Start a foreground task (scriptable tasks, not in UI)
virtual Error StartTaskShield(TaskShieldMode mode, float delay=1000.0f)=0
Starts a background task.
virtual CForegroundTask * GetForegroundTask()=0
Return the foreground task.
Definition: task.h:96
ObjectInterfaceType enum.
virtual void StopBackgroundTask()=0
Stop background task.
objects that can execute tasks (CTask classes)
CObject - base class for all game objects.
Definition: task.h:63
ObjectType
Type of game object.
Definition: object_type.h:33
Definition: task.h:105
3D (3x1) vector
Definition: vector.h:53
virtual bool IsForegroundTask()=0
Is executing foreground task?
virtual CBackgroundTask * GetBackgroundTask()=0
Return the background task.