2018-11-01 23:56:43 +01:00
|
|
|
#ifndef LAND_H_
|
|
|
|
#define LAND_H_
|
2018-11-01 00:18:19 +01:00
|
|
|
#include <Common.h>
|
2018-11-12 08:32:30 +01:00
|
|
|
#include "Exd/ExdDataGenerated.h"
|
2018-11-01 00:18:19 +01:00
|
|
|
#include "ForwardsZone.h"
|
|
|
|
|
2018-11-29 16:55:48 +01:00
|
|
|
namespace Sapphire
|
2018-11-01 00:18:19 +01:00
|
|
|
{
|
2018-11-04 23:47:10 +01:00
|
|
|
namespace Data
|
|
|
|
{
|
|
|
|
using HousingLandSetPtr = std::shared_ptr< HousingLandSet >;
|
|
|
|
}
|
|
|
|
|
2018-11-01 23:56:43 +01:00
|
|
|
class Land
|
2018-11-01 00:18:19 +01:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2018-12-29 00:53:52 +01:00
|
|
|
Land( uint16_t zoneId, uint8_t wardNum, uint8_t landId, uint32_t landSetId,
|
|
|
|
Sapphire::Data::HousingLandSetPtr info, FrameworkPtr pFw );
|
2018-11-01 23:56:43 +01:00
|
|
|
virtual ~Land();
|
2018-12-31 21:54:32 +11:00
|
|
|
void init( Common::LandType type, Common::HouseSize size, Common::HouseStatus state, uint32_t currentPrice, uint64_t ownerId, uint64_t houseId );
|
2018-11-01 00:18:19 +01:00
|
|
|
|
2018-12-05 19:58:43 +11:00
|
|
|
using LandInventoryMap = std::unordered_map< uint16_t, ItemContainerPtr >;
|
2018-12-23 19:13:30 +11:00
|
|
|
using InvMaxItemsPair = std::pair< uint16_t, uint16_t >;
|
2018-11-01 00:18:19 +01:00
|
|
|
|
|
|
|
//Primary state
|
2018-12-31 21:54:32 +11:00
|
|
|
void setSize( Common::HouseSize size );
|
|
|
|
void setStatus( Common::HouseStatus state );
|
2018-11-01 00:18:19 +01:00
|
|
|
void setSharing( uint8_t state );
|
2018-11-13 19:48:22 +01:00
|
|
|
void setLandType( Common::LandType type );
|
2018-11-01 00:18:19 +01:00
|
|
|
|
|
|
|
//Gerneral
|
2018-12-31 21:54:32 +11:00
|
|
|
Common::HouseSize getSize() const;
|
|
|
|
Common::HouseStatus getStatus() const;
|
2018-11-13 19:48:22 +01:00
|
|
|
uint8_t getSharing() const;
|
|
|
|
uint32_t getLandSetId() const;
|
|
|
|
Common::LandType getLandType() const;
|
2018-12-22 14:35:42 +11:00
|
|
|
void setHouse( Sapphire::HousePtr );
|
2018-11-29 16:55:48 +01:00
|
|
|
Sapphire::HousePtr getHouse() const;
|
2018-11-30 22:52:08 +11:00
|
|
|
Common::FFXIVARR_POSITION3 getMapMarkerPosition();
|
2018-12-21 22:08:05 +11:00
|
|
|
Common::LandIdent getLandIdent() const;
|
2018-11-01 00:18:19 +01:00
|
|
|
|
|
|
|
//Free Comapny
|
|
|
|
void setFreeCompany( uint32_t id, uint32_t icon, uint32_t color );
|
|
|
|
uint32_t getFcId();
|
|
|
|
uint32_t getFcIcon();
|
|
|
|
uint32_t getFcColor();
|
|
|
|
|
|
|
|
//Player
|
2018-12-19 16:03:35 +11:00
|
|
|
void setOwnerId( uint64_t id );
|
|
|
|
uint64_t getOwnerId();
|
2018-11-01 00:18:19 +01:00
|
|
|
//Housing Functions
|
2018-11-17 01:16:44 +01:00
|
|
|
void setCurrentPrice( uint32_t currentPrice );
|
2018-11-24 15:17:18 +11:00
|
|
|
bool setPreset( uint32_t itemId );
|
2018-11-15 12:40:02 +01:00
|
|
|
void updateLandDb();
|
|
|
|
void update( uint32_t currTime );
|
2018-11-01 00:18:19 +01:00
|
|
|
|
2018-11-04 23:47:10 +01:00
|
|
|
uint32_t getCurrentPrice() const;
|
2018-11-17 01:16:44 +01:00
|
|
|
uint32_t getMaxPrice() const;
|
2018-11-07 11:08:07 +01:00
|
|
|
uint32_t getDevaluationTime();
|
2018-11-04 23:47:10 +01:00
|
|
|
|
2018-11-10 19:00:13 +01:00
|
|
|
//House tags
|
|
|
|
void setLandTag( uint8_t slot, uint8_t tag );
|
|
|
|
uint8_t getLandTag( uint8_t slot );
|
|
|
|
|
2018-12-23 19:13:30 +11:00
|
|
|
InvMaxItemsPair getInventoryItemMax() const;
|
|
|
|
|
2018-11-01 00:18:19 +01:00
|
|
|
private:
|
2018-11-25 01:55:53 +11:00
|
|
|
uint32_t getNextHouseId();
|
2018-11-01 00:18:19 +01:00
|
|
|
|
2018-12-21 22:08:05 +11:00
|
|
|
Common::LandIdent m_landIdent;
|
|
|
|
|
2018-11-04 23:47:10 +01:00
|
|
|
uint32_t m_landSetId;
|
2018-12-31 21:54:32 +11:00
|
|
|
Common::HouseSize m_size;
|
|
|
|
Common::HouseStatus m_state;
|
2018-11-14 10:00:16 +01:00
|
|
|
Common::LandType m_type;
|
2018-11-14 09:22:17 +01:00
|
|
|
uint8_t m_iconAddIcon;
|
2018-11-14 10:00:16 +01:00
|
|
|
uint32_t m_fcId; // unclear, may be wrong
|
2018-11-14 09:22:17 +01:00
|
|
|
uint32_t m_fcIcon;
|
|
|
|
uint32_t m_fcIconColor;
|
|
|
|
|
2018-11-30 22:52:08 +11:00
|
|
|
Common::FFXIVARR_POSITION3 m_mapMarkerPosition;
|
|
|
|
|
2018-12-19 16:03:35 +11:00
|
|
|
uint64_t m_ownerId;
|
2018-11-29 16:55:48 +01:00
|
|
|
Sapphire::Data::HousingLandSetPtr m_landInfo;
|
2018-11-01 00:18:19 +01:00
|
|
|
|
2018-11-29 16:55:48 +01:00
|
|
|
Sapphire::HousePtr m_pHouse;
|
2018-11-19 09:40:44 +01:00
|
|
|
|
2018-11-01 00:18:19 +01:00
|
|
|
//item storage
|
2018-12-21 22:08:05 +11:00
|
|
|
uint16_t m_maxPlacedExternalItems;
|
|
|
|
uint16_t m_maxPlacedInternalItems;
|
2018-11-01 00:18:19 +01:00
|
|
|
|
|
|
|
//price
|
|
|
|
uint32_t m_initPrice;
|
|
|
|
uint32_t m_nextDrop;
|
|
|
|
uint32_t m_currentPrice;
|
2018-11-09 09:49:43 +01:00
|
|
|
uint32_t m_minPrice;
|
2018-11-17 01:16:44 +01:00
|
|
|
uint32_t m_maxPrice;
|
2018-11-10 19:00:13 +01:00
|
|
|
|
2018-11-11 14:27:39 +01:00
|
|
|
//information
|
|
|
|
char fcTag[7];
|
2018-11-10 19:00:13 +01:00
|
|
|
uint8_t m_tag[3];
|
2018-12-29 00:53:52 +01:00
|
|
|
|
|
|
|
FrameworkPtr m_pFw;
|
2018-11-01 00:18:19 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
2018-11-14 09:22:17 +01:00
|
|
|
#endif
|