Colobot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
motiontoto.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 // motiontoto.h
18 
19 #pragma once
20 
21 
22 #include "object/motion/motion.h"
23 
24 
25 
26 enum MotionTotoAction
27 {
28  MT_ERROR = 0,
29  MT_WARNING = 1,
30  MT_INFO = 2,
31  MT_MESSAGE = 3
32 };
33 
34 
35 class CMotionToto : public CMotion
36 {
37 public:
38  CMotionToto(CObject* object);
39  ~CMotionToto();
40 
41  void DeleteObject(bool bAll=false);
42  bool Create(Math::Vector pos, float angle, ObjectType type, float power);
43  bool EventProcess(const Event &event);
44  Error SetAction(int action, float time=0.2f);
45  void SetLinkType(ObjectType type);
46 
47  void StartDisplayInfo();
48  void StopDisplayInfo();
49  void SetMousePos(Math::Point pos);
50 
51 protected:
52  bool EventFrame(const Event &event);
53 
54 protected:
55  float m_time;
56  float m_lastMotorParticle;
57  bool m_bDisplayInfo;
58  bool m_bQuickPos;
59  bool m_bStartAction;
60  float m_speedAction;
61  float m_clownRadius;
62  float m_clownDelay;
63  float m_clownTime;
64  float m_blinkTime;
65  float m_blinkProgress;
66  int m_soundChannel;
67  ObjectType m_type;
68  Math::Point m_mousePos;
69 };
70 
ObjectType
Type of game object.
Definition: object.h:46
2D point
Definition: point.h:46
Definition: motion.h:44
Error
Type of error or info message.
Definition: global.h:29
3D (3x1) vector
Definition: vector.h:49
Definition: motiontoto.h:35
Event sent by system, interface or game.
Definition: event.h:687
Definition: object.h:372