1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Extract library entity randomization logic to separate class

This commit is contained in:
Ivan Savenko
2025-05-16 17:20:56 +03:00
parent 184e841b16
commit 54a46b77a9
55 changed files with 605 additions and 441 deletions

View File

@@ -0,0 +1,46 @@
/*
* IGameRandomizer.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
*
*/
#pragma once
#include "../constants/EntityIdentifiers.h"
VCMI_LIB_NAMESPACE_BEGIN
enum class EArtifactClass;
namespace vstd
{
class RNG;
}
/// Provides source of random rolls for game entities
/// Instance of this interface only exists on server
class IGameRandomizer : boost::noncopyable
{
public:
virtual ~IGameRandomizer();
virtual ArtifactID rollArtifact() = 0;
virtual ArtifactID rollArtifact(EArtifactClass type) = 0;
virtual ArtifactID rollArtifact(std::set<ArtifactID> filtered) = 0;
virtual std::vector<ArtifactID> rollMarketArtifactSet() = 0;
virtual CreatureID rollCreature() = 0;
virtual CreatureID rollCreature(int tier) = 0;
virtual HeroTypeID rollHero(PlayerColor player, FactionID faction) = 0;
virtual std::string rollTownName(FactionID faction) = 0;
virtual vstd::RNG & getDefault() = 0;
};
VCMI_LIB_NAMESPACE_END