Removed old random pack code. It was already disabled by the USE_NEW_PACK_SYSTEM flag.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1482 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2010-08-04 15:48:42 +00:00
parent 098e470ff9
commit 4532fade77
7 changed files with 5 additions and 353 deletions
-95
View File
@@ -15,100 +15,6 @@
#include <boost/random/mersenne_twister.hpp>
#include <boost/logic/tribool.hpp>
#define USE_NEW_PACK_SYSTEM 1
#if !USE_NEW_PACK_SYSTEM
// =================================================================================================== OLD
DECLARE_POINTER_TYPE(PackItemRef);
DECLARE_POINTER_TYPE(Card);
class Set;
class PackItemCache;
// ----------------------------------------------------------------------------- : PackType
/// A card pack description for playtesting
class PackType : public IntrusivePtrBase<PackType> {
public:
PackType();
String name; ///< Name of this pack
Scriptable<bool> enabled; ///< Is this pack enabled?
vector<PackItemRefP> items; ///< Cards in this pack
/// Update scripts, returns true if there is a change
bool update(Context& ctx);
/// Generate a random pack of cards, add them to out
void generate(PackItemCache& packs, boost::mt19937& gen, vector<CardP>& out) const;
private:
DECLARE_REFLECTION();
};
// ----------------------------------------------------------------------------- : PackItemRef
enum PackRefType
{ PACK_REF_REPLACE
, PACK_REF_NO_REPLACE
, PACK_REF_CYCLIC
};
class PackItemRef : public IntrusivePtrBase<PackItemRef> {
public:
PackItemRef();
String name; ///< Name of this type of cards
Scriptable<int> amount; ///< Number of cards of this type
PackRefType type;
/// Update scripts, returns true if there is a change
bool update(Context& ctx);
/// Generate random cards, add them to out
void generate(PackItemCache& packs, boost::mt19937& gen, vector<CardP>& out) const;
private:
DECLARE_REFLECTION();
};
// ----------------------------------------------------------------------------- : PackItem
/// A card type description for playtesting
class PackItem : public IntrusivePtrBase<PackItem> {
public:
String name; ///< Name of this type of cards
OptionalScript filter; ///< Filter to select this type of cards
/// Select *all* cards matching the filter
void generate(Set& set, vector<CardP>& out) const;
private:
DECLARE_REFLECTION();
};
// ----------------------------------------------------------------------------- : PackItemCache
class PackItemCache {
public:
PackItemCache(Set& set);
/// The cards for a given PackItem
vector<CardP>& cardsFor(const String& name);
private:
Set& set;
/// Cards for each PackItem
typedef shared_ptr<vector<CardP> > Cards;
map<String,Cards> item_cards;
};
#else
// =================================================================================================== NEW
DECLARE_POINTER_TYPE(PackType);
DECLARE_POINTER_TYPE(PackItem);
DECLARE_POINTER_TYPE(PackInstance);
@@ -240,4 +146,3 @@ class PackGenerator {
// ----------------------------------------------------------------------------- : EOF
#endif
#endif