Colobot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
task.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 // task.h
18 
19 #pragma once
20 
21 
22 #include "common/event.h"
23 #include "common/global.h"
24 
25 #include "math/const.h"
26 
27 
28 class CBrain;
29 class CPhysics;
30 class CMotion;
31 class CObject;
32 class CRobotMain;
33 class CSoundInterface;
34 
35 
36 namespace Gfx {
37 class CEngine;
38 class CLightManager;
39 class CParticle;
40 class CTerrain;
41 class CWater;
42 class CCamera;
43 } /* Gfx */
44 
45 
46 const float TAKE_DIST = 6.0f; // distance to an object to pick it
47 const float TAKE_DIST_OTHER = 1.5f; // additional distance if on friend
48 
49 //?const float ARM_NEUTRAL_ANGLE1 = 155.0f*Math::PI/180.0f;
50 //?const float ARM_NEUTRAL_ANGLE2 = -125.0f*Math::PI/180.0f;
51 //?const float ARM_NEUTRAL_ANGLE3 = -45.0f*Math::PI/180.0f;
52 const float ARM_NEUTRAL_ANGLE1 = 110.0f*Math::PI/180.0f;
53 const float ARM_NEUTRAL_ANGLE2 = -130.0f*Math::PI/180.0f;
54 const float ARM_NEUTRAL_ANGLE3 = -50.0f*Math::PI/180.0f;
55 
56 const float ARM_STOCK_ANGLE1 = 110.0f*Math::PI/180.0f;
57 const float ARM_STOCK_ANGLE2 = -100.0f*Math::PI/180.0f;
58 const float ARM_STOCK_ANGLE3 = -70.0f*Math::PI/180.0f;
59 
60 
61 class CTask
62 {
63 public:
64  CTask(CObject* object);
65  virtual ~CTask();
66 
67  virtual bool EventProcess(const Event &event);
68  virtual Error IsEnded();
69  virtual bool IsBusy();
70  virtual bool Abort();
71 
72 protected:
73  Gfx::CEngine* m_engine;
74  Gfx::CLightManager* m_lightMan;
75  Gfx::CParticle* m_particle;
76  Gfx::CTerrain* m_terrain;
77  Gfx::CWater* m_water;
78  Gfx::CCamera* m_camera;
79  CMotion* m_motion;
80  CBrain* m_brain;
81  CPhysics* m_physics;
82  CObject* m_object;
83  CRobotMain* m_main;
84  CSoundInterface* m_sound;
85 };
86