CArtHandler::CArtHandler() { //VLC->arth = this; // War machines are the default big artifacts. for (ArtifactID i = ArtifactID::CATAPULT; i <= ArtifactID::FIRST_AID_TENT; i.advance(1)) bigArtifacts.insert(i); }
void CArtHandler::initAllowedArtifactsList(const std::vector<bool> &allowed) { allowedArtifacts.clear(); treasures.clear(); minors.clear(); majors.clear(); relics.clear(); for (ArtifactID i=ArtifactID::SPELLBOOK; i<ArtifactID::ART_SELECTION; i.advance(1)) { //check artifacts allowed on a map //TODO: This line will be different when custom map format is implemented if (allowed[i] && legalArtifact(i)) allowedArtifacts.push_back(artifacts[i]); } for (ArtifactID i = ArtifactID::ART_SELECTION; i<ArtifactID(artifacts.size()); i.advance(1)) //try to allow all artifacts added by mods { if (legalArtifact(ArtifactID(i))) allowedArtifacts.push_back(artifacts[i]); //keep im mind that artifact can be worn by more than one type of bearer } }