Tramway SDK
player.h
Go to the documentation of this file.
1// TRAMWAY DRIFT AND DUNGEON EXPLORATION SIMULATOR 2022
2// All rights reserved.
3
4#ifndef TRAM_SDK_COMPONENTS_PLAYERCOMPONENT_H
5#define TRAM_SDK_COMPONENTS_PLAYERCOMPONENT_H
6
7#include <framework/ui.h>
8#include <framework/event.h>
9#include <framework/entity.h>
10#include <framework/loader.h>
11
13
14#include <framework/logging.h>
15
16// this is for holding
17#include <render/render.h>
18#include <framework/message.h>
19
20namespace tram {
21
23public:
24 void EventHandler (Event &event);
25 void Init();
28 void SetControllerComponent (ControllerComponent* comp) { controller = comp; }
29 void Start() {}
30 void MoveUpdate() { assert(cell_loader); cell_loader->UpdateLocation(parent->GetLocation()); }
31private:
32 EventListener keydown;
33 EventListener keypress;
34 EventListener mouseposition;
35
36 ControllerComponent* controller = nullptr;
37 Loader* cell_loader = nullptr;
38};
39
40}
41
42#endif // TRAM_SDK_COMPONENTS_PLAYERCOMPONENT_H
Definition: controller.h:16
Definition: entitycomponent.h:18
Entity * parent
Definition: entitycomponent.h:40
const vec3 & GetLocation()
Definition: entity.h:61
Smart wrapper class for Event listeners.
Definition: event.h:64
Definition: loader.h:11
void UpdateLocation(vec3 location)
Definition: loader.cpp:21
Definition: player.h:22
void MoveUpdate()
Definition: player.h:30
~PlayerComponent()
Definition: player.cpp:25
void EventHandler(Event &event)
Definition: player.cpp:30
void SetControllerComponent(ControllerComponent *comp)
Definition: player.h:28
void Start()
Definition: player.h:29
PlayerComponent()
Definition: player.cpp:12
void Init()
Definition: player.cpp:16
Definition: api.h:9
Definition: event.h:24