Colobot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
tasktake.h
1 /*
2  * This file is part of the Colobot: Gold Edition source code
3  * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
4  * http://epsiteс.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 // tasktake.h
21 
22 #pragma once
23 
24 
25 #include "object/task/task.h"
26 #include "object/object.h"
27 
28 
29 
30 enum TaskTakeOrder
31 {
32  TTO_TAKE = 1, // takes an object
33  TTO_DEPOSE = 2, // deposes the object
34 };
35 
36 enum TaskTakeArm
37 {
38  TTA_NEUTRAL = 1, // empty arm at rest
39  TTA_FFRONT = 2, // arm on the ground
40  TTA_FRIEND = 3, // arm behind a friend robot
41 };
42 
43 
44 
45 class CTaskTake : public CTask
46 {
47 public:
48  CTaskTake(CObject* object);
49  ~CTaskTake();
50 
51  bool EventProcess(const Event &event);
52 
53  Error Start();
54  Error IsEnded();
55  bool Abort();
56 
57 protected:
58  CObject* SearchTakeObject(float &angle, float dLimit, float aLimit);
59  CObject* SearchFriendObject(float &angle, float dLimit, float aLimit);
60  bool TruckTakeObject();
61  bool TruckDeposeObject();
62  bool IsFreeDeposeObject(Math::Vector pos);
63 
64 protected:
65  //TODO this is same member as in base class, probable should be deleted
66  Gfx::CTerrain* m_terrain;
67 
68  TaskTakeOrder m_order;
69  TaskTakeArm m_arm;
70  int m_step;
71  float m_speed;
72  float m_progress;
73  float m_height;
74  bool m_bError;
75  bool m_bTurn;
76  float m_angle;
77  ObjectType m_fretType;
78 };
79 
ObjectType
Type of game object.
Definition: object.h:51
Terrain loader/generator and manager.
Definition: terrain.h:222
CObject - base class for all game objects.
Definition: task.h:64
Error
Type of error or info message.
Definition: global.h:32
3D (3x1) vector
Definition: vector.h:52
Definition: tasktake.h:45
Event sent by system, interface or game.
Definition: event.h:678
Definition: object.h:357