]> git.lizzy.rs Git - dragonfireclient.git/blob - src/localplayer.h
RealBadAngel's patch which allows the lua api to read pressed player keys. This shoul...
[dragonfireclient.git] / src / localplayer.h
1 /*
2 Minetest-c55
3 Copyright (C) 2010-2012 celeron55, Perttu Ahola <celeron55@gmail.com>
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation; either version 2.1 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19
20 #ifndef LOCALPLAYER_HEADER
21 #define LOCALPLAYER_HEADER
22
23 #include "player.h"
24
25 class LocalPlayer : public Player
26 {
27 public:
28         LocalPlayer(IGameDef *gamedef);
29         virtual ~LocalPlayer();
30
31         bool isLocal() const
32         {
33                 return true;
34         }
35
36         bool isAttached;
37
38         v3f overridePosition;
39         
40         void move(f32 dtime, Map &map, f32 pos_max_d,
41                         core::list<CollisionInfo> *collision_info);
42         void move(f32 dtime, Map &map, f32 pos_max_d);
43
44         void applyControl(float dtime);
45
46         v3s16 getStandingNodePos();
47 private:
48         // This is used for determining the sneaking range
49         v3s16 m_sneak_node;
50         // Whether the player is allowed to sneak
51         bool m_sneak_node_exists;
52         // Node below player, used to determine whether it has been removed,
53         // and its old type
54         v3s16 m_old_node_below;
55         std::string m_old_node_below_type;
56         // Whether recalculation of the sneak node is needed
57         bool m_need_to_get_new_sneak_node;
58         bool m_can_jump;
59 };
60
61 #endif
62