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"
|
|
|
|
|
|
|
|
namespace Core
|
|
|
|
{
|
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-11-04 23:47:10 +01:00
|
|
|
Land( uint16_t zoneId, uint8_t wardNum, uint8_t landId, uint32_t landSetId, Core::Data::HousingLandSetPtr info );
|
2018-11-01 23:56:43 +01:00
|
|
|
virtual ~Land();
|
2018-11-01 00:18:19 +01:00
|
|
|
|
|
|
|
void load();
|
|
|
|
|
|
|
|
//Primary state
|
2018-11-14 10:00:16 +01:00
|
|
|
void setSize( uint8_t size );
|
2018-11-01 00:18:19 +01:00
|
|
|
void setState( uint8_t state );
|
|
|
|
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-11-14 10:00:16 +01:00
|
|
|
uint8_t getSize() const;
|
2018-11-13 19:48:22 +01:00
|
|
|
uint8_t getState() const;
|
|
|
|
uint8_t getSharing() const;
|
|
|
|
uint32_t getLandSetId() const;
|
|
|
|
uint8_t getWardNum() const;
|
|
|
|
uint8_t getLandId() const;
|
2018-11-25 01:55:53 +11:00
|
|
|
uint16_t getTerritoryTypeId() const;
|
2018-11-13 19:48:22 +01:00
|
|
|
Common::LandType getLandType() const;
|
2018-11-19 09:40:44 +01:00
|
|
|
Core::HousePtr getHouse() 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
|
|
|
|
void setPlayerOwner( uint32_t id );
|
|
|
|
uint32_t getPlayerOwner();
|
|
|
|
//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
|
|
|
|
|
|
|
uint32_t getMaxItems();
|
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-11-01 00:18:19 +01:00
|
|
|
private:
|
2018-11-24 15:17:18 +11:00
|
|
|
uint32_t convertItemIdToHousingItemId( uint32_t itemId );
|
2018-11-03 00:47:45 +01:00
|
|
|
void init();
|
2018-11-25 01:55:53 +11:00
|
|
|
uint32_t getNextHouseId();
|
2018-11-01 00:18:19 +01:00
|
|
|
|
|
|
|
uint8_t m_wardNum;
|
2018-11-01 23:56:43 +01:00
|
|
|
uint8_t m_landId;
|
2018-11-04 23:47:10 +01:00
|
|
|
uint32_t m_landSetId;
|
2018-11-25 01:55:53 +11:00
|
|
|
uint16_t m_territoryTypeId;
|
2018-11-14 09:22:17 +01:00
|
|
|
uint8_t m_size;
|
|
|
|
uint8_t 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-01 00:18:19 +01:00
|
|
|
uint32_t m_ownerPlayerId;
|
2018-11-04 23:47:10 +01:00
|
|
|
Core::Data::HousingLandSetPtr m_landInfo;
|
2018-11-01 00:18:19 +01:00
|
|
|
|
2018-11-19 11:55:29 +01:00
|
|
|
Core::HousePtr m_pHouse;
|
2018-11-19 09:40:44 +01:00
|
|
|
|
2018-11-01 00:18:19 +01:00
|
|
|
//item storage
|
|
|
|
Core::ItemContainerPtr ItemsOutdoorContainer;
|
|
|
|
uint32_t m_maxItems;
|
|
|
|
|
|
|
|
//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-11-01 00:18:19 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
2018-11-14 09:22:17 +01:00
|
|
|
#endif
|