Wrath of Zeus
Made by Torchlight Games for CSE 125 SP24
Loading...
Searching...
No Matches
item.hpp
Go to the documentation of this file.
1#pragma once
2
5
6/*
7* Things to do when adding items:
8* 1. Make a class / or add onto existing inheritance tree
9* 2. Add to gridcell.hpp / .cpp
10* 3. Create the cell in servergamestate.cpp
11* 4. Create a modeltype for item in sharedmodel.hpp
12* 5. Make client.cpp render the item properly
13* 6. Update img.hpp / .cpp & add the sprite in assets/img
14* 7. Add this item in _sharedGameHUD, gui.cpp, and add text
15*/
16
20class Item : public Object {
21public:
23
31 Item(ObjectType type, bool movable, glm::vec3 corner, ModelType model, glm::vec3 dimensions);
32
33 virtual void useItem(Object* other, ServerGameState& state, int itemSelected);
34
35 virtual void dropItem(Object* other, ServerGameState& state, int itemSelected, float dropDistance);
36
37 void doCollision(Object* other, ServerGameState& state) override;
38
39 SharedObject toShared() override;
40
41private:
42
43};
Definition: item.hpp:20
SharedObject toShared() override
Generates a SharedObject representation of this object.
Definition: item.cpp:79
SharedItemInfo iteminfo
Definition: item.hpp:22
virtual void useItem(Object *other, ServerGameState &state, int itemSelected)
Definition: item.cpp:13
void doCollision(Object *other, ServerGameState &state) override
Code to run when this object collides with another.
Definition: item.cpp:45
virtual void dropItem(Object *other, ServerGameState &state, int itemSelected, float dropDistance)
Definition: item.cpp:24
Definition: object.hpp:95
The ServerGameState class contains all abstract game state data and logic for a single game state ins...
Definition: servergamestate.hpp:43
Representation of the Object class used by ServerGameState, containing exactly the subset of Object d...
Definition: sharedobject.hpp:302
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glad.h:1531
ModelType
Enumeration of every render model in the game.
Definition: sharedmodel.hpp:6
ObjectType
An enum for the type of an object; the fields here should match all class names in the inheritance tr...
Definition: sharedobject.hpp:19
Definition: sharedobject.hpp:139