From 3f557369c7bbd08fdf2e6dbd9271873b20a9a144 Mon Sep 17 00:00:00 2001 From: fusion32 Date: Sat, 24 May 2025 20:57:24 -0300 Subject: halfway of `map.cc` and start of `objects.cc` --- src/map.hh | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 63 insertions(+), 12 deletions(-) (limited to 'src/map.hh') diff --git a/src/map.hh b/src/map.hh index 298d190..590fb41 100644 --- a/src/map.hh +++ b/src/map.hh @@ -2,25 +2,76 @@ #define TIBIA_MAP_HH_ 1 #include "common.hh" - -// TODO(fusion): I'm not sure whether to put these. +#include "objects.hh" struct Object { + // REGULAR FUNCTIONS + // ========================================================================= + Object(void) { this->ObjectID = 0; } + Object(uint32 ObjectID) { this->ObjectID = ObjectID; } + bool exists(void); + + ObjectType getObjectType(void); + void setObjectType(ObjectType Type); + + Object getNextObject(void); + void setNextObject(Object NextObject); + + Object getContainer(void); + void setContainer(Object Con); + + uint32 getCreatureID(void); + //void setCreatureID(uint32 CreatureID); //?? + + uint32 getAttribute(INSTANCEATTRIBUTE Attribute); + void setAttribute(INSTANCEATTRIBUTE Attribute, uint32 Value); + + // DATA + // ========================================================================= uint32 ObjectID; }; -constexpr Object NONE = {}; +constexpr Object NONE; -struct ObjectType { - int TypeID; +struct TObject { + uint32 ObjectID; + Object NextObject; + Object Container; + ObjectType Type; + uint32 Attributes[4]; }; -struct TObjectType { - char *Name; - char *Description; - uint8 Flags[9]; - uint32 Attributes[62]; - int AttributeOffsets[18]; +struct TObjectBlock { + TObject Object[32768]; }; -#endif //TIBIA_MAP_HH_ \ No newline at end of file +struct TSector { + Object MapCon[32][32]; + uint32 TimeStamp; + uint8 Status; + uint8 MapFlags; +}; + +struct TDepotInfo { + char Town[20]; + int Size; +}; + +struct TMark { + char Name[20]; + int x; + int y; + int z; +}; + +struct TCronEntry { + Object Obj; + uint32 RoundNr; + int Previous; + int Next; +}; + +void InitMap(void); +void ExitMap(bool Save); + +#endif //TIBIA_MAP_HH_ -- cgit v1.2.3