auto propertyManagerPtr = NF_SHARE_PTR(NF_NEW NFIPropertyManager()); auto objId = NFGUID(); //Set property "Health" with value 100 propertyManagerPtr->SetPropertyInt(objId, "Health", 100); //Get property "Health" value int health = propertyManagerPtr->GetPropertyInt(objId, "Health");
auto propertyManagerPtr = NF_SHARE_PTRThis example demonstrates the use of the property manager to set and retrieve multiple properties for different game objects. We set the "Health", "Attack", and "Defense" properties for a "Player" object and retrieve the same properties for an "Enemy" object. Package library: NanoFrame (NF) library.(NF_NEW NFIPropertyManager()); auto playerObjId = NFGUID(); auto enemyObjId = NFGUID(); //Set "Player" game object properties propertyManagerPtr->SetPropertyInt(playerObjId, "Health", 100); propertyManagerPtr->SetPropertyInt(playerObjId, "Attack", 10); propertyManagerPtr->SetPropertyInt(playerObjId, "Defense", 5); //Get "Enemy" game object properties int enemyHealth = propertyManagerPtr->GetPropertyInt(enemyObjId, "Health"); int enemyAttack = propertyManagerPtr->GetPropertyInt(enemyObjId, "Attack"); int enemyDefense = propertyManagerPtr->GetPropertyInt(enemyObjId, "Defense");