bool CCWorld::init(cocos2d::__String *id, CCGate *gate, cocos2d::__Dictionary *innerWorldsMap, cocos2d::__Dictionary *scores, cocos2d::__Array *missions) { bool result = CCSoomlaEntity::init(id); if (result) { setGate(gate); if (innerWorldsMap) { setInnerWorldsMap(innerWorldsMap); } else { setInnerWorldsMap(__Dictionary::create()); } if (scores) { setScores(scores); } else { setScores(__Dictionary::create()); } if (missions) { setMissions(missions); } else { setMissions(__Array::create()); } return true; } return result; }
bool CCWorld::init(cocos2d::__String *id) { bool result = CCSoomlaEntity::init(id); setInnerWorldsMap(__Dictionary::create()); setScores(__Dictionary::create()); setMissions(__Array::create()); if (result) { return true; } return result; }
/// Copy constructor MRMFeature::MRMFeature(const MRMFeature & rhs) : Feature(rhs), features_(rhs.features_), precursor_features_(rhs.precursor_features_), pg_scores_(rhs.pg_scores_), feature_map_(rhs.feature_map_), precursor_feature_map_(rhs.precursor_feature_map_) { setScores(rhs.getScores()); }
/// Assignment operator MRMFeature & MRMFeature::operator = (const MRMFeature &rhs) { if (&rhs == this) return *this; Feature::operator = (rhs); setScores(rhs.getScores()); features_ = rhs.features_; precursor_features_ = rhs.precursor_features_; feature_map_ = rhs.feature_map_; precursor_feature_map_ = rhs.precursor_feature_map_; return *this; }
bool CCWorld::initWithDictionary(cocos2d::__Dictionary *dict) { bool result = CCSoomlaEntity::initWithDictionary(dict); if (result) { Ref *ref; ref = dict->objectForKey(CCLevelUpConsts::JSON_LU_GATE); if (ref) { __Dictionary *gateDict = dynamic_cast<__Dictionary *>(ref); CC_ASSERT(gateDict); setGate((CCGate *) CCDomainFactory::getInstance()->createWithDictionary(gateDict)); } ref = dict->objectForKey(CCLevelUpConsts::JSON_LU_WORLDS); if (ref) { __Array *worldDictArray = dynamic_cast<__Array *>(ref); CC_ASSERT(worldDictArray); __Array *worldArray = CCDomainHelper::getInstance()->getDomainsFromDictArray(worldDictArray); __Dictionary *worldsMap = __Dictionary::create(); CCWorld *world; CCARRAY_FOREACH(worldArray, ref) { world = dynamic_cast<CCWorld *>(ref); CC_ASSERT(world); worldsMap->setObject(world, world->getId()->getCString()); world->setParentWorld(this); } setInnerWorldsMap(worldsMap); } ref = dict->objectForKey(CCLevelUpConsts::JSON_LU_SCORES); if (ref) { __Array *scoreDictArray = dynamic_cast<__Array *>(ref); CC_ASSERT(scoreDictArray); __Array *scoreArray = CCDomainHelper::getInstance()->getDomainsFromDictArray(scoreDictArray); __Dictionary *scoresMap = __Dictionary::create(); CCScore *score; CCARRAY_FOREACH(scoreArray, ref) { score = dynamic_cast<CCScore *>(ref); CC_ASSERT(score); scoresMap->setObject(score, score->getId()->getCString()); } setScores(scoresMap); }
void GridNode::reset() { setScores(0,0,0); parent_ = nullptr; }
Abilities::Abilities(){ setScores(0, 0, 0, 0, 0, 0); }