Files
st/include/MainGame/CargoManager.hpp
T
Yanis 5e934a8c9b Decompile overlay 24 (Part 3) (#68)
* name func_01ffd3d8 and func_01ffd400

* name func_01ffd3b0

* match func_ov024_020cf9d4 + improve the Random struct

* UnkStruct_027e0cf8_00_0C_024 45%

* match PassengerManager::GetRandomIndex

* UnkStruct_027e0cf8_00_0C_024 OK

* UnkStruct_027e0cf8_00_0C_024: do other sections

* UnkStruct_027e0cf8_08_024 55%

* cleanup: remplace delete into null by the delete macro

* UnkStruct_027e0cf8_08_024 OK

* fix build issues

* UnkStruct_ov024_020d86a0_024 OK

* PlayerActor_A0_38_024 .text OK, CreditsEndingType OK

* tools: create courselist.py to convert .CLB data to yaml

* UnkDataStruct4_14 OK

* UnkDataStruct4 17%

* UnkDataStruct4 OK

* MiscAdvManager OK

* PassengerManager OK

* fix build issues

* ZeldaTrainBinary OK

* mark PassengerManager as complete and adjust delinks

* UnkStruct_027e0cf8_08_00_024 OK

* document more of UnkStruct_027e0ce0

* savefile hotfixes

* UnkStruct_027e0ce0_34_024 OK

* code_020d46b4_024 OK

* UnkStruct_027e0d00 & UnkStruct_027e0d00_20 OK

* code_020d51dc_024 OK

* fix weird formatting

* UnkTrainSystem1 OK

* fix jp broken match

* UnkTrainSystem2 OK

* UnkStruct_027e0d08_024 31%

* fix build issues

* UnkStruct_027e0d08 OK!!!

* remove useless parenthesis

* ActorUnk_ov000_020a8bb0_EC OK

* move ActorUnk_ov000_020a8bb0_EC to MainGame/Actor/

* ActorUnkOBPC OK

* add sjiswrap support

* solve remaining gaps and fix build issues

* reorganise files + counter docs

* tools: remove format command execution from defaults
2026-06-09 23:01:32 +02:00

102 lines
2.0 KiB
C++

#pragma once
#include "types.h"
typedef s32 CargoType;
enum CargoType_ {
CargoType_None = -1,
CargoType_MegaIce,
CargoType_Wood,
CargoType_Iron,
CargoType_Fish,
CargoType_Cuccos,
CargoType_Vessel,
CargoType_DarkOre,
CargoType_Max,
};
class Cargo {
public:
/* 00 */ CargoType mType;
/* 04 */ unk32 mAmount;
/* 08 */ u32 mDecayTimer;
/* 0C */
Cargo() {
this->Clear();
}
void Set(unk32 type, unk32 amount) {
this->mType = type;
this->mAmount = amount;
this->mDecayTimer = 0;
}
void Clear() {
this->mType = CargoType_None;
this->mAmount = 0;
this->mDecayTimer = 0;
}
CargoType GetType() {
return this->mType;
}
bool IsTypeSet() {
return this->mType != CargoType_None;
}
unk32 GetAmount() {
return this->mAmount;
}
};
class CargoManager : public AutoInstance<CargoManager> {
public:
/* 00 */ Cargo mCargo;
/* 0C */ Cargo mCargo2;
/* 18 */ unk32 mUnk_18; // invicibility timer?
/* 1C */ bool mUnk_1C;
/* 20 */
Cargo *GetCargo() {
return &this->mCargo;
}
// overlay 1
CargoManager();
~CargoManager();
void func_ov001_020bf830();
static void Destroy(); // func_ov001_020bf428
// overlay 17
void Update();
void Reset();
void Init(unk32 type, unk32 amount);
void func_ov017_020bebdc();
void func_ov017_020bec20();
void RemoveAmount(unk32 decr);
bool func_ov017_020bec9c();
static void DoUpdate();
static bool IsNotUsingTimer(unk32 type);
// overlay 24
void SetCargo(unk32 type, unk32 amount);
void GetTypeAndAmount(unk32 *pType, unk32 *pAmount);
void func_ov024_020d5900();
void func_ov024_020d591c();
static CargoManager *Create();
};
struct UnkCargoStruct {
s16 type;
u16 requiredAmount;
};
extern CargoManager *gpCargoManager;
extern const UnkCargoStruct data_ov024_020d78c0[];