Last active
April 30, 2018 17:07
-
-
Save johnX9/67a76f8a54d2297b817eba683dfc329d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//@abi action | |
void getplayer(const account_name account) { | |
playerIndex players(_self, _self); | |
auto iterator = players.find(account); | |
eosio_assert(iterator != players.end(), "Address for account not found"); | |
/** | |
* The "get" function returns a constant reference to the object | |
* containing the specified secondary key | |
*/ | |
auto currentPlayer = players.get(account); | |
print("Username: ", currentPlayer.username.c_str(), " Level: ", currentPlayer.level, " Health: ", currentPlayer.health_points, " Energy: ", currentPlayer.energy_points); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment