2014-04-27 15:19:23 +03:00
|
|
|
#pragma once
|
|
|
|
|
2014-06-05 19:52:14 +03:00
|
|
|
#include "CRewardableObject.h"
|
2014-05-24 02:07:54 +03:00
|
|
|
#include "CObjectClassesHandler.h"
|
2014-06-05 19:52:14 +03:00
|
|
|
|
|
|
|
#include "../JsonNode.h"
|
2014-04-27 15:19:23 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* 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
|
|
|
|
{
|
2014-04-27 20:37:53 +03:00
|
|
|
JsonNode parameters;
|
2014-04-27 15:19:23 +03:00
|
|
|
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;
|
|
|
|
|
2014-06-05 14:19:47 +03:00
|
|
|
void configureObject(CRewardableObject * object, CRandomGenerator & rng) const;
|
2014-04-27 15:19:23 +03:00
|
|
|
|
|
|
|
CRandomRewardObjectInfo()
|
|
|
|
{}
|
|
|
|
|
2014-04-27 20:37:53 +03:00
|
|
|
void init(const JsonNode & objectConfig);
|
2014-04-27 15:19:23 +03:00
|
|
|
};
|
|
|
|
|
2014-06-05 14:19:47 +03:00
|
|
|
class CRewardableConstructor : public AObjectTypeHandler
|
2014-04-27 15:19:23 +03:00
|
|
|
{
|
2014-05-16 23:50:02 +03:00
|
|
|
CRandomRewardObjectInfo objectInfo;
|
2014-04-27 15:19:23 +03:00
|
|
|
|
|
|
|
public:
|
2014-06-05 14:19:47 +03:00
|
|
|
CRewardableConstructor();
|
2014-05-24 01:56:51 +03:00
|
|
|
void init(const JsonNode & config) override;
|
2014-04-27 20:37:53 +03:00
|
|
|
|
|
|
|
CGObjectInstance * create(ObjectTemplate tmpl) const override;
|
2014-04-27 15:19:23 +03:00
|
|
|
|
2014-05-17 17:50:11 +03:00
|
|
|
void configureObject(CGObjectInstance * object, CRandomGenerator & rng) const override;
|
2014-04-27 15:19:23 +03:00
|
|
|
|
2014-04-27 20:37:53 +03:00
|
|
|
const IObjectInfo * getObjectInfo(ObjectTemplate tmpl) const override;
|
2014-04-27 15:19:23 +03:00
|
|
|
};
|