Colobot
controllable_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 "graphics/engine/camera.h"
23 
25 
31 {
32 public:
33  explicit CControllableObject(ObjectInterfaceTypes& types)
34  {
35  types[static_cast<int>(ObjectInterfaceType::Controllable)] = true;
36  }
37  virtual ~CControllableObject()
38  {}
39 
41  virtual void SetTrainer(bool trainer) = 0;
43  virtual bool GetTrainer() = 0;
44 
45  // TODO: Refactor SetSelect/GetSelect to be stored in CRobotMain? There can be ever only one selected object...
47  virtual void SetSelect(bool select, bool bDisplayError = true) = 0;
49  virtual bool GetSelect() = 0;
50 
52  virtual bool GetSelectable() = 0;
53 
55  virtual void SetHighlight(bool highlight) = 0;
56 
58  virtual void SetCameraType(Gfx::CameraType type) = 0;
60  virtual Gfx::CameraType GetCameraType() = 0;
62  virtual void SetCameraLock(bool lock) = 0;
64  virtual bool GetCameraLock() = 0;
65 
67 
68  virtual void AdjustCamera(Math::Vector &eye, float &dirH, float &dirV,
69  Math::Vector &lookat, Math::Vector &upVec,
70  Gfx::CameraType type) = 0;
71 };
CameraType
Type of camera.
Definition: camera.h:44
objects that can be selected and controlled by the player
Camera handling - CCamera class.
virtual bool GetSelect()=0
Checks if the object is selected.
virtual void SetCameraLock(bool lock)=0
Disallow camera changes.
virtual void SetSelect(bool select, bool bDisplayError=true)=0
Selects the object.
virtual void SetCameraType(Gfx::CameraType type)=0
Set camera type for this object.
virtual bool GetTrainer()=0
Checks if remote control is disabled.
virtual void SetHighlight(bool highlight)=0
Highlights the object on mouse over.
Interface for objects that can be selected and controlled by the player.
Definition: controllable_object.h:30
virtual bool GetSelectable()=0
Returns true if the object is selectable.
virtual void AdjustCamera(Math::Vector &eye, float &dirH, float &dirV, Math::Vector &lookat, Math::Vector &upVec, Gfx::CameraType type)=0
Adjust camera parameters for the given object.
ObjectInterfaceType enum.
virtual bool GetCameraLock()=0
Check if camera changes are disallowed.
virtual Gfx::CameraType GetCameraType()=0
Return camera type for this object.
3D (3x1) vector
Definition: vector.h:53
virtual void SetTrainer(bool trainer)=0
Disables remote control of an object (only programming allowed)