mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
- Added new files that should have been in last commit
This commit is contained in:
parent
7725232253
commit
153dd1f5f9
@ -68,8 +68,8 @@ set(lib_SRCS
|
||||
CHeroHandler.cpp
|
||||
CModHandler.cpp
|
||||
CObstacleInstance.cpp
|
||||
CObjectWithReward.cpp
|
||||
CObjectConstructor.cpp
|
||||
CObjectWithReward.cpp
|
||||
CSpellHandler.cpp
|
||||
CThreadHelper.cpp
|
||||
CTownHandler.cpp
|
||||
|
12
lib/CObjectConstructor.cpp
Normal file
12
lib/CObjectConstructor.cpp
Normal file
@ -0,0 +1,12 @@
|
||||
#include "StdInc.h"
|
||||
#include "CObjectConstructor.h"
|
||||
|
||||
/*
|
||||
* CObjectConstructor.cpp, part of VCMI engine
|
||||
*
|
||||
* Authors: listed in file AUTHORS in main folder
|
||||
*
|
||||
* License: GNU General Public License v2.0 or later
|
||||
* Full text of license available in license.txt file, in main folder
|
||||
*
|
||||
*/
|
57
lib/CObjectConstructor.h
Normal file
57
lib/CObjectConstructor.h
Normal file
@ -0,0 +1,57 @@
|
||||
#pragma once
|
||||
|
||||
#include "CObjectWithReward.h"
|
||||
#include "CDefObjInfoHandler.h"
|
||||
#include "JsonNode.h"
|
||||
|
||||
/*
|
||||
* CObjectConstructor.h, part of VCMI engine
|
||||
*
|
||||
* Authors: listed in file AUTHORS in main folder
|
||||
*
|
||||
* License: GNU General Public License v2.0 or later
|
||||
* Full text of license available in license.txt file, in main folder
|
||||
*
|
||||
*/
|
||||
|
||||
class CRandomRewardObjectInfo : public IObjectInfo
|
||||
{
|
||||
JsonNode objectConfig;
|
||||
|
||||
public:
|
||||
bool givesResources() const override;
|
||||
|
||||
bool givesExperience() const override;
|
||||
bool givesMana() const override;
|
||||
bool givesMovement() const override;
|
||||
|
||||
bool givesPrimarySkills() const override;
|
||||
bool givesSecondarySkills() const override;
|
||||
|
||||
bool givesArtifacts() const override;
|
||||
bool givesCreatures() const override;
|
||||
bool givesSpells() const override;
|
||||
|
||||
bool givesBonuses() const override;
|
||||
|
||||
void configureObject(CObjectWithReward * object) const;
|
||||
|
||||
CRandomRewardObjectInfo()
|
||||
{}
|
||||
|
||||
void init(JsonNode objectConfig);
|
||||
};
|
||||
|
||||
class CObjectWithRewardConstructor : public IObjectTypeHandler
|
||||
{
|
||||
std::map<ui32, std::map<ui32, CRewardObjectInfo> > objectConfigs;
|
||||
|
||||
public:
|
||||
CGObjectInstance * create(ui32 id, ui32 subID) const override;
|
||||
|
||||
bool handlesID(ui32 id) const override;
|
||||
|
||||
void configureObject(CGObjectInstance * object) const override;
|
||||
|
||||
IObjectInfo * getObjectInfo(ui32 id, ui32 subID) const override;
|
||||
};
|
Loading…
Reference in New Issue
Block a user