Wrath of Zeus
Made by Torchlight Games for CSE 125 SP24
Loading...
Searching...
No Matches
mirror.hpp
Go to the documentation of this file.
1#pragma once
2
4#include <chrono>
5
6class Mirror : public Item {
7public:
8
14 Mirror(glm::vec3 corner, glm::vec3 dimensions);
15
22 void useItem(Object* other, ServerGameState& state, int itemSelected) override;
23
24 void dropItem(Object* other, ServerGameState& state, int itemSelected, float dropDistance) override;
25
31 bool timeOut();
32
39 void revertEffect(ServerGameState& state);
40private:
44 std::chrono::time_point<std::chrono::system_clock> used_time;
45
49 Player* used_player;
50};
Definition: item.hpp:20
Definition: mirror.hpp:6
bool timeOut()
Determines whether the mirror has been used for the mirror holding duration and updated the remaining...
Definition: mirror.cpp:43
void useItem(Object *other, ServerGameState &state, int itemSelected) override
Using the mirror causes it to be held for a few seconds.
Definition: mirror.cpp:10
void dropItem(Object *other, ServerGameState &state, int itemSelected, float dropDistance) override
Definition: mirror.cpp:36
void revertEffect(ServerGameState &state)
Stop holding the mirror.
Definition: mirror.cpp:64
Definition: object.hpp:95
Definition: player.hpp:9
The ServerGameState class contains all abstract game state data and logic for a single game state ins...
Definition: servergamestate.hpp:43