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