Created
April 1, 2020 17:50
-
-
Save alexroan/d1d2aec28418b6154edb971a8cb3c701 to your computer and use it in GitHub Desktop.
Game.sol@3
This file contains hidden or 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
// Author: Alex Roan | |
pragma solidity ^0.5.5; | |
import "./TennisPlayer.sol"; | |
import "@openzeppelin/contracts/ownership/Ownable.sol"; | |
contract Game is Ownable { | |
address public playerTokenAddress; | |
uint private xp = 100; | |
uint8 private condition = 255; | |
uint8 private agility = 1; | |
uint8 private power = 1; | |
uint8 private stamina = 2; | |
uint8 private technique = 1; | |
constructor() public { | |
playerTokenAddress = address(new TennisPlayer()); | |
} | |
function newPlayer(string memory _name, uint8 _age, uint8 _height) public returns (uint){ | |
return TennisPlayer(playerTokenAddress).newPlayer( | |
xp, _name, _age, _height, condition, agility, power, stamina, technique, msg.sender | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment