fixed_path_comp.hpp 592 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#pragma once

#include <mirrage/ecs/ecs.hpp>

#include <vector>

namespace phase_shifter::gameplay {
	
	struct Fixed_path_comp : public mirrage::ecs::Component<Fixed_path_comp> {
		static constexpr const char* name() { return "FixedPath"; }
		using Component::Component;

		void update_path(std::vector<float> directions);
		float next_direction();

	  private:
		int next_step = 0; //index of the next step
		std::vector<float> directions; //vector containing the steps as angles (degrees) with 0 being North (-Z)
		bool reverse = false; //flag wether the path is now traced backwards
	};
}