Colobot
task_executor_object.h
1 /*
2  * This file is part of the Colobot: Gold Edition source code
3  * Copyright (C) 2001-2016, 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 
37 {
38 public:
39  explicit CTaskExecutorObject(ObjectInterfaceTypes& types)
40  {
41  types[static_cast<int>(ObjectInterfaceType::TaskExecutor)] = true;
42  }
43  virtual ~CTaskExecutorObject()
44  {}
45 
47 
48  virtual Error StartTaskTake() = 0;
49  virtual Error StartTaskManip(TaskManipOrder order, TaskManipArm arm) = 0;
50  virtual Error StartTaskFlag(TaskFlagOrder order, int rank) = 0;
51  virtual Error StartTaskBuild(ObjectType type) = 0;
52  virtual Error StartTaskSearch() = 0;
53  virtual Error StartTaskDeleteMark() = 0;
54  virtual Error StartTaskTerraform() = 0;
55  virtual Error StartTaskRecover() = 0;
56  virtual Error StartTaskFire(float delay) = 0;
57  virtual Error StartTaskFireAnt(Math::Vector impact) = 0;
58  virtual Error StartTaskSpiderExplo() = 0;
59  virtual Error StartTaskPen(bool down, TraceColor color = TraceColor::Default) = 0;
61 
63  virtual Error StartTaskWait(float time) = 0;
64  virtual Error StartTaskAdvance(float length) = 0;
65  virtual Error StartTaskTurn(float angle) = 0;
66  virtual Error StartTaskGoto(Math::Vector pos, float altitude, TaskGotoGoal goalMode, TaskGotoCrash crashMode) = 0;
67  virtual Error StartTaskInfo(const char *name, float value, float power, bool bSend) = 0;
69 
71  virtual Error StartTaskShield(TaskShieldMode mode, float delay = 1000.0f) = 0;
72  virtual Error StartTaskGunGoal(float dirV, float dirH) = 0;
74 
76  virtual bool IsForegroundTask() = 0;
78  virtual bool IsBackgroundTask() = 0;
79 
81  virtual CForegroundTask* GetForegroundTask() = 0;
83  virtual CBackgroundTask* GetBackgroundTask() = 0;
84 
86  virtual void StopForegroundTask() = 0;
88  virtual void StopBackgroundTask() = 0;
89 };
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:36
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:94
ObjectInterfaceType enum.
virtual void StopBackgroundTask()=0
Stop background task.
objects that can execute tasks (CTask classes)
CObject - base class for all game objects.
ObjectType
Type of game object.
Definition: object_type.h:33
Definition: task.h:103
3D (3x1) vector
Definition: vector.h:53
virtual bool IsForegroundTask()=0
Is executing foreground task?
virtual CBackgroundTask * GetBackgroundTask()=0
Return the background task.